Step 1: Basic container with manual registration

This commit is contained in:
2025-10-24 00:57:40 -04:00
parent c3736be4f7
commit 3cd06003d5
5 changed files with 157 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
export class Logger {
private _category: string;
constructor(category: string) {
this._category = category;
}
public info(message: string, ...optionalArgs: unknown[]): void {
const formattedMessage = this.formatMessage('INFO', message);
console.log(formattedMessage, ...optionalArgs);
}
public error(message: string, ...optionalArgs: unknown[]): void {
const formattedMessage = this.formatMessage('ERROR', message);
console.error(formattedMessage, ...optionalArgs);
}
private formatMessage(level: string, message: string): string {
return `${new Date().toISOString()} [${this._category}] [${level}] ${message}`;
}
}