···11import {PrettyOptions} from "pino-pretty";
22import {CWD} from "./util.js";
33+import {CUSTOM_LEVELS} from "./types.js";
3445/**
56 * Additional levels included in @foxxmd/logging as an object
67 *
78 * These are always applied when using `prettyOptsFactory` but can be overridden
89 * */
99-export const PRETTY_LEVELS: Extract<PrettyOptions['customLevels'], object> = {
1010- verbose: 25,
1111- log: 21,
1212-};
1010+const PRETTY_LEVELS: Extract<PrettyOptions['customLevels'], object> = CUSTOM_LEVELS;
1311/**
1412 * Additional levels included in @foxxmd/logging as a string
1513 *
1614 * These are always applied when using `prettyOptsFactory` but can be overridden
1715 * */
1818-export const PRETTY_LEVELS_STR: Extract<PrettyOptions['customLevels'], string> = 'verbose:25,log:21';
1616+const PRETTY_LEVELS_STR: Extract<PrettyOptions['customLevels'], string> = 'verbose:25,log:21';
19172018/**
2119 * Additional level colors included in @foxxmd/logging as an object
···4139/**
4240 * Builds the opinionated `@foxxmd/logging` defaults for pino-pretty `PrettyOptions` and merges them with an optional user-provided `PrettyOptions` object
4341 * */
4444-export const prettyOptsFactory = (opts: PrettyOptions = {}): PrettyOptions => {
4545- const {customLevels = {}, customColors = {}, ...rest} = opts;
4242+export const prettyOptsFactory = (opts: Omit<PrettyOptions, 'customLevels'> = {}): PrettyOptions => {
4343+ const {
4444+ //customLevels = {},
4545+ customColors = {},
4646+ ...rest
4747+ } = opts;
46484749 return {
4850 messageFormat: (log, messageKey, levelLabel, {colors}) => {
···6062 hideObject: false,
6163 ignore: 'pid,hostname,labels,err',
6264 translateTime: 'SYS:standard',
6363- customLevels: buildLevels(customLevels),
6565+ customLevels: buildLevels({}),
6466 customColors: buildColors(customColors),
6567 colorizeObjects: true,
6668 // @ts-ignore
+11-1
src/types.ts
···11-import {DestinationStream, Level, Logger as PinoLogger, StreamEntry} from 'pino';
11+import {DestinationStream, Level, Logger as PinoLogger, LoggerOptions, StreamEntry} from 'pino';
22import {ErrorWithCause} from "pony-cause";
33import {PrettyOptions} from "pino-pretty";
44import {MarkRequired} from "ts-essentials";
···171171 * */
172172 destinations?: LogLevelStreamEntry[]
173173}
174174+175175+/**
176176+ * Additional levels included in @foxxmd/logging as an object
177177+ *
178178+ * These are always applied when using `prettyOptsFactory` but can be overridden
179179+ * */
180180+export const CUSTOM_LEVELS: LoggerOptions<"verbose" | "log">['customLevels'] = {
181181+ verbose: 25,
182182+ log: 21
183183+}