log static method

void log(
  1. String level,
  2. String message, {
  3. String? tag,
  4. dynamic ex,
  5. StackTrace? stacktrace,
  6. Map<String, String?>? attributes,
})

Logs a message with provided level and optional tag, ex and stacktrace

Implementation

static void log(
  String level,
  String message, {
  String? tag,
  dynamic ex,
  StackTrace? stacktrace,
  Map<String, String?>? attributes,
}) {
  if (_muteLevels.contains(level)) {
    return; // skip logging if muted.
  }
  final loggersForTree = _trees[level];
  for (final logger in loggersForTree ?? <LogTree>[]) {
    logger.log(
      level,
      message,
      tag: tag,
      ex: ex,
      stacktrace: stacktrace,
      attributes: attributes,
    );
  }
}