[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/thaolaptrinh/commandcode-api-proxy/main/src/logger.ts [Back]  [Original]

export type LogLevel = "debug" | "info" | "warn" | "error";

const LOG_LEVELS: Record = {
  debug: 0,
  info: 1,
  warn: 2,
  error: 3,
};

let currentLogLevel = 1; // default to info

export function initLogger(level: string): void {
  const normalized = level.toLowerCase() as LogLevel;
  if (normalized in LOG_LEVELS) {
    currentLogLevel = LOG_LEVELS[normalized];
  }
}

export const logger = {
  debug(msg: string, ...args: unknown[]) {
    if (currentLogLevel 

Web Proxy Viewer  |  New URL  |  Original Page