fatal()
Writes a log message with severity ‘fatal’ (5).
fatal(message: unknown, ...data: unknown[]): void;
Notes
- The specified message may be a string, a DeferredString (the result of fmt()), an Error instance, or any other value that can be converted to a string.
- For DeferredString and AppException messages, placeholder values are included in the message data so that they can be stored separately in a structured log.
Examples
// Write a formatted log message
app.log.fatal(fmt("User not found: {name}", userData));
// Catch an error and log it
try {
doSomethingDangerous();
} catch (err) {
app.log.fatal(err);
}
Related
class LogWriter
A class that handles log messages, part of the global application context.
