- Added new dependency "@techniker-me/tools" and updated existing dependencies to specific versions in bun.lock - Removed the DependencyManager test file as part of codebase cleanup
32 lines
900 B
TypeScript
32 lines
900 B
TypeScript
export class Logger {
|
|
private _category: string;
|
|
|
|
constructor(category: string) {
|
|
this._category = category;
|
|
}
|
|
|
|
public info(message: string, ...optionalParams: any[]) {
|
|
console.info(this.formatMessage(message), ...optionalParams);
|
|
}
|
|
|
|
public debug(message: string, ...optionalParams: any[]) {
|
|
console.debug(this.formatMessage(message), ...optionalParams);
|
|
}
|
|
|
|
public error(message: string, ...optionalParams: any[]) {
|
|
console.error(this.formatMessage(message), ...optionalParams);
|
|
}
|
|
|
|
public warn(message: string, ...optionalParams: any[]) {
|
|
console.warn(this.formatMessage(message), ...optionalParams);
|
|
}
|
|
|
|
public trace(message: string, ...optionalParams: any[]) {
|
|
console.trace(this.formatMessage(message), ...optionalParams);
|
|
}
|
|
|
|
private formatMessage(message: string) {
|
|
return `${new Date().toISOString()} [${this._category}] ${message}`;
|
|
}
|
|
}
|