MCPcopy
hub / github.com/unjs/consola / ConsolaOptions

Interface ConsolaOptions

src/types.ts:3–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1import type { LogLevel, LogType } from "./constants";
2
3export interface ConsolaOptions {
4 /**
5 * An array of ConsolaReporter instances used to handle and output log messages.
6 */
7 reporters: ConsolaReporter[];
8
9 /**
10 * A record mapping LogType to InputLogObject, defining the log configuration for each log type.
11 * See {@link LogType} and {@link InputLogObject}.
12 */
13 types: Record<LogType, InputLogObject>;
14
15 /**
16 * The minimum log level to output. See {@link LogLevel}.
17 */
18 level: LogLevel;
19
20 /**
21 * Default properties applied to all log messages unless overridden. See {@link InputLogObject}.
22 */
23 defaults: InputLogObject;
24
25 /**
26 * The maximum number of times a log message can be repeated within a given timeframe.
27 */
28 throttle: number;
29
30 /**
31 * The minimum time in milliseconds that must elapse before a throttled log message can be logged again.
32 */
33 throttleMin: number;
34
35 /**
36 * The Node.js writable stream for standard output. See {@link NodeJS.WriteStream}.
37 * @optional
38 */
39 stdout?: NodeJS.WriteStream;
40
41 /**
42 * The Node.js writeable stream for standard error output. See {@link NodeJS.WriteStream}.
43 * @optional
44 */
45 stderr?: NodeJS.WriteStream;
46
47 /**
48 * A function that allows you to mock log messages for testing purposes.
49 * @optional
50 */
51 mockFn?: (type: LogType, defaults: InputLogObject) => (...args: any) => void;
52
53 /**
54 * Custom prompt function to use. It can be undefined.
55 * @optional
56 */
57 prompt?: typeof import("./prompt").prompt | undefined;
58
59 /**
60 * Configuration options for formatting log messages. See {@link FormatOptions}.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…