Logecom class
Simple but powerful middleware-based Logging system inspired by Nodejs Express http library.
Motivation: There are many logging libraries present with different approaches and interfaces. If you want to migrate from one logger to another, you must refactor lots of entry points in your application where particular logger is initialized or used.
The idea is to abstract from logging process as much as possible and to define simple common interface with minimal overhead and give a stack to implement any logging pipeline with desired functionality in single place.
There is basically the only interface introduced for any log processing: LogTranslator
By implementing it in different ways it is possible to achieve any result. You can transform, format, collect, print or send, and even use another logger! - anything you want inside this pipeline.
Implementing LogTranslator by Logecom itself makes it possible to create complex logs translation logic when one logger pipeline can be applied up to another (conditionally, for example) if needed ;)
- Implemented types
Constructors
- Logecom()
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
pipeline
↔ List<
LogTranslator> -
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
translate(
LogEntry entry, LogTranslatorNextFunction? next) → void -
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createLogger(
dynamic category) → Logger - Create Logger instance for specified category. Common pattern is to use class name as a category specifier: