logger/index.ts
2023-06-15 13:13:46 +03:00

24 lines
740 B
TypeScript

import MasterLogger from './src/MasterLogger.js';
import LoggerClient from './src/LoggerClient.js';
import Defaults, { LogLevel } from './src/Defaults.js';
export { WriteOptions, LogFunction } from './src/Types.js';
export { LoggerClientOptions, LoggerMasterOptions } from './src/Defaults.js';
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;
};
export {
MasterLogger,
LoggerClient,
Defaults, LogLevel, addLogLevel,
};