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
messageto 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 settingalwaysPrint= true. Usecontextto 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
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Usecontextto interpolate values into the message, e.g. 'User {id}' with {'id': '123'}. -
dump(
dynamic message, String? tag, {bool alwaysPrint = false}) → void -
Dumps a
messagewith a tag. -
emergency(
dynamic message, {Map< String, dynamic> ? context, bool alwaysPrint = false}) → void -
Logs an emergency
messageto 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 settingalwaysPrint= true. Usecontextto 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
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Optionally provide astackTraceto include in the output. Usecontextto 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
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Usecontextto 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
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. SetprettyPrintto true for formatted JSON output with indentation. -
success(
dynamic message, {Map< String, dynamic> ? context, bool alwaysPrint = false}) → void -
Logs a success
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Usecontextto 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
messageto the console for granular debugging. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Usecontextto 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
messageto the console. It will only print if your app's environment is in debug mode. You can override this by settingalwaysPrint= true. Usecontextto interpolate values into the message, e.g. 'User {id}' with {'id': '123'}.