OTelLog class
A simple log service that logs messages and signals to the console. It filters messages based on the current log level. Signals are not filtered based on log level Defaults to noop,
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- 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
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- currentLevel ↔ LogLevel
-
The current log level for filtering messages.
getter/setter pair
- exportLogFunction ↔ LogFunction?
-
To turn on logging for export, set this
to
print
(Dart) ordebugPrint
(Flutter) or any other LogFunction. Logging function specifically for export-related messages.getter/setter pair - logFunction ↔ LogFunction?
-
To turn on logging at the current level, set this
to
print
(Dart) ordebugPrint
(Flutter) or any other LogFunction. Logging function for general messages.getter/setter pair - metricLogFunction ↔ LogFunction?
-
To turn on logging for metrics, set this
to
print
(Dart) ordebugPrint
(Flutter) or any other LogFunction. Logging function specifically for metric-related messages.getter/setter pair - spanLogFunction ↔ LogFunction?
-
To turn on logging for spans, set this
to
print
(Dart) ordebugPrint
(Flutter) or any other LogFunction. Logging function specifically for span-related messages.getter/setter pair
Static Methods
-
debug(
String message) → void - Logs a debug-level message.
-
enableDebugLogging(
) → void - Sets the current log level to debug.
-
enableErrorLogging(
) → void - Sets the current log level to error.
-
enableFatalLogging(
) → void - Sets the current log level to fatal.
-
enableInfoLogging(
) → void - Sets the current log level to info.
-
enableTraceLogging(
) → void - Sets the current log level to trace.
-
enableWarnLogging(
) → void - Sets the current log level to warn.
-
error(
String message) → void - Logs an error-level message.
-
fatal(
String message) → void - Logs a fatal-level message.
-
info(
String message) → void - Logs an info-level message.
-
isDebug(
) → bool - Returns true if the current log level includes debug messages.
-
isError(
) → bool - Returns true if the current log level includes error messages.
-
isFatal(
) → bool - Returns true if the current log level includes fatal messages.
-
isInfo(
) → bool - Returns true if the current log level includes info messages.
-
isLogExport(
) → bool - Returns true if export logging is enabled.
-
isLogMetrics(
) → bool - Returns true if metric logging is enabled.
-
isLogSpans(
) → bool - Returns true if span logging is enabled.
-
isTrace(
) → bool - Returns true if the current log level includes trace messages.
-
isWarn(
) → bool - Returns true if the current log level includes warning messages.
-
log(
LogLevel level, String message) → void -
Generic log method. It prints the message if the
level
is at or above the currentLevel. -
logExport(
String message) → void - Logs an export-related message.
-
logMetric(
String message) → void - Logs a metric-related message.
-
logSpan(
String message) → void - Logs a span-related message.
-
trace(
String message) → void - Logs a trace-level message.
-
warn(
String message) → void - Logs a warning-level message.