learn-request-queue/src/logging.ts

15 lines
278 B
TypeScript

import * as config from "./config";
export enum LogLevel {
SILENT,
ERROR,
WARNING,
INFO,
DEBUG
}
export async function log(logLevel: LogLevel, logMessage: any) {
if (config.logLevel >= logLevel)
console.log(LogLevel[logLevel].padStart(7) + ' | ' + logMessage)
}