Constructors
constructor
- new Logger(module): Logger
Properties
module
module: string = 'log'
Static
commonContent
commonContent: {} = {}
Methods
debug
- debug(event): void
Parameters
event: Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
- debug(event, arg1?): void
Parameters
event: string
Optional
arg1: any
Returns void
engineError
- engineError(error, eventName?): void
Parameters
error: any
Optional
eventName: string
Returns void
error
- error(event): void
Parameters
event: Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
- error(event): void
Returns void
info
- info(event): void
Parameters
event: Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
- info(event, arg1?): void
Parameters
event: string
Optional
arg1: any
Returns void
reportNow
- reportNow(): Promise<void>
Returns Promise<void>
setLevel
- setLevel(level): void
Returns void
speedMarkEnd
- speedMarkEnd(event): void
Parameters
event: string | Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
speedMarkStart
- speedMarkStart(event): void
Parameters
event: string | Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
warn
- warn(event): void
Parameters
event: Partial<{
code?: number;
endTime?: number;
error?: Error;
event: string;
ext1?: any;
ext2?: any;
level?: string;
module?: string;
payload?: any;
startTime?: number;
value?: number;
[key: string]: any;
}>
Returns void
- warn(event, arg1?): void
Parameters
event: string
Optional
arg1: any
Returns void
Static
assignCommonCtx
- assignCommonCtx(commonCtx): void
Parameters
commonCtx: Record<PropertyKey, any>
Returns void
Static
setLevel
- setLevel(level): void
Returns void
日志模块,默认级别是 Warn
Example