import { Level } from './Levels'; import { TLTimestamp, TLLabel, TLTitle, TLExtra, TLComments } from './Options'; import { RequestHandler } from 'express'; import Chalk from 'chalk'; /** * Chalk instance, in case you want to use it. * * **Please note:** tlog is using Chalk `4.1.2`, NOT Chalk `5.x.x` */ export declare const chalk: Chalk.Chalk; /** * TLog class. Use with `new TLog()` to get started. */ export declare class TLog { private _chalk; private level; private timestamp; private label; private title; private extra; private comments; /** * Configure a new TLog instance. `level` is optional, defaulting to **`info`**. */ constructor(level?: Level); private getChalk; private getTimestamp; private getLabel; private getTitle; private getMessage; private getExtra; private log; setLevel(level: Level): this; setTimestamp(timestamp: Partial): this; setLabel(label: Partial): this; setTitle(title: Partial): this; setExtra(extra: Partial): this; setComments(comments: Partial): this; debug(message: string): this; debug(title: string, message: string): this; debug(title: string, message: string, extra: string): this; info(message: string): this; info(title: string, message: string): this; info(title: string, message: string, extra: string): this; warn(message: string): this; warn(title: string, message: string): this; warn(title: string, message: string, extra: string): this; error(message: string): this; error(title: string, message: string): this; error(title: string, message: string, extra: string): this; fatal(message: string): this; fatal(title: string, message: string): this; fatal(title: string, message: string, extra: string): this; success(message: string): this; success(title: string, message: string): this; success(title: string, message: string, extra: string): this; utils(message: string): this; utils(title: string, message: string): this; utils(title: string, message: string, extra: string): this; comment(...args: any[]): this; basic(...args: any[]): this; blank(): this; clear(): this; callback(callback?: any): this; /** * Returns an Express middleware function that logs requests in the standard tlog style */ express(options?: { /** * An array of paths to exclude from logging */ excludePaths?: string[]; /** * An array of methods to exclude from logging */ excludeMethods?: string[]; /** * Configures path trimming */ trimPaths?: false | { /** * The maximum allowed length of a path before it is trimmed */ maxLength: number; /** * The delimiter to use when trimming a path */ delimiter: string; }; /** * Enables morgan mode, which logs requests in the morgan style. NOT FINISHED YET */ morganMode?: boolean; }): RequestHandler; epoch(): this; pid(): this; uptime(): this; cwd(): this; }