Skip to content

Commit

Permalink
Update statusLevels type
Browse files Browse the repository at this point in the history
Update statusLevels to accept Boolean or StatusLevel object
  • Loading branch information
franciscohanna92 authored Jul 14, 2020
1 parent 45ec9e7 commit a02930b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ export type RouteFilter = (req: Request, res: Response) => boolean;
export type ErrorRouteFilter = (req: Request, res: Response, err: Error) => boolean;
export type MessageTemplate = string | ((req: Request, res: Response) => string);

export interface StatusLevels {
error?: string;
success?: string;
warn?: string;
};

export interface BaseLoggerOptions {
baseMeta?: object;
bodyBlacklist?: string[];
Expand All @@ -48,12 +54,8 @@ export interface BaseLoggerOptions {
responseWhitelist?: string[];
headerBlacklist?: string[];
skip?: RouteFilter;
statusLevels?: {
error?: string;
success?: string;
warn?: string;
};
}
statusLevels?: Boolean | StatusLevels;
}

export interface LoggerOptionsWithTransports extends BaseLoggerOptions {
transports: Transport[];
Expand Down

0 comments on commit a02930b

Please sign in to comment.