Skip to content

Commit

Permalink
Move logger.ts anys to unknowns
Browse files Browse the repository at this point in the history
This is more reflective of what we're working with, and will ensure we
don't start accessing properties willy nilly.
  • Loading branch information
Shadowfiend committed Oct 13, 2021
1 parent 38a5ace commit 1da3e45
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions background/lib/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ enum LogLevel {
error = "error",
}

function genericLogger(level: LogLevel, input: any[]) {
function genericLogger(level: LogLevel, input: unknown[]) {
console[level](...input)

const stackTrace = new Error().stack.split("\n").filter((line) => {
Expand All @@ -29,19 +29,19 @@ function genericLogger(level: LogLevel, input: any[]) {
}

const logger = {
log(...input: any[]) {
log(...input: unknown[]): void {
genericLogger(LogLevel.log, input)
},

info(...input: any[]) {
info(...input: unknown[]): void {
genericLogger(LogLevel.info, input)
},

warn(...input: any[]) {
warn(...input: unknown[]): void {
genericLogger(LogLevel.warn, input)
},

error(...input: any[]) {
error(...input: unknown[]): void {
genericLogger(LogLevel.error, input)
},
}
Expand Down

0 comments on commit 1da3e45

Please sign in to comment.