output method

  1. @override
Future<void> output(
  1. LogDocument document,
  2. LogEntry entry,
  3. LogLevel level,
  4. LogPipelineFactory factory,
)
override

Outputs the data to the destination.

The entry is the original log entry that produced this data.

The level indicates the severity of the log entry that produced this data, which can be used by the sink for destination-specific logic (e.g., using different output streams for errors).

Implementation

@override
Future<void> output(
  final LogDocument document,
  final LogEntry entry,
  final LogLevel level,
  final LogPipelineFactory factory,
) async {
  logs.add(
    CapturedLog(
      level: level,
      message: entry.message,
      loggerName: entry.loggerName,
      origin: entry.origin,
      error: entry.error,
      stackTrace: entry.stackTrace,
      context: entry.context != null
          ? Map<String, dynamic>.from(entry.context!)
          : null,
    ),
  );
}