logLogEntry method Null safety

  1. @override
void logLogEntry(
  1. String level,
  2. DateTime? time,
  3. String message,
  4. Object exception,
  5. StackTrace stackTrace
)
override

Log that a log entry that was written to the analysis engine's log. The log entry has the given level and message, and was created at the given time.

Implementation

@override
void logLogEntry(String level, DateTime? time, String message,
    Object exception, StackTrace stackTrace) {
  String timeStamp =
      time == null ? 'null' : time.millisecondsSinceEpoch.toString();
  String exceptionText = exception.toString();
  String stackTraceText = stackTrace.toString();
  _instrumentationLogger.log(_join([
    TAG_LOG_ENTRY,
    level,
    timeStamp,
    message,
    exceptionText,
    stackTraceText
  ]));
}