ConsoleNodeLogger class
Bridges the node runtime's structured omnyhub.Logger to a plain line sink
(the CLI's stdout), so what the Hub tells a node actually reaches the
operator.
The runtime already emits the useful things — a Hub rejection with its code
and message (principal … may not register node …), a connection failure
with its cause — but its default logger is a omnyhub.NoopLogger, so
embedding OmnyServer prints nothing unless asked. Without this, a node that
authenticates and is then refused registration retries in total silence.
minLevel gates verbosity: the default surfaces only problems
(omnyhub.LogLevel.warn and up); --verbose lowers it to see the lifecycle.
Consecutive identical lines are collapsed, so a node that keeps retrying a
rejection it cannot fix says why once, not once per backoff.
Constructors
- ConsoleNodeLogger(void sink(String message), {LogLevel minLevel = omnyhub.LogLevel.warn})
-
Creates a logger writing to
sink.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- minLevel → LogLevel
-
The lowest severity that is emitted.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sink → void Function(String message)
-
Where formatted lines go — typically the CLI's stdout writer.
final
Methods
-
child(
Map< String, Object?> context) → Logger -
Returns a logger that merges
contextinto every record it emits. -
debug(
String message, {Map< String, Object?> context = const {}}) → void -
Convenience for
LogLevel.debug.inherited -
error(
String message, {Map< String, Object?> context = const {}}) → void -
Convenience for
LogLevel.error.inherited -
info(
String message, {Map< String, Object?> context = const {}}) → void -
Convenience for
LogLevel.info.inherited -
log(
LogLevel level, String message, {Map< String, Object?> context = const {}}) → void -
Emits a log record at
levelwithmessageand optionalcontext. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
warn(
String message, {Map< String, Object?> context = const {}}) → void -
Convenience for
LogLevel.warn.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited