import * as Filter from './filter'; import * as Level from './level'; import * as Output from './output'; export declare type Manager = Data & { (newSettings: Input): void; }; /** * The normalized settings. Unlike settings input there are no shorthands here. * This data is read-only, it is not intended to be mutated directly. */ export declare type Data = Readonly<{ filter: Readonly<{ originalInput: string; defaults: Filter.Defaults; patterns: Filter.Parsed[]; }>; pretty: Readonly<{ enabled: boolean; color: boolean; levelLabel: boolean; timeDiff: boolean; }>; data: { time: boolean; pid: boolean; hostname: boolean; }; output: Output.Output; }>; export declare type Input = { output?: Output.Output; /** * Filter logs by path and/or level. * * By default the pattern is '*'. The "default level" defaults to the first value found in: * * 1. LOG_LEVEL envar if set * 2. 'info' if NODE_ENV envar set to 'production' * 3. 'debug' * * @examples * * Logs from foo logger * * foo * * Logs from foo _or_ bar logger * * foo,bar * * Logs from _not_ foo logger * * !foo * * Logs from foo logger at level 3 (info) or higher * * foo@3+ * * Logs from any logger at level 3 (info) or higher * * foo@info+ * * Logs from foo logger at level 3 (info) or lower * * foo@3- * * Logs from foo:sub logger * * foo:sub * * Logs from any descendants of foo:sub logger * * foo:sub:* * * Logs from any descendants of foo:sub logger _or_ foo:sub logger itself * * foo:sub* * */ filter?: string | { /** * Filter logs by path and/or level. * * @default '*' * * @examples * * Logs from foo logger * * foo * * Logs from foo _or_ bar logger * * foo,bar * * Logs from _not_ foo logger * * !foo * * Logs from foo logger at level 3 (info) or higher * * foo@3+ * * Logs from any logger at level 3 (info) or higher * * foo@info+ * * Logs from foo logger at level 3 (info) or lower * * foo@3- * * Logs from foo:sub logger * * foo:sub * * Logs from any descendants of foo:sub logger * * foo:sub:* * * Logs from any descendants of foo:sub logger _or_ foo:sub logger itself * * foo:sub* * */ pattern?: string; /** * todo revise jsdoc, the concept of this has changed * Set the minimum level a log must be at for it to be written to output. * * This level setting has highest precedence of all logger level configuration * tiers. * * @default * * Takes the first value found, searching in the following order: * * 1. LOG_LEVEL envar if set * 2. 'info' if NODE_ENV envar set to 'production' * 3. 'debug' */ level?: Level.Name; }; /** * Control pretty mode. * * Shorthands: * * - `true` is shorthand for `{ enabled: true }` * - `false` is shorthand for `{ enabled: false }` * * When `undefined` pretty takes the first value found, in order: * * 1. `process.env.LOG_PRETTY` (admits case insensitive: `true` | `false`) * 2. `process.stdout.isTTY` */ pretty?: boolean | { /** * Disable or enable pretty mode. * * When `undefined` pretty takes the first value found, in order: * * 1. `process.env.LOG_PRETTY` (admits case insensitive: `true` | `false`) * 2. `process.stdout.isTTY` */ enabled?: boolean; /** * Should logs be colored? * * @default `true` * * Disabling can be useful when pretty logs are going to a destination that * does not support rendering ANSI color codes (consequence being very * difficult to read content). */ color?: boolean; /** * Should logs include the level label? * * @default `false` * * Enable this if understanding the level of a log is important to you * and the icon+color system is insufficient for you to do so. Can be * helpful for newcomers or a matter of taste for some. */ levelLabel?: boolean; /** * Should the logs include the time between it and previous log? * * @default `true` */ timeDiff?: boolean; }; /** * Toggle pieces of data that should or should not be logged. */ data?: { /** * The Unix timestamp in milliseconds when the log was written to the * output. * * @default `true` if NODE_ENV="production" */ time?: boolean; /** * The current node process ID assigned by the operating system. Acquired * via `process.pid`. * * @default `true` if NODE_ENV="production" */ pid?: boolean; /** * The host name of the machine this process is running on. Acquired via `OS.hostname()`. * * @default `true` if NODE_ENV="production" */ hostname?: boolean; }; }; /** * Process data setting input. */ export declare function processSettingInputData(data: NonNullable, previous: null | Data['data']): Data['data']; /** * Process pretty setting input. */ export declare function processSettingInputPretty(pretty: Input['pretty'], previous: null | Data['pretty']): Data['pretty']; export declare function create(opts?: Input): Manager; export declare function processSettingInputFilter(newSettingsFilter: NonNullable, prev: null | Data['filter']): Data['filter']; export declare function defaultFilterSetting(): Data['filter']; //# sourceMappingURL=settings.d.ts.map