Refactor logging level handling and remove example usage
* Updated `CommandLineOptions` and `ConfigurationObject` to use `LoggingLevel` type instead of string for log levels. * Modified `LoggerFactory` to set logging levels using the new `LoggingLevelMapping` methods. * Removed the `example-usage.ts` file as it was no longer needed. * Adjusted `Threshold` class to simplify logging level management.
This commit is contained in:
@@ -37,21 +37,21 @@ export class LoggingLevelMapping {
|
||||
|
||||
public static convertLoggingLevelTypeToLoggingLevel(level: LoggingLevelType): LoggingLevel {
|
||||
switch (level) {
|
||||
case 'Off':
|
||||
case 'off':
|
||||
return LoggingLevel.Off;
|
||||
case 'Fatal':
|
||||
case 'fatal':
|
||||
return LoggingLevel.Fatal;
|
||||
case 'Error':
|
||||
case 'error':
|
||||
return LoggingLevel.Error;
|
||||
case 'Warning':
|
||||
case 'warning':
|
||||
return LoggingLevel.Warning;
|
||||
case 'Info':
|
||||
case 'info':
|
||||
return LoggingLevel.Info;
|
||||
case 'Debug':
|
||||
case 'debug':
|
||||
return LoggingLevel.Debug;
|
||||
case 'Trace':
|
||||
case 'trace':
|
||||
return LoggingLevel.Trace;
|
||||
case 'All':
|
||||
case 'all':
|
||||
return LoggingLevel.All;
|
||||
default:
|
||||
throw new Error(`[LoggingLevelMapping] Received unknown logging level type [${level}]`);
|
||||
|
||||
Reference in New Issue
Block a user