LoggerConfig class
Configuration options for EntiDBLogger.
Use this class to customize logger behavior, including log file path, minimum log level, and console output settings.
Example usage:
// Use predefined configurations
await EntiDBLogger.initialize(config: LoggerConfig.development);
// Or create a custom configuration
final config = LoggerConfig(
logPath: 'logs/custom.log',
minLevel: LogLevel.warning,
enableConsoleOutput: true,
);
await EntiDBLogger.initialize(config: config);
- Annotations
-
- @immutable
Constructors
- LoggerConfig({String logPath = DatabaseFilePaths.logPath, LogLevel minLevel = LogLevel.info, bool enableConsoleOutput = false})
-
Creates a new logger configuration.
const
Properties
- enableConsoleOutput → bool
-
Whether to also print log messages to the console.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- logPath → String
-
Path to the log file.
final
- minLevel → LogLevel
-
Minimum level of messages to log.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? logPath, LogLevel? minLevel, bool? enableConsoleOutput}) → LoggerConfig - Creates a copy of this configuration with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- development → const LoggerConfig
- Configuration for development with console output and debug logging.
- production → const LoggerConfig
- Default configuration for production use.