@bracketed/logger
Version:
An alternative to your run-of-the-mill node console logging functions!
69 lines (66 loc) • 2.22 kB
TypeScript
import { LogLevel } from './ILogger/ILogLevel.js';
import { LoggerFormatOptions } from './FormatOptions.js';
import { LoggerLevel } from './Level.js';
import { LoggerLevelOptions } from './LevelOptions.js';
import { Color } from '../Colouring/index.js';
import { Logger as Logger$1 } from './ILogger/ILoggerStyle.js';
import { LoggerOptions } from './Options.js';
import '../Style/Background.js';
import '../Style/Effect.js';
import '../Style/Options.js';
import '../Style/Resolvable.js';
import '../Style/Style.js';
import '../Style/Text.js';
import '../Utilities/Timestamp.js';
import '../Timestamper/Timestamp.js';
import './ILogger/ILogger.js';
import './ILogger/ILogMethods.js';
declare class Logger extends Logger$1 {
/**
* The console this writes to.
* @since 1.0.0
*/
readonly console: Console;
/**
* The formats supported by the logger.
* @since 1.0.0
*/
readonly formats: Map<LogLevel, LoggerLevel>;
/**
* The string `write` will join values by.
* @since 1.0.0
*/
readonly join: string;
/**
* The inspect depth when logging objects.
* @since 1.0.0
*/
readonly depth: number;
/**
* A prefix for messages logged by the logger.
* @since 1.0.11
*/
private readonly prefix;
constructor(options?: LoggerOptions);
/**
* Writes the log message given a level and the value(s).
* @param level The log level.
* @param values The values to log.
*/
write(level: LogLevel, ...values: readonly unknown[]): void;
/**
* Pre-processes an array of values.
* @since 1.0.0
* @param values The values to pre-process.
*/
protected preprocess(values: readonly unknown[]): string;
private get levels();
/**
* Gets whether or not colorette is enabled.
* @since 1.0.0
*/
static get stylize(): boolean;
protected createFormatMap(options?: LoggerFormatOptions, defaults?: LoggerLevelOptions): Map<LogLevel, LoggerLevel>;
protected ensureDefaultLevel(options: LoggerLevelOptions | undefined, defaults: LoggerLevelOptions, color: Color, name: string): LoggerLevel;
}
export { Logger };