mirror of
https://github.com/log4js-node/log4js-node.git
synced 2025-12-08 19:26:01 +00:00
add typescript definition
This commit is contained in:
parent
2468376539
commit
5c0f9c9eec
45
index.d.ts
vendored
Normal file
45
index.d.ts
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/**
|
||||
* log4js typescript definition for version 2.3.4
|
||||
* @name log4js-node
|
||||
* @author xialeistudio<xialeistudio@gmail.com>
|
||||
* @date 2017/9/26
|
||||
* @version 0.0.1
|
||||
*/
|
||||
export declare function getLogger(category?: string): Logger;
|
||||
|
||||
export declare function configure(configuration: Configuration): void;
|
||||
|
||||
export declare interface Configuration {
|
||||
appenders: { [index: string]: any };
|
||||
categories: { [index: string]: { appenders: string[], level: string } };
|
||||
}
|
||||
|
||||
export declare interface Logger {
|
||||
new(dispatch: Function, name: string): Logger;
|
||||
|
||||
level: string;
|
||||
|
||||
log(...args: any[]): void;
|
||||
|
||||
isLevelEnabled(level: string): boolean;
|
||||
|
||||
_log(level: string, data: any): void;
|
||||
|
||||
addContext(key: string, value: any): void;
|
||||
|
||||
removeContext(key: string): void;
|
||||
|
||||
clearContext(): void;
|
||||
|
||||
trace(...args: any[]): void;
|
||||
|
||||
debug(...args: any[]): void;
|
||||
|
||||
info(...args: any[]): void;
|
||||
|
||||
warn(...args: any[]): void;
|
||||
|
||||
error(...args: any[]): void;
|
||||
|
||||
fatal(...args: any[]): void;
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user