const getTimestamp = () => new Date().toISOString();

export const logger = {
    info: (message: string, ...args: unknown[]) => {
        console.log(`[INFO] [${getTimestamp()}] ${message}`, ...args);
    },
    warn: (message: string, ...args: unknown[]) => {
        console.warn(`[WARN] [${getTimestamp()}] ${message}`, ...args);
    },
    error: (message: string, error?: unknown) => {
        console.error(`[ERROR] [${getTimestamp()}] ${message}`, error);
        if (error instanceof Error) {
            console.error(error.stack);
        }
    },
    debug: (message: string, ...args: unknown[]) => {
        if (process.env.NODE_ENV === 'development') {
            console.debug(`[DEBUG] [${getTimestamp()}] ${message}`, ...args);
        }
    }
};
