-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.d.ts
39 lines (34 loc) · 1.06 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import Logger = require('bunyan')
import { Request, Response, RequestHandler } from 'express'
export = bunyanMiddleware
declare function bunyanMiddleware(params: bunyanMiddleware.ParamsWithLogger): RequestHandler
declare function bunyanMiddleware(params: bunyanMiddleware.Params, logger: Logger): RequestHandler
declare function bunyanMiddleware(logger: Logger): RequestHandler
declare namespace bunyanMiddleware {
export interface Params {
headerName?: string
propertyName?: string
additionalRequestFinishData?: { (req: Request, res: Response): object }
logName?: string
obscureHeaders?: string[]
excludeHeaders?: string[]
requestStart?: boolean
verbose?: boolean
level?: 'trace' | 'debug' | 'info' | 'warn' | 'error' | 'fatal'
filter?: { (req: Request, res: Response): boolean }
}
export interface ParamsWithLogger extends Params {
logger: Logger
}
}
declare global {
namespace Express {
export interface Request {
log: Logger
reqId: string
}
export interface Response {
log: Logger
}
}
}