mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Merge pull request #1082 from richardhinkamp/shutdown-type-consistent
Shutdown cb arg can be undefined + always return null
This commit is contained in:
commit
6a60294611
@ -111,7 +111,10 @@ function shutdown(cb) {
|
||||
);
|
||||
if (shutdownFunctions === 0) {
|
||||
debug('No appenders with shutdown functions found.');
|
||||
return cb !== undefined && cb();
|
||||
if (cb) {
|
||||
cb(undefined);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
let completed = 0;
|
||||
|
||||
4
types/log4js.d.ts
vendored
4
types/log4js.d.ts
vendored
@ -17,7 +17,7 @@ export interface Log4js {
|
||||
options: { format?: Format; level?: string; nolog?: any }
|
||||
): any; // express.Handler;
|
||||
levels: Levels;
|
||||
shutdown(cb: (error: Error) => void): void | null;
|
||||
shutdown(cb?: (error: Error | undefined) => void): null;
|
||||
}
|
||||
|
||||
export function getLogger(category?: string): Logger;
|
||||
@ -45,7 +45,7 @@ export function recording(): Recording;
|
||||
|
||||
export const levels: Levels;
|
||||
|
||||
export function shutdown(cb?: (error: Error) => void): void | null;
|
||||
export function shutdown(cb?: (error: Error | undefined) => void): null;
|
||||
|
||||
export interface BasicLayout {
|
||||
type: 'basic';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user