Compare commits

..

No commits in common. "35be262b2a9de76bd0c30f6a89d3607e8bb05a5b" and "45479563a044dd91160bf947a0ed55f490849b97" have entirely different histories.

5 changed files with 13 additions and 29 deletions

View File

@ -5,16 +5,6 @@ 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/), 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). 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 # [0.24.6] - 2026-01-26
### Changed ### Changed

View File

@ -49,8 +49,6 @@ The CLI should now be discoverable as `obsws-cli`
- --password/-p: Websocket password - --password/-p: Websocket password
- --timeout/-T: Websocket timeout - --timeout/-T: Websocket timeout
- --version/-v: Print the obsws-cli version - --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: Pass `--host`, `--port` and `--password` as flags on the root command, for example:
@ -68,7 +66,6 @@ Store and load environment variables from:
OBSWS_CLI_HOST=localhost OBSWS_CLI_HOST=localhost
OBSWS_CLI_PORT=4455 OBSWS_CLI_PORT=4455
OBSWS_CLI_PASSWORD=<websocket password> OBSWS_CLI_PASSWORD=<websocket password>
OBSWS_CLI_LOGLEVEL=DEBUG
``` ```
Flags can be used to override environment variables. Flags can be used to override environment variables.

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online> # SPDX-FileCopyrightText: 2025-present onyx-and-iris <code@onyxandiris.online>
# #
# SPDX-License-Identifier: MIT # SPDX-License-Identifier: MIT
__version__ = '0.24.8' __version__ = '0.24.7'

View File

@ -28,15 +28,11 @@ def version_callback(value: bool):
raise typer.Exit() raise typer.Exit()
def setup_logging(loglevel: str): def setup_logging(debug: bool):
"""Set up logging for the application.""" """Set up logging for the application."""
loglevel = loglevel.upper() log_level = logging.DEBUG if debug else logging.CRITICAL
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( logging.basicConfig(
level=loglevel, level=log_level,
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
) )
@ -125,18 +121,19 @@ def main(
callback=version_callback, callback=version_callback,
), ),
] = False, ] = False,
loglevel: Annotated[ debug: Annotated[
str, bool,
typer.Option( typer.Option(
'--loglevel', '--debug',
'-l', '-d',
envvar='OBSWS_CLI_LOGLEVEL', envvar='OBSWS_CLI_DEBUG',
is_eager=True, is_eager=True,
help='Set the logging level', help='Enable debug logging',
show_default=False, show_default=False,
callback=setup_logging, callback=setup_logging,
hidden=True,
), ),
] = envconfig.get('loglevel'), ] = envconfig.get('debug'),
): ):
"""obsws_cli is a command line interface for the OBS WebSocket API.""" """obsws_cli is a command line interface for the OBS WebSocket API."""
ctx.ensure_object(dict) ctx.ensure_object(dict)

View File

@ -124,7 +124,7 @@ _envconfig = EnvConfig(
OBSWS_CLI_PORT=4455, OBSWS_CLI_PORT=4455,
OBSWS_CLI_PASSWORD='', OBSWS_CLI_PASSWORD='',
OBSWS_CLI_TIMEOUT=5, OBSWS_CLI_TIMEOUT=5,
OBSWS_CLI_LOGLEVEL='WARNING', OBSWS_CLI_DEBUG=False,
OBSWS_CLI_STYLE='disabled', OBSWS_CLI_STYLE='disabled',
OBSWS_CLI_STYLE_NO_BORDER=False, OBSWS_CLI_STYLE_NO_BORDER=False,
) )