log function
log - a wrapper of dart:developer log
Enable/disable by Log.enable.
object
- item to be loggedforced
- override logEnable when logEnable = falsetimestamp
- overridelogTimestamp
whenlogTimestamp
= false
name
, level
, time
are passed to dev.log
Implementation
void log(
Object? object, {
bool forced = false,
bool timestamp = true,
bool localTime = true,
}) {
if (logEnable || forced) {
if (logTimestamp || timestamp) {
print("${DateTime.now().toIso8601String()} ${object.toString()}");
} else {
print(object.toString());
}
}
}