mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
Shutdown cb arg can be undefined + always return null
This commit is contained in:
parent
f8d46a9392
commit
fc1ccbeb41
@ -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;
|
||||
}
|
||||
|
||||
appendersToCheck.filter(a => a.shutdown).forEach(a => a.shutdown(complete));
|
||||
|
||||
4
types/log4js.d.ts
vendored
4
types/log4js.d.ts
vendored
@ -9,7 +9,7 @@ export interface Log4js {
|
||||
addLayout(name: string, config: (a: any) => (logEvent: LoggingEvent) => string): void;
|
||||
connectLogger(logger: Logger, 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;
|
||||
@ -23,7 +23,7 @@ export function connectLogger(logger: Logger, options: { format?: Format; level?
|
||||
|
||||
export const levels: Levels;
|
||||
|
||||
export function shutdown(cb?: (error: Error) => void): void | null;
|
||||
export function shutdown(cb?: (error: Error | undefined) => void): null;
|
||||
|
||||
export interface BaseLayout {
|
||||
type: 'basic';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user