-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlogger.ts
More file actions
30 lines (27 loc) · 755 Bytes
/
logger.ts
File metadata and controls
30 lines (27 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
export class PublicLogger {
private static logEvent(
logCallback:
| Console["log"]
| Console["warn"]
| Console["error"]
| Console["debug"]
| Console["info"],
message: any[]
): void {
if (
typeof process !== "undefined" &&
process?.env?.NODE_ENV !== "test"
) {
logCallback("Live_Preview_SDK:", ...message);
}
}
public static error(...data: any[]): void {
this.logEvent(console.error, data);
}
public static warn(...data: any[]): void {
this.logEvent(console.warn, data);
}
public static debug(...data: any[]): void {
this.logEvent(console.debug, data);
}
}