Logger class

A flexible logging utility that provides colored output and caller information

Constructors

Logger({String? tag, bool? enableColors, bool? enableLogging, bool? showFunctionName, bool? showLocation})
Creates a new Logger instance

Properties

className String?
final
enableColors bool
getter/setter pair
enableLogging bool
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showClassName bool
final
showFunctionName bool
getter/setter pair
showLocation bool
getter/setter pair
tag String?
final

Methods

configure({bool? enableColors, bool? enableLogging, bool? showFunctionName, bool? showLocation}) → void
Configure multiple local logger settings at once
d(String message) → void
Short alias for debug()
debug(String message) → void
Log a debug message
e(String message) → void
Short alias for error()
error(String message) → void
Log an error message
i(String message) → void
Short alias for info()
info(String message) → void
Log an info message
json(Object? object, {LogLevel level = LogLevel.info, String? label}) → void
Log a JSON object (Map, List, or any JSON-serializable object)
jsonDebug(Object? object, {String? label}) → void
Convenience method to log JSON at debug level
jsonError(Object? object, {String? label}) → void
Convenience method to log JSON at error level
jsonInfo(Object? object, {String? label}) → void
Convenience method to log JSON at info level
jsonWarn(Object? object, {String? label}) → void
Convenience method to log JSON at warn level
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Reset this logger's local settings to use global defaults
setEnableColors(bool enable) → void
Set whether to use ANSI colors in output for this logger
setEnableLogging(bool enable) → void
Set whether logging is enabled for this logger instance
setShowFunctionName(bool show) → void
Set whether to show function names in output for this logger
setShowLocation(bool show) → void
Set whether to show file location in output for this logger
table(Object? data, {List<String>? columns, LogLevel level = LogLevel.info, String? label}) → void
Log data in a table format (similar to console.table in JavaScript)
tableDebug(Object? data, {List<String>? columns, String? label}) → void
Convenience method to log table at debug level
tableError(Object? data, {List<String>? columns, String? label}) → void
Convenience method to log table at error level
tableInfo(Object? data, {List<String>? columns, String? label}) → void
Convenience method to log table at info level
tableWarn(Object? data, {List<String>? columns, String? label}) → void
Convenience method to log table at warn level
toString() String
A string representation of this object.
inherited
w(String message) → void
Short alias for warn()
warn(String message) → void
Log a warning message

Operators

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