logging_utils library

A package for logging with more extensive options than the built in logger.

Classes

AsyncLogger
AsyncLogger class
ConsoleAndFileSink
A LoggerSink that logs to both the terminal and a file
ConsoleSink
A LoggerSink that logs to the terminal
CustomSink
A user implemented LoggerSink that eg. could be used to send the LogEntry representations to a remote logging server
FileSink
A LoggerSink that logs a file
LogEntry
An entry in the log containing a single message. LoggerSink instances use the asString method to represent LogEntry instances.
LoggerSink
Base class of all LoggerSink derivatives to enforce LoggerSink.flush and LoggerSink.start to exist.
ThreadedLogger
ThreadedLogger class

Enums

DateTimeFMT
Controls the formatting of the timestamps in the log. The options are DateTimeFMT.DATE for year-month-day, DateTimeFMT.TIME for hour:minute:second.microsecond DateTimeFMT.DATETIME for year-month-day hour:minute:second.microsecond, DateTimeFMT.TS_MS for milliseconds since epoch, DateTimeFMT.TS_US for microseconds since epoch
FileSinkStartBehavior
Specifies whether LoggerSink instances that - among others - log to a file, should clear the file on LoggerSink.start
LogLevel
LogLevel of a LogEntry controls whether it appears in a log. The options in increasing severity: LogLevel.DEBUG, LogLevel.INFO, LogLevel.WARNING, LogLevel.ERROR, LogLevel.CRITICAL

Properties

logging Logger
Root logger, preconfigured to log in the terminal
final

Typedefs

Logger = AsyncLogger
A shorthand for the AsyncLogger