Skip to content

5.4.0

Latest

Choose a tag to compare

@terehov terehov released this 18 Oct 19:39

Added

  • Custom pretty placeholders — pretty.placeholders: { token: (meta, pretty) => string | number } registers your own {{token}}s for pretty.template, styled through pretty.styles like the built-in ones, so a composite value such as HH:mm:ss.SSS is colored as one unit. Only tokens the template references are evaluated; a throwing callback renders empty and never drops the log; built-in names are reserved; sub-loggers inherit the parent's map. Meta template only — error templates and JSON output are unchanged. Thanks @clayzx.
  • pretty.styles key validation — a misspelled style key (styles: { logLevelNmae }) now warns in development with a did-you-mean, or throws TslogConfigError (UNKNOWN_PRETTY_STYLE) under strictConfig, since IPrettyLogStyles accepts any key to allow styling custom placeholders.

v5.2.0...v5.4.0