MCPcopy Create free account
hub / github.com/Effect-TS/effect / filterLogs

Function filterLogs

packages/effect/test/unstable/cli/LogLevel.test.ts:77–87  ·  view source on GitHub ↗
(minLevel: string)

Source from the content-addressed store, hash-verified

75
76 // Filter logs based on minimum level
77 const filterLogs = (minLevel: string) => {
78 if (minLevel === "none") return []
79 if (minLevel === "all") return allLogs.slice().reverse()
80
81 const minSeverity = severityOrder.indexOf(
82 minLevel === "warning" ? "Warn" : minLevel.charAt(0).toUpperCase() + minLevel.slice(1)
83 )
84 return allLogs
85 .filter((log) => severityOrder.indexOf(log.level) <= minSeverity)
86 .reverse()
87 }
88
89 // Test helper that logs at all levels and returns captured logs
90 const testLogLevels = Effect.fnUntraced(function*(logLevel?: string) {

Callers 1

LogLevel.test.tsFile · 0.85

Calls 1

filterMethod · 0.80

Tested by

no test coverage detected