Compare commits

...

3 Commits

Author SHA1 Message Date
Nix "UwU" Krystik
2a7205daf2 (misc): Updated package description to match the git repository. 2026-03-12 00:06:27 +08:00
Nix "UwU" Krystik
67bb075714 (misc): Bump version for next release. (I'm prone to forgetting. :kek:) 2026-03-12 00:00:18 +08:00
Nix "UwU" Krystik
f3090c9065 (feat): Allow transports to be attached after initial instance creation. 2026-03-11 23:59:12 +08:00
2 changed files with 8 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
{ {
"name": "@nixkrystik/logger", "name": "@nixkrystik/logger",
"description": "Simple, scalable logging package.", "description": "A heavily stripped down logging library for JavaScript & TypeScript.",
"version": "1.0.0", "version": "1.0.2",
"author": { "author": {
"name": "Nix Krystik", "name": "Nix Krystik",

View File

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