Add logging framework with Logger, LoggerFactory, and appenders
- Introduced ILogger interface for logging methods - Implemented Logger class with various logging levels and message formatting - Created LoggerFactory for managing logger instances and appender configuration - Added LoggingLevel enum and mapping for logging level types - Developed ConsoleAppender and TechnikerMeAppender for different logging outputs - Implemented appender management with AppenderFactory and base Appender class - Established Threshold class for controlling logging levels
This commit is contained in:
19
src/logger/Threshold.ts
Normal file
19
src/logger/Threshold.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import Defaults from '../Defaults';
|
||||
import { Subject } from '../lang/observables';
|
||||
import { LoggingLevel } from './LoggingLevel';
|
||||
|
||||
export class Threshold {
|
||||
private _threshold: Subject<LoggingLevel>;
|
||||
|
||||
constructor(loggingLevel?: LoggingLevel) {
|
||||
this._threshold = new Subject(loggingLevel ?? Defaults.loggingLevel);
|
||||
}
|
||||
|
||||
set value(value: LoggingLevel) {
|
||||
this._threshold.value = value;
|
||||
}
|
||||
|
||||
get value(): LoggingLevel {
|
||||
return this._threshold.value;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user