mirror of
https://github.com/onyx-and-iris/obsws-cli.git
synced 2026-03-03 00:39:12 +00:00
Compare commits
4 Commits
45479563a0
...
35be262b2a
| Author | SHA1 | Date | |
|---|---|---|---|
| 35be262b2a | |||
| 58907fe2b5 | |||
| 1a05a89042 | |||
| 13a2443d48 |
10
CHANGELOG.md
10
CHANGELOG.md
@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
# [0.24.8] - 2026-02-07
|
||||
|
||||
### Changed
|
||||
|
||||
- --debug flag removed and replaced with --loglevel. See [Flags](https://github.com/onyx-and-iris/obsws-cli/tree/main?tab=readme-ov-file#flags). This gives the user more control over the level of logging. The default level has been set to WARNING.
|
||||
|
||||
### Fixed
|
||||
|
||||
- shell completion now works, see [Shell Completion](https://github.com/onyx-and-iris/obsws-cli/tree/main?tab=readme-ov-file#shell-completion). Unfortunately, command aliases in the help output are no longer present as it was breaking shell completion. However, the aliases do still work. See [issue #3](https://github.com/onyx-and-iris/obsws-cli/issues/3)
|
||||
|
||||
# [0.24.6] - 2026-01-26
|
||||
|
||||
### Changed
|
||||
|
||||
@ -49,6 +49,8 @@ The CLI should now be discoverable as `obsws-cli`
|
||||
- --password/-p: Websocket password
|
||||
- --timeout/-T: Websocket timeout
|
||||
- --version/-v: Print the obsws-cli version
|
||||
- --loglevel/-l: Set the application's logging level
|
||||
- One of *DEBUG, INFO, WARNING, ERROR, CRITICAL*
|
||||
|
||||
Pass `--host`, `--port` and `--password` as flags on the root command, for example:
|
||||
|
||||
@ -66,6 +68,7 @@ Store and load environment variables from:
|
||||
OBSWS_CLI_HOST=localhost
|
||||
OBSWS_CLI_PORT=4455
|
||||
OBSWS_CLI_PASSWORD=<websocket password>
|
||||
OBSWS_CLI_LOGLEVEL=DEBUG
|
||||
```
|
||||
|
||||
Flags can be used to override environment variables.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
__version__ = '0.24.7'
|
||||
__version__ = '0.24.8'
|
||||
|
||||
@ -28,11 +28,15 @@ def version_callback(value: bool):
|
||||
raise typer.Exit()
|
||||
|
||||
|
||||
def setup_logging(debug: bool):
|
||||
def setup_logging(loglevel: str):
|
||||
"""Set up logging for the application."""
|
||||
log_level = logging.DEBUG if debug else logging.CRITICAL
|
||||
loglevel = loglevel.upper()
|
||||
if loglevel not in ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']:
|
||||
raise typer.BadParameter(
|
||||
f'Invalid log level: {loglevel}. Choose from DEBUG, INFO, WARNING, ERROR, CRITICAL.'
|
||||
)
|
||||
logging.basicConfig(
|
||||
level=log_level,
|
||||
level=loglevel,
|
||||
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
|
||||
)
|
||||
|
||||
@ -121,19 +125,18 @@ def main(
|
||||
callback=version_callback,
|
||||
),
|
||||
] = False,
|
||||
debug: Annotated[
|
||||
bool,
|
||||
loglevel: Annotated[
|
||||
str,
|
||||
typer.Option(
|
||||
'--debug',
|
||||
'-d',
|
||||
envvar='OBSWS_CLI_DEBUG',
|
||||
'--loglevel',
|
||||
'-l',
|
||||
envvar='OBSWS_CLI_LOGLEVEL',
|
||||
is_eager=True,
|
||||
help='Enable debug logging',
|
||||
help='Set the logging level',
|
||||
show_default=False,
|
||||
callback=setup_logging,
|
||||
hidden=True,
|
||||
),
|
||||
] = envconfig.get('debug'),
|
||||
] = envconfig.get('loglevel'),
|
||||
):
|
||||
"""obsws_cli is a command line interface for the OBS WebSocket API."""
|
||||
ctx.ensure_object(dict)
|
||||
|
||||
@ -124,7 +124,7 @@ _envconfig = EnvConfig(
|
||||
OBSWS_CLI_PORT=4455,
|
||||
OBSWS_CLI_PASSWORD='',
|
||||
OBSWS_CLI_TIMEOUT=5,
|
||||
OBSWS_CLI_DEBUG=False,
|
||||
OBSWS_CLI_LOGLEVEL='WARNING',
|
||||
OBSWS_CLI_STYLE='disabled',
|
||||
OBSWS_CLI_STYLE_NO_BORDER=False,
|
||||
)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user