Skip to content
This repository has been archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
馃彿 Fix cosmas options types
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Vlas谩k committed Mar 2, 2020
1 parent 77a22e3 commit 65ce0dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,6 @@ export interface CosmasOptions {
pretty?: boolean;
sentry?: string | boolean;
sentryLevel?: pino.LevelWithSilent;
loggerName?: string;
skip?: (req: Request, res?: Response) => boolean;
}
4 changes: 2 additions & 2 deletions src/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,13 +190,13 @@ test('Child logger inherits parent name', () => {
const logger = loggerFactory('parent', { disableStackdriverFormat: true });
const childLogger = logger('child');

expect(childLogger.options[loggerNameKey]).toBe('parentchild');
expect(childLogger.options.loggerName).toBe('parentchild');
});

test('Child logger can create another child', () => {
const logger = loggerFactory('parent', { disableStackdriverFormat: true });
const childLogger = logger('child');
const kid = childLogger('grandkid');

expect(kid.options[loggerNameKey]).toBe('parentchildgrandkid');
expect(kid.options.loggerName).toBe('parentchildgrandkid');
});

0 comments on commit 65ce0dd

Please sign in to comment.