MCPcopy Create free account
hub / github.com/brillout/react-streaming / debugWithOptions

Function debugWithOptions

src/utils/debug.ts:27–35  ·  view source on GitHub ↗
(options: Options)

Source from the content-addressed store, hash-verified

25
26function createDebugger(namespace: Namespace, optionsGlobal?: Options) {
27 const debugWithOptions = (options: Options) => {
28 return (msg: string, info?: unknown) => {
29 if (!isDebugEnabled(namespace)) return
30 if (info !== undefined) {
31 msg += strInfo(info, { ...optionsGlobal, ...options })
32 }
33 console.log('\x1b[1m%s\x1b[0m', namespace, msg)
34 }
35 }
36 const debug = (msg: string, info?: unknown) => debugWithOptions({})(msg, info)
37 objectAssign(debug, { options: debugWithOptions, isEnabled: isDebugEnabled(namespace) })
38 return debug

Callers 1

debugFunction · 0.85

Calls 2

isDebugEnabledFunction · 0.85
strInfoFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…