MCPcopy Index your code
hub / github.com/Effect-TS/effect / annotateLogsScoped

Function annotateLogsScoped

packages/effect/src/internal/fiberRuntime.ts:1634–1652  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1632 (key: string, value: unknown): Effect.Effect<void, never, Scope.Scope>
1633 (values: Record<string, unknown>): Effect.Effect<void, never, Scope.Scope>
1634} = function() {
1635 if (typeof arguments[0] === "string") {
1636 return fiberRefLocallyScopedWith(
1637 core.currentLogAnnotations,
1638 HashMap.set(arguments[0], arguments[1])
1639 )
1640 }
1641 const entries = Object.entries(arguments[0])
1642 return fiberRefLocallyScopedWith(
1643 core.currentLogAnnotations,
1644 HashMap.mutate((annotations) => {
1645 for (let i = 0; i < entries.length; i++) {
1646 const [key, value] = entries[i]
1647 HashMap.set(annotations, key, value)
1648 }
1649 return annotations
1650 })
1651 )
1652}
1653
1654/** @internal */
1655export const whenLogLevel = dual<

Callers

nothing calls this directly

Calls 3

entriesMethod · 0.80
setMethod · 0.65

Tested by

no test coverage detected