Skip to content

Commit

Permalink
refactor: make class members explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Skn0tt committed Jan 18, 2024
1 parent 139158e commit 1ac7353
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/system_logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,13 @@ export enum LogLevel {
}

class SystemLogger {
// eslint-disable-next-line no-useless-constructor
constructor(private readonly fields: Record<string, unknown> = {}, private readonly logLevel = LogLevel.Log) {}
private readonly fields: Record<string, unknown>
private readonly logLevel: LogLevel

constructor(fields: Record<string, unknown> = {}, logLevel = LogLevel.Log) {
this.fields = fields
this.logLevel = logLevel
}

private doLog(logger: typeof console.log, message: string) {
logger(systemLogTag, JSON.stringify({ msg: message, fields: this.fields }))
Expand Down

0 comments on commit 1ac7353

Please sign in to comment.