From d3a051a928e412ef7abe26b61015b115d96f3435 Mon Sep 17 00:00:00 2001 From: mshanemc Date: Tue, 27 Jun 2023 18:50:45 -0500 Subject: [PATCH] test: logger specific tests --- test/perf/logger/main.test.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/perf/logger/main.test.ts b/test/perf/logger/main.test.ts index e11ba0a4fe..e39e0aac4e 100644 --- a/test/perf/logger/main.test.ts +++ b/test/perf/logger/main.test.ts @@ -5,17 +5,32 @@ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause */ import { Suite } from 'benchmark'; +import { Logger } from '../../../src/exported'; const suite = new Suite(); +const logger = new Logger('Benchmarks'); + // add tests suite - .add('RegExp#test', () => { + .add('Child logger creation', () => { // eslint-disable-next-line @typescript-eslint/prefer-includes - /o/.test('Hello World!'); + Logger.childFromRoot('benchmarkChild'); + }) + .add('Logging a string on root logger', () => { + logger.debug('this is a string'); + }) + .add('Logging an object on root logger', () => { + logger.debug({ foo: 1, bar: 2, baz: 3 }); + }) + .add('Logging an object with a message on root logger', () => { + logger.debug({ foo: 1, bar: 2, baz: 3 }, 'this is a message'); + }) + .add('Logging an object with a redacted prop on root logger', () => { + logger.debug({ foo: 1, bar: 2, accessToken: '00D' }); }) - .add('String#indexOf', () => { - 'Hello World!'.includes('o'); + .add('Logging a nested 3-level object on root logger', () => { + logger.debug({ foo: 1, bar: 2, baz: { foo: 1, bar: 2, baz: { foo: 1, bar: 2, baz: 3 } } }); }) // add listeners .on('cycle', (event: any) => {