Prechádzať zdrojové kódy

change default log level from `debug` to `info`

Fabian Peter Hammerle 3 mesiacov pred
rodič
commit
15ba7db0f4
3 zmenil súbory, kde vykonal 5 pridanie a 4 odobranie
  1. 2 1
      CHANGELOG.md
  2. 2 2
      systemctl_mqtt/__init__.py
  3. 1 1
      tests/test_cli.py

+ 2 - 1
CHANGELOG.md

@@ -8,11 +8,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
 ### Added
 - suspend when receiving message on topic `systemctl/[hostname]/suspend`
   (https://github.com/fphammerle/systemctl-mqtt/issues/97)
-- command-line option `--log-level {debug,info,warning,error,critical}`
 - automatic discovery in home assistant:
   - entity `button.[hostname]_logind_lock_all_sessions`
   - entity `button.[hostname]_logind_poweroff`
   - entity `button.[hostname]_logind_suspend`
+- command-line option `--log-level {debug,info,warning,error,critical}`
 - declare compatibility with `python3.11`, `python3.12` & `python3.13`
 
 ### Changed
@@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
     from 3.8 to 3.12
   - support build without git history by manually setting build argument
     `SETUPTOOLS_SCM_PRETEND_VERSION`
+- changed default log level from `debug` to `info`
 
 ### Fixed
 - apparmor profile for architectures other than x86_64/amd64

+ 2 - 2
systemctl_mqtt/__init__.py

@@ -366,8 +366,8 @@ def _main() -> None:
     argparser.add_argument(
         "--log-level",
         choices=_ARGUMENT_LOG_LEVEL_MAPPING.keys(),
-        default="debug",
-        help="log level (default: debug)",
+        default="info",
+        help="log level (default: %(default)s)",
     )
     argparser.add_argument("--mqtt-host", type=str, required=True)
     argparser.add_argument(

+ 1 - 1
tests/test_cli.py

@@ -32,7 +32,7 @@ import systemctl_mqtt._utils
 @pytest.mark.parametrize(
     ("args", "log_level"),
     [
-        ([], logging.DEBUG),
+        ([], logging.INFO),
         (["--log-level", "debug"], logging.DEBUG),
         (["--log-level", "info"], logging.INFO),
         (["--log-level", "warning"], logging.WARNING),