logFatal static method
Fatal/Critical error - text (orange/purple)
Use for fatal errors that require immediate attention
@parammsg: The message string to be logged
@paramisLog: If set to true, logs regardless of the static enable flag
@paramexecFinalFunc: If true, executes the custom final function exeFinalFunc
@paramerror: Associated error object to be logged alongside the message
@paramstackTrace: Stack trace information for debugging
@paramprintOnceIfContains: If provided, only prints once when message contains this keyword
@paramdebounceMs: Debounce time interval in milliseconds, logs within this interval will be discarded
@paramdebounceKey: Custom key for debounce identification (if not provided, uses msg|devLevel|name as fallback)
@paramtag: Tag for show and filtering; displayed in log output, and when isFilterByTags is true, only logs with tags matching tags are displayed
Implementation
static void logFatal(String msg,
{bool? isLog,
bool? execFinalFunc,
Object? error,
StackTrace? stackTrace,
String? printOnceIfContains,
int debounceMs = 0,
String? debounceKey,
String? tag}) {
// Performance optimization: Get file location and tag in a single stack trace call
final stackInfo = _getStackTraceInfo();
final String fileInfo = stackInfo.fileLocation;
final effectiveTag = tag ?? stackInfo.tag;
DevColorizedLog.logCustom(
msg,
devLevel: DevLevel.fatal,
enable: Dev.enable,
colorInt: execFinalFunc != null && execFinalFunc
? _exeColorMap[DevLevel.fatal]!
: _logColorMap[DevLevel.fatal]!,
isLog: isLog,
fileInfo: fileInfo,
name: DevLevel.fatal.alias, // Use enum alias for display name
execFinalFunc: execFinalFunc,
error: error,
stackTrace: stackTrace,
printOnceIfContains: printOnceIfContains,
debounceMs: debounceMs,
debounceKey: debounceKey,
tag: effectiveTag,
);
}