log static method

void log(
  1. String message, {
  2. int level = 0,
  3. String name = "LogUtil",
  4. DateTime? time,
  5. int? sequenceNumber,
  6. Zone? zone,
  7. Object? error,
  8. StackTrace? stackTrace,
})

Emit a log event.

This function was designed to map closely to the logging information collected by package:logging.

  • message is the log message
  • time (optional) is the timestamp
  • sequenceNumber (optional) is a monotonically increasing sequence number
  • level (optional) is the severity level (a value between 0 and 2000); see the package:logging Level class for an overview of the possible values
  • name (optional) is the name of the source of the log message
  • zone (optional) the zone where the log was emitted
  • error (optional) an error object associated with this log event
  • stackTrace (optional) a stack trace associated with this log event

Implementation

static void log(
  String message, {
  int level = 0,
  String name = "LogUtil",
  DateTime? time,
  int? sequenceNumber,
  Zone? zone,
  Object? error,
  StackTrace? stackTrace,
}) {
  if (LogUtil.enableLog) {
    dev.log(
      message,
      name: name,
      time: time,
      sequenceNumber: sequenceNumber,
      level: level,
      zone: zone,
      error: error,
      stackTrace: stackTrace,
    );
  }
}