mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2026-09-09 18:03:21 +00:00
error message if log level is set with wrong name (#5805)
This commit is contained in:
@@ -65,10 +65,19 @@ export class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static getLogLevelByName(name: string): number {
|
private static getLogLevelByName(name: string): number {
|
||||||
const log = logLevels.find((currentLog) => {
|
if (name) {
|
||||||
return currentLog.name === name;
|
const log = logLevels.find((currentLog) => {
|
||||||
});
|
return currentLog.name === name;
|
||||||
|
});
|
||||||
|
|
||||||
return log.level || 1;
|
if (log && log.level) {
|
||||||
|
return log.level;
|
||||||
|
} else {
|
||||||
|
console.error(errorColor, 'Log level not correctly set, use one of the following values TRACE|DEBUG|INFO|WARN|ERROR|SILENT');
|
||||||
|
return LogLevelsEnum.ERROR;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return LogLevelsEnum.ERROR;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user