(feat): Allow transports to be attached after initial instance creation.

This commit is contained in:
Nix "UwU" Krystik
2026-03-11 23:59:12 +08:00
parent 390376aeef
commit f3090c9065
2 changed files with 7 additions and 3 deletions

View File

@@ -1,8 +1,8 @@
{
"name": "@nixkrystik/logger",
"description": "Simple, scalable logging package.",
"version": "1.0.0",
"version": "1.0.1",
"author": {
"name": "Nix Krystik",
"url": "https://teamhydra.dev/"

View File

@@ -8,6 +8,10 @@ export class Logger {
this.transports = transports;
}
attach(transport: Transport) {
this.transports.push(transport);
}
async log(level: LogLevel, module: string, content: string): Promise<void> {
const tasks: Promise<void>[] = [];
@@ -21,7 +25,7 @@ export class Logger {
}
debug(module: string, content: string) {
return this.log(LogLevel.Debug, module, content);
this.log(LogLevel.Debug, module, content);
}
info(module: string, content: string) {