init static method
void
init({})
Initializes the Library
Optional parameters:
isDebugModeEnabled
-> defaults to: false
-> enables debug logs
isProfileModeEnabled
-> defaults to: false
-> enables profile logs
isReleaseModeEnabled
-> defaults to: false
-> enables release logs
useTimestamps
-> defaults to: false
-> enables timestamps in logs
useSeparators
-> defaults to: false
-> enables top dotted separator in console
showSystemLogs
-> defaults to: true
-> enables system logs
Implementation
static void init({
bool isDebugModeEnabled = true,
bool isProfileModeEnabled = false,
bool isReleaseModeEnabled = false,
bool useTimestamps = false,
bool useSeparators = false,
bool showSystemLogs = true,
}) {
_isDebugModeEnabled = isDebugModeEnabled;
_isProfileModeEnabled = isProfileModeEnabled;
_isReleaseModeEnabled = isReleaseModeEnabled;
_useTimestamps = useTimestamps;
_useSeparators = useSeparators;
_showSystemLogs = showSystemLogs;
Logger.root.level = Level.ALL;
Logger.root.onRecord.listen(
(data) {
if (_showSystemLogs) {
systemLog(data.message);
}
},
);
}