Compare commits

..

2 Commits

Author SHA1 Message Date
e99a5ab7f4
v2.4.1 2023-07-13 19:34:08 +03:00
1cda2738e3
Typing fixes 2023-07-13 19:33:56 +03:00
2 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "@navy.gif/logger", "name": "@navy.gif/logger",
"version": "2.4.0", "version": "2.4.1",
"description": "Logging thing", "description": "Logging thing",
"author": "Navy.gif", "author": "Navy.gif",
"license": "MIT", "license": "MIT",

View File

@ -49,7 +49,7 @@ class LoggerClient implements Logger
for (const type of this.#types) for (const type of this.#types)
{ {
Object.defineProperty(this, type, { Object.defineProperty(this, type, {
value: (msg: string, o: WriteOptions) => this.transport(msg, { ...o, type }) value: (msg: string, o: WriteOptions) => this.#transport(msg, { ...o, type })
}); });
} }
@ -79,7 +79,7 @@ class LoggerClient implements Logger
throw new Error(`Invalid log level type, expected string or number, got ${typeof level}`); throw new Error(`Invalid log level type, expected string or number, got ${typeof level}`);
} }
transport (message: string | Error, opts: TransportOptions) #transport (message: string | object | Error, opts: TransportOptions)
{ {
if (this.#_logLevelMapping[opts.type] < this.#_logLevel) if (this.#_logLevelMapping[opts.type] < this.#_logLevel)
@ -102,27 +102,27 @@ class LoggerClient implements Logger
// These methods are dynamically implemented by the constructor, simply here to provide IDE hints // These methods are dynamically implemented by the constructor, simply here to provide IDE hints
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
error (_str: string | Error, _opts?: WriteOptions): void error (_str: string | object | Error, _opts?: WriteOptions): void
{ {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
warn (_str: string | Error, _opts?: WriteOptions): void warn (_str: string | object | Error, _opts?: WriteOptions): void
{ {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
status (_str: string | Error, _opts?: WriteOptions): void status (_str: string | object | Error, _opts?: WriteOptions): void
{ {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
info (_str: string | Error, _opts?: WriteOptions): void info (_str: string | object | Error, _opts?: WriteOptions): void
{ {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
debug (_str: string | Error, _opts?: WriteOptions): void debug (_str: string | object | Error, _opts?: WriteOptions): void
{ {
throw new Error('Method not implemented.'); throw new Error('Method not implemented.');
} }