- renamed cef -> browser
- added browser logger + custom logger option
This commit is contained in:
2024-10-28 16:35:16 +00:00
parent 588bb42d04
commit 9fe9bad840
19 changed files with 208 additions and 163 deletions
+21
View File
@@ -0,0 +1,21 @@
export class Helper {
protected debugLogs_: boolean = false
protected customLogger_:
| undefined
| ((method: string, eventName: string, ...args: unknown[]) => unknown) =
undefined
constructor() {}
protected log_(
method: string,
eventName: string,
...args: unknown[]
): void {
if (this.customLogger_) {
this.customLogger_(method, eventName, ...args)
} else if (this.debugLogs_) {
console.log('[RPC](' + method + ')', eventName + ':', ...args)
}
}
}