consoleLog<T> function
Logs a object to the console if the app is running in debug mode.
The message
parameter is a object or the message to be logged.
The time
parameter is an optional timestamp for the log message.
The sequenceNumber
parameter is an optional sequence number for the log message.
The level
parameter is an optional level for the log message.
The name
parameter is an optional name for the log message.
The zone
parameter is an optional zone for the log message.
The error
parameter is an optional error object associated with the log message.
The stackTrace
parameter is an optional stack trace associated with the log message.
Implementation
T consoleLog<T>(
T message, {
DateTime? time,
int? sequenceNumber,
int level = 0,
String name = '',
Zone? zone,
Object? error,
StackTrace? stackTrace,
}) {
if (kDebugMode) {
if (T == Exception && error == null) error = message;
log(changeTo(message), time: time ?? now, sequenceNumber: sequenceNumber, level: level, name: name, zone: zone, error: error);
}
return message;
}