mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-12 10:53:51 +00:00
refactor: add severe log level
This commit is contained in:
committed by
Carlos Valente
parent
715600a514
commit
d41cd78f2e
@@ -35,8 +35,8 @@ class Logger {
|
||||
* @param log
|
||||
*/
|
||||
private _push(log: Log) {
|
||||
if (!isProduction || log.level === LogLevel.Error) {
|
||||
if (log.level === LogLevel.Error) {
|
||||
if (!isProduction || log.level === LogLevel.Severe) {
|
||||
if (log.level === LogLevel.Severe) {
|
||||
consoleRed(`[${log.level}] \t ${log.origin} \t ${log.text}`);
|
||||
} else {
|
||||
// eslint-disable-next-line no-console
|
||||
@@ -98,6 +98,15 @@ class Logger {
|
||||
this.emit(LogLevel.Error, origin, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility to emit logging message of type SEVERE
|
||||
* @param origin
|
||||
* @param text
|
||||
*/
|
||||
crash(origin: string, text: string) {
|
||||
this.emit(LogLevel.Severe, origin, text);
|
||||
}
|
||||
|
||||
/**
|
||||
* Shutdown logger
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user