init static method

void init({
  1. bool isDebugModeEnabled = true,
  2. bool isProfileModeEnabled = false,
  3. bool isReleaseModeEnabled = false,
  4. bool useTimestamps = false,
  5. bool useSeparators = false,
  6. bool showSystemLogs = true,
})

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);
      }
    },
  );
}