The type of options.header in Options

Note: it is a class only for validation purposes via class-validator, but it's not meant to be instantiated.

Constructors

Properties

newLine?: boolean

Leave a new line after Header

@default: undefined (i.e. false)

resolvedName?: boolean

Print resolvedName (eg {MyLogger@/some/path}) even if instance has a loggerName (and has been used on header).

The resolvedName is the name found on pathReplacements, or the plain relativePath itself otherwise.

@default: undefined (i.e. false)

resolvedFromCall?: boolean

Print resolved path from where a .log() & all sibling .xxx() are called.

Uses filename where it is called from on Header, but ONLY if different to loggerName.

Resolves via pathReplacements.

Incurs small extra processing for each .log() operation.

@default: undefined (i.e. false)

lineNumber?: boolean

Print lineNumber from where a l.log() / l.xxx() is called

@default: undefined (i.e. false)

date?: boolean | (() => string)

If true, it prints current Date, eg:

2023-07-08 LOG (src/docs/temp): Hello Date Time!

Using new Date().toISOString().slice(0, 10)

You can override passing a string returning function, eg

date: () => new Date().toLocaleDateString(),

@default: undefined (i.e. false)

time?: boolean | (() => string)

If true, it print current Time, eg

18:25:04 LOG (src/docs/temp): Hello Date Time!

Using (new Date).toLocaleTimeString().

You can override passing a string returning function, eg

time: () => new Date().toLocaleTimeString(),

@default: undefined (i.e. false)

timerPadding?: number

How many chars to use for padding the milliseconds duration of .timer().

6