ConsoleLogStrategy constructor

ConsoleLogStrategy({
  1. LogLevel logLevel = LogLevel.none,
  2. List<LogEvent>? supportedEvents,
  3. bool useIsolate = false,
  4. bool useModernFormatting = true,
  5. bool useColors = true,
  6. bool autoDetectColors = true,
  7. bool showTimestamp = true,
  8. bool showContext = true,
})

Constructs a ConsoleLogStrategy.

logLevel sets the log level at which this strategy becomes active. supportedEvents optionally specifies which types of LogEvent this strategy should handle. useIsolate whether to use isolates for log formatting. Defaults to FALSE because console formatting is lightweight. Set to true for heavy formatting loads. useModernFormatting enables modern console formatting with colors and emojis. useColors enables colored output. When autoDetectColors is true (default), this is combined with terminal capability detection. autoDetectColors when true (default), automatically detects if the terminal supports ANSI colors. iOS/Android consoles don't support ANSI, so colors are disabled automatically to avoid garbage output like \^[[36m. showTimestamp shows timestamp in logs. showContext shows context information in logs.

Implementation

ConsoleLogStrategy({
  super.logLevel = LogLevel.none,
  super.supportedEvents,
  bool useIsolate = false, // Console: default FALSE (lightweight operation)
  bool useModernFormatting = true,
  bool useColors = true,
  bool autoDetectColors = true,
  bool showTimestamp = true,
  bool showContext = true,
}) : _useModernFormatting = useModernFormatting,
     _useColors = autoDetectColors
         ? (useColors && TerminalCapabilities.supportsAnsiColors)
         : useColors,
     _showTimestamp = showTimestamp,
     _showContext = showContext,
     super(useIsolate: useIsolate);