fix tracker: fix logger ref

This commit is contained in:
nick-delirium 2024-07-16 18:03:18 +02:00
parent 0150821878
commit 80c9dd2bb9
No known key found for this signature in database
GPG key ID: 93ABD695DF5FDBA0
3 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,8 @@
# 14.0.0
# 14.0.2
- fix logger check
# 14.0.0 & .1
- titles for tabs
- new `MouseClick` message to introduce heatmaps instead of clickmaps

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker",
"description": "The OpenReplay tracker main package",
"version": "14.0.1",
"version": "14.0.2",
"keywords": [
"logging",
"replay"

View file

@ -15,25 +15,25 @@ export default class Logger {
this.level = debugLevel
}
private shouldLog(level: ILogLevel): boolean {
private readonly shouldLog = (level: ILogLevel): boolean => {
return this.level >= level
}
log(...args: any[]) {
log = (...args: any[]) => {
if (this.shouldLog(LogLevel.Log)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
console.log(...args)
}
}
warn(...args: any[]) {
warn = (...args: any[]) => {
if (this.shouldLog(LogLevel.Warnings)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
console.warn(...args)
}
}
error(...args: any[]) {
error = (...args: any[]) => {
if (this.shouldLog(LogLevel.Errors)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
console.error(...args)