LogsLevel enum

LoggerConfig class and Log utility

This setup allows you to configure the logger comprehensively through the LoggerConfig class, including setting the log level. This approach keeps your configuration centralized and easy to manage.

Usage:

  1. Define the configuration for your logger using LoggerConfig:
final loggerConfig = LoggerConfig(
  debugOnly: true, // Log only in debug mode
  methodCount: 3, // Number of method calls to be displayed
  errorMethodCount: 5, // Number of method calls if stacktrace is provided
  lineLength: 100, // Width of the output
  colors: true, // Colorful log messages
  printEmojis: true, // Print an emoji for each log message
  printTime: true, // Should each log print contain a timestamp
  logLevel: LogLevel.warning, // Set the logging level
);
  1. Initialize the logger with the configuration:
Log.init(loggerConfig);
  1. Use the Log class to log messages:
Log.d("This is a debug message");
Log.e("This is an error message");
Log.i("This is an info message");
Log.t("This is a trace message");
Log.f("This is a fatal message");
Inheritance
Available extensions

Values

warning → const LogsLevel
error → const LogsLevel
all → const LogsLevel
debug → const LogsLevel
fatal → const LogsLevel
info → const LogsLevel
off → const LogsLevel
trace → const LogsLevel

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
name String

Available on Enum, provided by the EnumName extension

The name of the enum value.
no setter
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

Constants

values → const List<LogsLevel>
A constant List of the values in this enum, in order of their declaration.