builtInLogger static method

RedstoneLogger builtInLogger({
  1. bool replace = false,
})

Get built-in logger.

Replace built-in logger for replace param

Implementation

static RedstoneLogger builtInLogger({bool replace = false}) {
  if (_builtinLogger == null) {
    _builtInLoggerInitialState = true;
    _builtinLogger = _defLogger(name: _fixedRedstoneXLoggerName, isBuiltinLog: true);
  } else if (_builtInLoggerInitialState && replace) {
    _builtinLogger = _defLogger(name: _fixedRedstoneXLoggerName, isBuiltinLog: true);
    _replaceCount++;
    _builtinLogger?.w('''Replace built-in logger at ${DateTime.now()},
        has replaced time is $_replaceCount,
        built-in logger named $_fixedRedstoneXLoggerName.''');
  }

  return _builtinLogger!;
}