···147147148148**Labels** are inserted between the log level and message contents of a log. The child logger inherits **all** labels from **all** its parent loggers.
149149150150-`childLogger` accepts a single string label or an array of string labels.
150150+`childLogger` accepts a single string/function label or an array of string/function labels.
151151152152```ts
153153import {loggerApp, childLogger} from '@foxxmd/logging';
···160160nestedChild1.debug('I am nested one level');
161161// [2024-03-07 11:27:41.945 -0500] DEBUG: [First] I am nested one level
162162163163-const nestedChild2 = childLogger(nestedChild1, ['Second', 'Third']);
163163+const nestedChild2 = childLogger(nestedChild1, ['Second', () => 'Third']);
164164nestedChild2.warn('I am nested two levels but with more labels');
165165// [2024-03-07 11:27:41.945 -0500] WARN: [First] [Second] [Third] I am nested two levels but with more labels
166166···174174```ts
175175logger.debug({labels: ['MyLabel']}, 'My log message');
176176```
177177+178178+**NOTE:** If a label *function* throws an error then the label will be the error's message. Make sure your labels don't throw!
177179178180### Serializing Objects and Errors
179181
+18-1
src/loggers.ts
···99 LogOptions
1010} from "./types.js";
1111import {buildDestinationFile, buildDestinationRollingFile, buildDestinationStdout} from "./destinations.js";
1212-import {pino, levels} from "pino";
1212+import {pino, levels, stdSerializers} from "pino";
13131414/**
1515 * Builds a Logger object for use in your application
···4141 level: defaultLevel,
4242 customLevels: CUSTOM_LEVELS,
4343 useOnlyCustomLevels: false,
4444+ serializers: {
4545+ err: stdSerializers.err,
4646+ labels: (labels: any[]) => {
4747+ // allow dynamic labels
4848+ return labels.map(x => {
4949+ if(typeof x === 'function') {
5050+ try {
5151+ return x()
5252+ } catch (e) {
5353+ return e.message;
5454+ }
5555+ }
5656+ return x;
5757+5858+ }).filter(x => x !== null && x !== undefined);
5959+ },
6060+ },
4461 ...extras
4562 }, pino.multistream(streams, {levels: {...levels.values, ...CUSTOM_LEVELS}})) as Logger;
4663 plogger.labels = [];