L class

Logger

Cross-platform html/io Logger with simple API. No need to create an object. Just import and use. Simple and w/o boilerplate. Work with native console and can store logs in txt files (io) and indexedDB (web). You can change verbose level and resume/pause log queue, also you can clear console.

Key features

MethodDescription
sA shout is always displayed
vRegular message with verbose level 1
eError message with verbose level 1
vvRegular message with verbose level 2
wWarning message with verbose level 2
vvvRegular message with verbose level 3
iInform message with verbose level 3
vvvvRegular message with verbose level 4
dDebug message with verbose level 4
vvvvvRegular message with verbose level 5
vvvvvvRegular message with verbose level 6

Setup and management

MethodDescription
lvlLimiting output level (r: 3, d: 6)
storeSet to true to save logs (false)
wideDisplay wide prefix entry (false)
pausePause for message queue
resumeContinued after a pause
clearConsole cleaning

Integration capabilities

MethodDescription
streamBroadcast stream receiving logs.
mwMiddleware queue with functions

Constructors

L()
Factory singleton instance of Logger
factory

Properties

hashCode int
The hash code for this object. [...]
final
isPaused bool
Message queie is paused?
read-only, inherited
lvl int
Limiting output level (default 3 in release, 6 in debug) Get current log level in range 0..6
read / write, inherited
mw Queue<Future<void> Function(LogMessage)>
Middleware queue with functions
final, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
store bool
Set to true to save logs (default is false)
read / write, inherited
stream Stream<LogMessage>
Broadcast stream instantly receiving logs.
final, inherited
wide bool
Display wide prefix entry
read / write, inherited

Methods

clear() FutureOr<void>
Console cleaning (if a terminal is connected)
inherited
close() Future<void>
Close Logger Caution, this is permanent!
@mustCallSuper, inherited
d(dynamic message) → void
Debug message with verbose level 4
e(dynamic message) → void
Error message with verbose level 1
i(dynamic message) → void
Inform message with verbose level 3
log(Object message, LogLevel prefix) → void
Add log to queue
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
p({String header, String data, String footer, int percent: 0}) → void
Progress bar [...]
pause() → void
Pause for message queue
@mustCallSuper, inherited
resume() → void
Continued after a pause
@mustCallSuper, inherited
s(dynamic message) → void
A shout is always displayed
toString() String
Returns a string representation of this object.
override
v(dynamic message) → void
Regular message with verbose level 1
vv(dynamic message) → void
Regular message with verbose level 2
vvv(dynamic message) → void
Regular message with verbose level 3
vvvv(dynamic message) → void
Regular message with verbose level 4
vvvvv(dynamic message) → void
Regular message with verbose level 5
vvvvvv(dynamic message) → void
Regular message with verbose level 6
w(dynamic message) → void
Warning message with verbose level 2

Operators

operator +(int v) → void
Increment log level
operator -(int v) → void
Decrement log level
operator <(Object info) → void
Add Inform message with verbose level 3
operator <<(Object debug) → void
Add Debug message with verbose level 4
operator ==(Object obj) bool
The equality operator. [...]
override
operator ~() → void
[...]