mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-09 03:30:09 +00:00
[express-bunyan-logger] Update Options.
The options are passed through to bunyan.createLogger so all those options need to be valid. A `Partial` is used because the only required option by `createLogger` is `name` but the middleware provides a default.
This commit is contained in:
@@ -22,3 +22,12 @@ const logger = Bunyan.createLogger({
|
||||
const middleware5 = expressBunyan({
|
||||
logger
|
||||
});
|
||||
|
||||
expressBunyan({
|
||||
format: () => "some format",
|
||||
genReqId: req => req.header("foo") || "other",
|
||||
name: "foo_app",
|
||||
parseUA: false,
|
||||
serializers: Bunyan.stdSerializers,
|
||||
streams: [{ level: 'info', stream: process.stdout }]
|
||||
});
|
||||
|
||||
4
types/express-bunyan-logger/index.d.ts
vendored
4
types/express-bunyan-logger/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for express-bunyan-logger 1.3
|
||||
// Project: https://github.com/villadora/express-bunyan-logger
|
||||
// Definitions by: Shrey Jain <https://github.com/shreyjain1994>
|
||||
// Matt R. Wilson <https://github.com/mastermatt>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
@@ -17,7 +18,7 @@ declare namespace Factory {
|
||||
type RequestIdGenFunction = (req: express.Request) => string;
|
||||
type LevelFunction = (status: number, err: Error | null, meta: any) => string;
|
||||
|
||||
interface Options {
|
||||
interface Options extends Partial<Bunyan.LoggerOptions> {
|
||||
logger?: Bunyan;
|
||||
format?: string | FormatFunction;
|
||||
parseUA?: boolean;
|
||||
@@ -26,7 +27,6 @@ declare namespace Factory {
|
||||
excludes?: string[];
|
||||
obfuscate?: string[];
|
||||
obfuscatePlaceholder?: string;
|
||||
serializers?: { [field: string]: Bunyan.Serializer };
|
||||
immediate?: boolean;
|
||||
genReqId?: RequestIdGenFunction;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user