Skip to content

[BUG] Level configuration has no effect #94

@detlefla

Description

@detlefla

Description

Calls to logger.configure(level=…) don't result in filtering out log messages with lower levels.

Steps to Reproduce

  1. Create a file logz.py
# file: logz.py
from logly import logger

logger.configure(level="ERROR")
logger.debug("debugging")

logger.configure(level="DEBUG")
logger.debug("debugging again")
  1. Run it
$ uv run --with logly logz.py

Expected Behavior

[DEBUG] debugging again | module=__main__ | function=<module>

Actual Behavior

[DEBUG] debugging | module=__main__ | function=<module>
[DEBUG] debugging again | module=__main__ | function=<module>

Logly Version

0.1.6

Python Version

Python 3.12.5, Python 3.13

Operating System

Debian Linux

Installation Method

uv

Additional Context

Additional logger.complete() calls before logger.configure() didn't help.

Only after

logger.remove_all()
logger.add("console", filter_min_level="ERROR")

the lower levels are filtered out as expected.

Internal Debug Logs (Optional but Highly Recommended)

[2025-10-27 00:45:10.732] [LOGLY-INFO] [debug_init] Internal debug logging started
[2025-10-27 00:45:10.732] [LOGLY-INFO] [init] PyLogger initialized (auto_update_check=true, internal_debug=true)
[2025-10-27 00:45:10.732] [LOGLY-INFO] [configure] Starting configuration
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] level = INFO
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] color = true
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] json = false
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] console = true
[2025-10-27 00:45:10.732] [LOGLY-INFO] [configure] Starting configuration
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] level = ERROR
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] color = true
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] json = false
[2025-10-27 00:45:10.732] [LOGLY-CONFIG] [configure] console = true
[2025-10-27 00:45:10.740] [LOGLY-INFO] [configure] Starting configuration
[2025-10-27 00:45:10.740] [LOGLY-CONFIG] [configure] level = DEBUG
[2025-10-27 00:45:10.740] [LOGLY-CONFIG] [configure] color = true
[2025-10-27 00:45:10.740] [LOGLY-CONFIG] [configure] json = false
[2025-10-27 00:45:10.740] [LOGLY-CONFIG] [configure] console = true

Solution Interest

No, I just want to report the issue

Question Type

No response

Additional Questions

The logly configuration should, for instance, be changed after processing CLI switches like --verbose or --debug. From the docs I would expect that simply calling logger.configure() can achieve this – do I misunderstand them?

Checklist

  • I have searched for similar issues and couldn't find any
  • I have tried the latest version of Logly
  • I have included all relevant information above

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions