sm_logger library

Classes

AdvancedFileOutput
Accumulates logs in a buffer to reduce frequent disk, writes while optionally switching to a new log file if it reaches a certain size.
AnsiColor
This class handles colorizing of terminal output.
ConsoleOutput
Default implementation of LogOutput.
DateTimeFormat
DevelopmentFilter
Prints all logs with level >= Logger.level while in development mode (eg when asserts are evaluated, Flutter calls this debug mode).
FileOutput
HybridPrinter
A decorator for a LogPrinter that allows for the composition of different printers to handle different log messages. Provide it's constructor with a base printer, but include named parameters for any levels that have a different printer:
LogEvent
LogFilter
An abstract filter of log messages.
LogfmtPrinter
Outputs a logfmt message:
Logger
Use instances of logger to send log messages to the LogPrinter.
LogOutput
Log output receives a OutputEvent from LogPrinter and sends it to the desired destination.
LogPrinter
An abstract handler of log events.
MemoryOutput
Buffers OutputEvents.
MLogFilter
MLogger
MPrettyPrinter
MultiOutput
Logs simultaneously to multiple LogOutput outputs.
OutputEvent
PrefixPrinter
A decorator for a LogPrinter that allows for the prepending of every line in the log output with a string for the level of that log. For example:
PrettyPrinter
Default implementation of LogPrinter.
ProductionFilter
Prints all logs with level >= Logger.level even in production.
SimplePrinter
Outputs simple log messages:
StreamOutput

Enums

Level
Levels to control logging output. Logging can be enabled to include all levels above certain Level.

Constants

consoleOutputLength → const int
errorMethodCount → const int
methodCount → const int

Properties

kPrintable bool
是否打印日志, 默认为 kDebugMode
no setter
logger MLogger
final

Typedefs

DateTimeFormatter = String Function(DateTime time)
LogCallback = void Function(LogEvent event)
OutputCallback = void Function(OutputEvent event)