logger/index.ts

26 lines
823 B
TypeScript

import MasterLogger from './src/MasterLogger.js';
import LoggerClient from './src/LoggerClient.js';
import Defaults, { LogLevel } from './src/Defaults.js';
export { WebhookClientOptions } from '@navy.gif/discord-webhook';
export { WriteOptions, LogFunction, Loggable } 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,
};