configure static method

void configure({
  1. Level? level,
  2. LogOutput? output,
  3. bool? colors,
  4. bool? printEmojis,
  5. int? lineLength,
  6. int? methodCount,
  7. int? timedMethodCount,
  8. int? errorMethodCount,
  9. DateTime nowProvider()?,
  10. Map<Level, AnsiColor>? levelColors,
  11. Map<Level, String>? levelEmojis,
})

Updates logger behavior without changing the static calling style.

Implementation

static void configure({
  Level? level,
  LogOutput? output,
  bool? colors,
  bool? printEmojis,
  int? lineLength,
  int? methodCount,
  int? timedMethodCount,
  int? errorMethodCount,
  DateTime Function()? nowProvider,
  Map<Level, AnsiColor>? levelColors,
  Map<Level, String>? levelEmojis,
}) {
  if (output != null) {
    _output = output;
  }
  if (colors != null) {
    _colors = colors;
  }
  if (printEmojis != null) {
    _printEmojis = printEmojis;
  }
  if (lineLength != null) {
    _lineLength = lineLength;
  }
  if (methodCount != null) {
    _methodCount = methodCount;
  }
  if (timedMethodCount != null) {
    _timedMethodCount = timedMethodCount;
  }
  if (errorMethodCount != null) {
    _errorMethodCount = errorMethodCount;
  }
  if (nowProvider != null) {
    _nowProvider = nowProvider;
  }
  if (levelColors != null) {
    _levelColors = Map<Level, AnsiColor>.from(levelColors);
  }
  if (levelEmojis != null) {
    _levelEmojis = Map<Level, String>.from(levelEmojis);
  }

  _rebuildLoggers();
  if (level != null) {
    setLevel(level);
  }
}