Logger.init constructor

Logger.init({
  1. int methodCount = 2,
  2. int bufferSize = 20,
  3. int lineLength = 120,
  4. bool printTime = true,
  5. bool colors = false,
  6. bool printEmojis = true,
  7. Map<Level, bool> excludeBox = const {},
  8. bool noBoxingByDefault = false,
  9. bool enabled = true,
})

Implementation

factory Logger.init({
  int methodCount = 2,
  int bufferSize = 20,
  int lineLength = 120,
  bool printTime = true,
  bool colors = false,
  bool printEmojis = true,
  Map<logger_dependency.Level, bool> excludeBox = const {},
  bool noBoxingByDefault = false,
  bool enabled = true,
}) {
  assert(!_initialized, 'Logger has been already initialized!');

  _initialized = true;
  consoleOutput.bufferSize = bufferSize;

  return Logger._(
    logger_dependency.Logger(
      output: consoleOutput,
      printer: logger_dependency.PrettyPrinter(
        methodCount: methodCount,
        printTime: printTime,
        colors: colors,
        printEmojis: printEmojis,
        lineLength: lineLength,
        excludeBox: excludeBox,
        noBoxingByDefault: noBoxingByDefault,
      ),
    ),
    enabled: enabled,
  );
}