LogStrategy class abstract

An abstract class that represents a logging strategy.

This class provides the structure for implementing various logging strategies, allowing for detailed control over how messages, errors, and fatal errors are logged depending on their level and the events they are associated with.

Implementations of this class should define how messages, errors, and fatal errors are logged, potentially using different mechanisms or external systems.

Implementers

Constructors

LogStrategy({LogLevel loggerLogLevel = LogLevel.none, LogLevel logLevel = LogLevel.none, List<LogEvent>? supportedEvents})
Constructs a LogStrategy.

Properties

hashCode int
The hash code for this object.
no setterinherited
loggerLogLevel LogLevel
The log level set by the logger using this strategy. Used to determine if a message should be logged.
getter/setter pair
logLevel LogLevel
The minimum log level that this strategy handles for logging.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
supportedEvents List<LogEvent>?
A list of specific LogEvent types that this strategy supports. If null, all events are considered supported.
getter/setter pair

Methods

error({dynamic error, StackTrace? stackTrace, LogEvent? event}) Future<void>
Abstract method to log an error.
fatal({dynamic error, StackTrace? stackTrace, LogEvent? event}) Future<void>
Abstract method to log a fatal error.
log({dynamic message, LogEvent? event}) Future<void>
Abstract method to log a message or event.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
shouldLog({LogEvent? event}) bool
Determines whether a log operation should proceed based on the event and log level.
toString() String
Provides a string representation of the strategy including its type and log level.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited