logWarning method

void logWarning({
  1. StackTrace? stackTrace,
  2. required String file,
  3. required String event,
  4. required String warning,
})

Logs a warning with a stackTrace in a specific file during a specific event.

Implementation

void logWarning({
  StackTrace? stackTrace,
  required String file,
  required String event,
  required String warning,
}) {
  if (kReleaseMode) {
    return;
  }
  stackTrace ??= StackTrace.current;
  log(
    "Warning occurred in file $file during event: $event",
    level: 900,
    error: warning,
    stackTrace: stackTrace,
  );
}