refactor(logging): preserve tracebacks and add channel context
- Preserve tracebacks: logger.error in except blocks → logger.exception - Channel context: BaseChannel injects self.logger = logger.bind(channel=name) - Third-party bridge: redirect_lib_logging() replaces ad-hoc stdlib-to-loguru bridges - Log levels: network timeouts downgraded from ERROR → WARNING - Fix --verbose flag to actually work with loguru (set handler to DEBUG)
This commit is contained in:
@@ -835,7 +835,7 @@ async def test_start_logs_install_hint_when_pyjwt_missing(make_channel, monkeypa
|
||||
ch = make_channel()
|
||||
errors = []
|
||||
monkeypatch.setattr(msteams_module, "MSTEAMS_AVAILABLE", False)
|
||||
monkeypatch.setattr(msteams_module.logger, "error", lambda message, *args: errors.append(message.format(*args)))
|
||||
monkeypatch.setattr(ch.logger, "error", lambda message, *args: errors.append(message.format(*args)))
|
||||
|
||||
await ch.start()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user