refactor: improve typing

This commit is contained in:
Carlos Valente
2024-06-15 22:33:48 +02:00
committed by Carlos Valente
parent 81a07099ae
commit b7daf2926a
12 changed files with 64 additions and 28 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import { consoleSubdued, consoleRed } from '../utils/console.js';
class Logger {
private queue: Log[];
private escalateErrorFn: (error: string) => void | null;
private escalateErrorFn: ((error: string) => void) | null;
private canLog = false;
constructor() {
@@ -20,7 +20,7 @@ class Logger {
/**
* Enabling setup logger after init
*/
init(escalateErrorFn: (error: string) => void) {
init(escalateErrorFn?: (error: string) => void) {
// flush logs from queue
this.queue.forEach((log) => {
this._push(log);