strlog library
Package library strlog
provides fast, structured, leveled logger.
To use this library in your code
import 'package:strlog/strlog.dart';
This package exposes the main class Logger used to instantiate both detached and hierarchical loggers, Field class and its custom extensions for builtin types (e.g. Bool, Int, etc.) - elementary blocks for building context bound structured logging entries.
Example
final logger = Logger.getLogger('strlog.example.hierarchical');
logger.context({
Str('hello', 'world'),
}).info('Example');
Classes
- Bool
- A field with value of a bool type.
- Double
- A field with value of a double type.
- DTM
- A field with value of a DateTime type.
- Dur
- A field with value of a Duration? type.
-
Field<
V> - A Field used to add a key-value pair to a logger's context.
- FieldKind
- FieldKind represents a Field.value type. It is used for Field serialization to remove necessity to dynamically probe Field.value type.
- Group
- A field as a group of other fields.
- Handler
- Handler is capable to process logging Records as the are added to a Logger.
- Int
- A field with value of a int? type.
- Interface
- Interface represents a set of common methods that is implemented by both Logger and logging context returned by Interface.withFields.
- Level
- Severity level of the record used to controls output of particular logger.
- Loggable
- Loggable provides the ability for an object to be logged as part of a logging context field set.
- Logger
- Logger is used to emit logging messages.
- Num
- A field with value of a num type.
- Obj
- A field with a value of a custom type (i.e., a class that implements Loggable).
- Record
- A single record emitted by a Logger.
- Str
- A field with value of a String type.
- Timer
- Timer is used to measure time between Interface.startTimer and Timer.stop calls.
Mixins
- LoggerBase
- Base mixin for implementing Logger.
Extensions
- DefaultLog on Interface
- DefaultLog defines Interface.log aliases on Interface for some predefined Levels.