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

Function withLeveledConsole

packages/effect/src/Logger.ts:359–380  ·  view source on GitHub ↗
(
  self: Logger<Message, Output>
)

Source from the content-addressed store, hash-verified

357 * @since 3.8.0
358 */
359export const withLeveledConsole = <Message, Output>(
360 self: Logger<Message, Output>
361): Logger<Message, void> =>
362 effect.loggerMake((options) => {
363 const console = options.fiber.getRef(effect.ConsoleRef)
364 const output = self.log(options)
365 switch (options.logLevel) {
366 case "Debug":
367 return console.debug(output)
368 case "Info":
369 return console.info(output)
370 case "Trace":
371 return console.trace(output)
372 case "Warn":
373 return console.warn(output)
374 case "Error":
375 case "Fatal":
376 return console.error(output)
377 default:
378 return console.log(output)
379 }
380 })
381
382/**
383 * Match strings that do not contain any whitespace characters, double quotes,

Callers

nothing calls this directly

Calls 7

getRefMethod · 0.80
debugMethod · 0.80
infoMethod · 0.80
traceMethod · 0.80
warnMethod · 0.80
errorMethod · 0.80
logMethod · 0.65

Tested by

no test coverage detected