Fixed
- Canvas results in
StdoutLoggerwere rendered with the redUSERcolour scheme becausemsg_levelwas set to'USER'instead of'CANVAS'. Added a dedicatedCANVASstyle branch inlog_to_stdout. Fixes #90 - Fixed
AttributeErrorcrash inStdoutLoggerwhen logging file results with no resolved user. The user dict is now coerced via(message.get('user') or {})before readingdisplay_name/email. Fixes #91 - Removed pointless retry on
log_to_stdoutexception inStdoutLogger.log. The previous handler retried with identical arguments and could only fail the same way; replaced with a single contextual error message. Fixes #92 (thanks @SAY-5) - A formatting failure inside
StdoutLogger.log_to_stdoutno longer terminates the process when debug mode is enabled. Thesys.exit(1)call has been removed; the traceback is still printed in debug mode and the scan continues. Fixes #95 JSONLoggerno longer subclasseslogging.Logger(the inheritance was unused — every emission already went throughself.logger) and no longer stacks duplicate handlers when instantiated more than once.addHandleris now guarded so the process-wide singleton fromlogging.getLogger('Slack Watchman')keeps a single handler. Fixes #98JSONLogger.lognow matchesWORKSPACE_PROBE(the level the caller actually passes) instead ofWORKSPACE_PROBE_INFORMATION. Probe results were silently falling through to the catch-allelsebranch and being emitted asCRITICALwith the wrong formatter. Fixes #99JSONLogger.lognow has explicitWARNING,ERROR, andCRITICALbranches that call the matchingself.logger.warning/error/criticalmethod. Previously all three (and any unknown level) hit the catch-allelseand were emitted asCRITICAL, so JSON output diverged fromStdoutLoggerand lost severity information. Fixes #100export_csvnow returns aboolindicating whether the CSV was written, and its callers in__init__.pylog aSUCCESSonly on success and anERRORon failure. Previously a write error was swallowed and the user saw aUsers output to CSV file: ...success line for a file that was never written. Also corrected the channels CSV success message (it was incorrectly labelledUsers output to CSV file). Fixes #102export_csvnow guards against empty input. The previousdataclasses.asdict(export_data[0])would raiseIndexError, which was hidden by the bareexceptand reported only as a strayprintline. Empty input now returnsFalsewithout opening a file. Fixes #103
Removed
- Redundant
f.close()call inexport_csvafter thewith open(...) as f:block (the context manager already closes the file). Fixes #104
Changed
- Converted the
notify_typecascade inStdoutLogger.logfrom a series of independentifs to anelifchain, since the branches are mutually exclusive. Avoids unnecessary string comparisons on every log call. Fixes #94 - Hoisted the colourising regexes (
_TYPE_COLORER,_HEADER_WORDS) inloggers.pyto module-level constants instead of recompiling them on everylog_to_stdoutcall. Fixes #96 - Replaced the 13 near-identical
elifcolour branches inStdoutLogger.log_to_stdoutwith a_LEVEL_STYLESdict lookup. Behaviour is unchanged for every existing level. Fixes #97 - Replaced the per-call
handler.setFormattermutation inJSONLogger.logwith a single_JSONFormatterthat builds the JSON envelope fromrecord.msgand anextra-suppliedlog_level. Eliminates the eight*_formatattributes, removes the not-thread-safe handler state swap, and keeps the JSON schema unchanged for every existing level. Fixes #101