refactor debug logging, add debug info for YT authorized tokens

This commit is contained in:
2025-07-04 15:58:00 +02:00
parent 6874804703
commit c57f9ec3ea
7 changed files with 262 additions and 300 deletions

View File

@@ -1,3 +1,4 @@
import { DEBUG_LOG } from '$env/static/private';
import { env } from '$env/dynamic/private';
import { isTruthy } from '$lib/truthyString';
const { DEV } = import.meta.env;
@@ -41,7 +42,7 @@ export class Logger {
public constructor(private name: string) {}
public static isDebugEnabled(): boolean {
return DEV || enableVerboseLog;
return !!DEBUG_LOG || DEV || enableVerboseLog;
}
public verbose(...params: any[]) {
if (!enableVerboseLog) {
@@ -50,7 +51,7 @@ export class Logger {
console.debug(new Date().toISOString(), `- ${this.name} -`, ...params);
}
public debug(...params: any[]) {
if (false && !Logger.isDebugEnabled()) {
if (!Logger.isDebugEnabled()) {
return;
}
console.debug(new Date().toISOString(), `- ${this.name} -`, ...params);