Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
benzekrimaha committed Nov 8, 2024
1 parent 7bf334c commit f136537
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@ interface LogDictionary {
}

declare module 'werelogs' {

class EndLogger {
constructor(reqLogger: RequestLogger);
trace(msg: string, data?: LogDictionary): void;
debug(msg: string, data?: LogDictionary): void;
info(msg: string, data?: LogDictionary): void;
warn(msg: string, data?: LogDictionary): void;
error(msg: string, data?: LogDictionary): void;
fatal(msg: string, data?: LogDictionary): void;
}

export class RequestLogger {
constructor(
logger: any,
Expand All @@ -38,7 +49,7 @@ declare module 'werelogs' {
warn(msg: string, data?: LogDictionary): void;
error(msg: string, data?: LogDictionary): void;
fatal(msg: string, data?: LogDictionary): void;
end(msg: string, data?: LogDictionary): void;
end(msg?: string, data?: LogDictionary): void | EndLogger;
errorEnd(msg: string, data?:LogDictionary): void;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/RequestLogger.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ class RequestLogger {
* for the log entry. This is how to provide
* metadata for a specific log entry.
*
* @returns {undefined}
* @returns {EndLogger|undefined}
*/
end(msg, data) {
if (msg === undefined && data === undefined) {
Expand Down

0 comments on commit f136537

Please sign in to comment.