NyLogger class

Logger used for messages you want to print to the console.

Constructors

NyLogger()

Properties

hashCode int
The hash code for this object.
no setterinherited
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

Static Properties

onLog NyLogCallback?
Optional callback that receives all log entries. Set this to listen to log updates in real-time.
getter/setter pair
useColors bool
Whether to use colored output in the console. Defaults to true in debug mode.
getter/setter pair

Static Methods

alert(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs an alert message to the console. Alert is for conditions that require immediate attention. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
debug(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs a debug message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
dump(dynamic message, String? tag, {bool alwaysPrint = false}) → void
Dumps a message with a tag.
emergency(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs an emergency message to the console. Emergency is the highest severity level for system-wide critical failures. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
error(dynamic message, {Map<String, dynamic>? context, StackTrace? stackTrace, bool alwaysPrint = false}) → void
Logs an error message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Optionally provide a stackTrace to include in the output. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
info(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Log an info message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
json(dynamic message, {bool alwaysPrint = false, bool prettyPrint = false}) → void
Log json data message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Set prettyPrint to true for formatted JSON output with indentation.
success(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs a success message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
verbose(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs a verbose message to the console for granular debugging. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.
warning(dynamic message, {Map<String, dynamic>? context, bool alwaysPrint = false}) → void
Logs a warning message to the console. It will only print if your app's environment is in debug mode. You can override this by setting alwaysPrint = true. Use context to interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.