Skip to content

Commit

Permalink
chore: code cleanup for pr
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Jun 29, 2023
1 parent b64cc72 commit e37e172
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/logger/memoryLogger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { Writable } from 'stream';
import { unwrapArray } from '../util/unwrapArray';
import { filterSecrets } from './filters';

/**
* Used by test setup to keep UT from writing to disk.
*/
export class MemoryLogger extends Writable {
public loggedData: Array<Record<string, unknown>> = [];

Expand Down
3 changes: 1 addition & 2 deletions src/logger/transformStream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import { filterSecrets } from './filters';
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
const build = require('pino-abstract-transport');

// eslint-disable-next-line @typescript-eslint/explicit-function-return-type, @typescript-eslint/require-await, @typescript-eslint/no-unused-vars
export default async function (options: Record<string, unknown>) {
export default function (): Transform {
// eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call
return build(
// eslint-disable-next-line @typescript-eslint/no-explicit-any
Expand Down

3 comments on commit e37e172

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Logger Benchmarks - ubuntu-latest'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 2.

Benchmark suite Current: e37e172 Previous: 4b0746b Ratio
Logging a nested 3-level object on root logger 2207 ops/sec (±223.66%) 176570 ops/sec (±39.69%) 80.00

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - ubuntu-latest

Benchmark suite Current: e37e172 Previous: 4b0746b Ratio
Child logger creation 339101 ops/sec (±0.82%) 349949 ops/sec (±2.84%) 1.03
Logging a string on root logger 490684 ops/sec (±10.74%) 523969 ops/sec (±11.83%) 1.07
Logging an object on root logger 415058 ops/sec (±15.58%) 429211 ops/sec (±17.98%) 1.03
Logging an object with a message on root logger 229418 ops/sec (±15.80%) 236628 ops/sec (±15.23%) 1.03
Logging an object with a redacted prop on root logger 291950 ops/sec (±18.73%) 10326 ops/sec (±190.01%) 0.03536907004624079
Logging a nested 3-level object on root logger 2207 ops/sec (±223.66%) 176570 ops/sec (±39.69%) 80.00

This comment was automatically generated by workflow using github-action-benchmark.

@svc-cli-bot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logger Benchmarks - windows-latest

Benchmark suite Current: e37e172 Previous: 4b0746b Ratio
Child logger creation 251827 ops/sec (±0.94%) 313610 ops/sec (±1.70%) 1.25
Logging a string on root logger 448254 ops/sec (±16.80%) 542286 ops/sec (±11.74%) 1.21
Logging an object on root logger 330859 ops/sec (±14.53%) 474700 ops/sec (±13.40%) 1.43
Logging an object with a message on root logger 164404 ops/sec (±23.82%) 279133 ops/sec (±18.03%) 1.70
Logging an object with a redacted prop on root logger 205359 ops/sec (±20.85%) 8448 ops/sec (±200.58%) 0.04113771492849108
Logging a nested 3-level object on root logger 122913 ops/sec (±24.97%) 227494 ops/sec (±13.65%) 1.85

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.