Skip to content

Commit

Permalink
fix(platform): 🩹 simplify logger code
Browse files Browse the repository at this point in the history
implement simpler logger b/c of upstream fix
  • Loading branch information
johannrichard committed Nov 26, 2022
1 parent adc0467 commit b361213
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions src/lib/dingzLogHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ export class DingzLogger {
...parameters: unknown[]
): void {
message = chalk.magentaBright(`[${this.dingzPrefix}] `) + message;

// FIXME: #142 Upstream "bug" (or feature) in Homerbidge's Logger class
// Only when Logger.debug() is called does the class check whether
// DEBUG is enabled or not.
// TODO: Wait for [homebridge/homebridge#2732](https://github.com/homebridge/homebridge/pull/2732)
if (logLevel === LogLevel.DEBUG) {
this.logger.debug(message, ...parameters);
} else {
this.logger.log(logLevel, message, ...parameters);
}
this.logger.log(logLevel, message, ...parameters);
}

public info(message: string, ...parameters: unknown[]): void {
Expand Down

0 comments on commit b361213

Please sign in to comment.