forked from tellnes/bunyan-middleware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
33 lines (29 loc) · 896 Bytes
/
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
import Logger = require('bunyan')
import { Request, Response, RequestHandler } from 'express'
export = middleware
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 }
}
interface ParamsWithLogger extends Params {
logger: Logger
}
declare function middleware(params: ParamsWithLogger): RequestHandler
declare function middleware(params: Params, logger: Logger): RequestHandler
declare function middleware(logger: Logger): RequestHandler
declare module 'express' {
export interface Request {
log: Logger
}
export interface Response {
log: Logger
}
}