@storm-stack/log-stream
Version:
A package containing a Storm Stack log adapter to write logs to a stream
49 lines (48 loc) • 1.68 kB
TypeScript
import type { AnsiColorFormatterOptions, TextFormatter, TextFormatterOptions } from "./types";
/**
* Get a text formatter with the specified options. Although it's flexible
* enough to create a custom formatter, if you want more control, you can
* create a custom formatter that satisfies the {@link TextFormatter} type
* instead.
*
* For more information on the options, see {@link TextFormatterOptions}.
*
* By default, the formatter formats log records as follows:
*
* ```
* 2023-11-14 22:13:20.000 +00:00 [INFO] Hello, world!
* ```
* @param options - The options for the text formatter.
* @returns The text formatter.
*/
export declare function getTextFormatter(options?: TextFormatterOptions): TextFormatter;
/**
* The default text formatter. This formatter formats log records as follows:
*
* ```
* 2023-11-14 22:13:20.000 +00:00 [INFO] Hello, world!
* ```
*
* @param record The log record to format.
* @returns The formatted log record.
*/
export declare const defaultTextFormatter: TextFormatter;
/**
* Get an ANSI color formatter with the specified options.
*
* 
*
* @param options - The options for the ANSI color formatter.
* @returns The ANSI color formatter.
*/
export declare function getAnsiColorFormatter(options?: AnsiColorFormatterOptions): TextFormatter;
/**
* A text formatter that uses ANSI colors to format log records.
*
* 
*
* @param record The log record to format.
* @returns The formatted log record.
* @since 0.5.0
*/
export declare const ansiColorFormatter: TextFormatter;