AppLogs class
A utility class for logging messages with different severity levels.
Constructors
- AppLogs.new()
-
factory
Properties
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
- instance → AppLogs
-
no setter
- printHandle ↔ bool
-
A flag indicating whether logging is enabled or not.
If true, no log messages will be printed.
getter/setter pair
-
screens
↔ List<
String> -
A list of screen names for which logs should be printed.
If this list is not empty, only logs for the specified screens will be printed.
getter/setter pair
Static Methods
-
colorTo(
LogColors? color, [LogColors defaultColor = LogColors.magenta]) → String -
Converts a given
color
to its value representation. Ifcolor
is null, it returns the value ofdefaultColor
. -
logError(
String? text, {String? name, String? error, StackTrace? stackTrace, LogColors? msgColor, LogColors? textColor, LogColors? fileNameColor, LogColors? errorColor, LogColors? stackTraceColor}) → void -
Logs an error message with the specified
error
,text
,name
, andstackTrace
. -
logMessage(
String? text, {String? name, LogColors? msgColor, LogColors? textColor, LogColors? fileNameColor}) → void -
Logs a message with the specified
text
and optionalname
. -
logSuccess(
String? text, {String? name, LogColors? msgColor, LogColors? textColor, LogColors? fileNameColor}) → void -
Logs a success message with the specified
text
andname
. -
logWarning(
String? text, {String? name, String? error, StackTrace? stackTrace, LogColors? msgColor, LogColors? textColor, LogColors? fileNameColor, LogColors? warningColor, LogColors? stackTraceColor}) → void -
Logs a warning message with the specified
text
,name
,error
, andstackTrace
. -
settings(
bool enabled) → dynamic