Skip to main content

sl 2.0.0 copy "sl: ^2.0.0" to clipboard
sl: ^2.0.0 copied to clipboard

A structured logging library.

2.0.0 #

Breaking changes #

  • Removed middlewares from LogTextHandler and LogJsonHandler. Wrap the handler in LogMiddlewareHandler instead.
  • LogTextHandler.sink and LogJsonHandler.sink are now StringSink instead of IOSink.

Features #

  • Added LogMiddlewareHandler for applying middlewares to any handler.
  • Added Logger.defaultLogger, Logger.setDefault and Logger.named.
  • Added LogMemoryHandler for keeping recent records in memory.

Fixes #

  • LogTextHandler no longer drops attributes matching scopeKey inside groups.
  • LogJsonHandler no longer lets attributes override the built-in time, level, msg and source fields.
  • LogJsonHandler omits empty groups.

1.2.0 #

  • Added Logger.enabled method to check if logging is enabled for a given level and context.

1.1.0 #

  • Improved formatting and readability of multiline error logs and stack traces in LogTextHandler.

1.0.0 #

  • Added automatic Context.current propagation in Logger.log when no explicit ctx parameter is passed.

0.0.5 #

  • Added withGroup

0.0.4 #

  • Added addSource option to LogJsonHandler and LogTextHandler to include caller location in logs.
  • Added LogMultiHandler to route logs to multiple handlers.

0.0.3 #

  • Introduced context-aware logging using ctx/attrs named parameters and middlewares support.

0.0.2 #

  • Switched context logger key from String to Object to prevent name collisions.

0.0.1 #

  • Initial version.
0
likes
150
points
1.99k
downloads

Documentation

API reference

Publisher

verified publisherpusk.software

Weekly Downloads

A structured logging library.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

ctx, logging, meta, stack_trace

More

Packages that depend on sl