MCPcopy Create free account
hub / github.com/cameri/nostream / safeFormat

Function safeFormat

src/factories/logger-factory.ts:29–37  ·  view source on GitHub ↗
(template: string, args: unknown[])

Source from the content-addressed store, hash-verified

27}
28
29const safeFormat = (template: string, args: unknown[]): string => {
30 try {
31 return format(template, ...args)
32 } catch {
33 const extra = args.map(stringifyForLog).join(' ')
34
35 return extra ? `${template} ${extra}` : template
36 }
37}
38
39const logAtLevel = (
40 instance: PinoLogger,

Callers 1

logAtLevelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected