jetlog library

Package library jetlog provides fast, structured, leveled logger.

To use this library in your code

import 'package:jetlog/jetlog.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('jetlog.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.
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.bind.
Level
Severity level of the record used to controls output of particular logger.
Loggable
Loggable provides the ability to object to be logged as part of 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 value of custom type (i.e. class that implements Loggable).
Record
A single record emitted by a Logger.
Str
A field with value of a String type.
Tracer
Tracer is used to measure time between Interface.trace and Tracer.stop calls.

Mixins

LoggerBase
Base mixin for implementing Logger.

Extensions

DefaultLog on Interface
DefaultLog defines Interface.log aliases on Interface for some predefined Levels.

Constants

Any → const _Any
Any takes a key and an arbitrary values and choose the one that fits.

Typedefs

Filter = bool Function(Record)
Filter used to filter Records by criteria.
ValueProducer<V> = V Function()