mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
fix(types): Added return type for configure(...).
This commit is contained in:
parent
5d276a4863
commit
fe07ab2e75
13
types/log4js.d.ts
vendored
13
types/log4js.d.ts
vendored
@ -1,9 +1,18 @@
|
||||
// Type definitions for log4js
|
||||
|
||||
export interface Log4js {
|
||||
getLogger,
|
||||
configure,
|
||||
addLayout,
|
||||
connectLogger,
|
||||
levels,
|
||||
shutdown
|
||||
}
|
||||
|
||||
export function getLogger(category?: string): Logger;
|
||||
|
||||
export function configure(filename: string): void;
|
||||
export function configure(config: Configuration): void;
|
||||
export function configure(filename: string): Log4js;
|
||||
export function configure(config: Configuration): Log4js;
|
||||
|
||||
export function addLayout(name: string, config: (a: any) => (logEvent: LoggingEvent) => string): void;
|
||||
|
||||
|
||||
@ -108,3 +108,8 @@ configure({
|
||||
appenders: { cheese: { type: 'file', filename: 'cheese.log' } },
|
||||
categories: { default: { appenders: ['cheese'], level: 'error' } }
|
||||
});
|
||||
|
||||
log4js.configure('./filename').getLogger();
|
||||
const logger7 = log4js.getLogger();
|
||||
logger7.level = 'debug';
|
||||
logger7.debug("Some debug messages");
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user