logger/index.ts

20 lines
674 B
TypeScript
Raw Normal View History

2023-04-12 19:13:14 +02:00
import MasterLogger from "./src/MasterLogger.js";
import LoggerClient from './src/LoggerClient.js';
2023-04-13 15:25:49 +02:00
import Defaults, { LogLevel } from "./src/Defaults.js";
2023-04-12 19:13:14 +02:00
2023-04-13 15:25:49 +02:00
const addLogLevel = (name: string, level: number) => {
if (typeof name !== 'string')
throw new Error('Name must be a string');
if (typeof level !== 'number')
throw new Error('Level must be a number');
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
LogLevel[LogLevel[name] = level] = name;
};
2023-04-13 18:15:36 +02:00
export {
MasterLogger,
LoggerClient, Defaults, LogLevel, addLogLevel,
};
export { LoggerClientOptions, LoggerMasterOptions } from './src/Defaults.js';