writeLogEntry function

void writeLogEntry(
  1. LogEntry entry,
  2. WriteLineFunction writeln, {
  3. bool printTimestamp = false,
  4. bool printLoggerName = false,
})

Writes a standard string representation entry using writeln.

Implementation

void writeLogEntry(LogEntry entry, WriteLineFunction writeln,
    {bool printTimestamp = false, bool printLoggerName = false}) {
  writeln(entry.toStringOptions(
      includeTimestamp: printTimestamp, includeLoggerName: printLoggerName));

  if (entry.errorDetails != null) {
    writeln('Error or Exception details:\n${entry.errorDetails}');
  }

  if (entry.stackTrace != null) {
    writeln('Stack trace:\n${entry.stackTrace}');
  }
}