MCPcopy
hub / github.com/prisma/prisma / createLogFormatter

Function createLogFormatter

packages/query-plan-executor/src/log/format.ts:41–50  ·  view source on GitHub ↗
(format: LogFormat)

Source from the content-addressed store, hash-verified

39 * Creates a formatter for the specified log format.
40 */
41export function createLogFormatter(format: LogFormat): ConsoleFormatter {
42 switch (format) {
43 case 'json':
44 return new JsonFormatter()
45 case 'text':
46 return new TextFormatter()
47 default:
48 throw new Error(`Invalid log format: ${format satisfies never}`)
49 }
50}
51
52/**
53 * Formatter that outputs log events as JSON strings.

Callers 2

format.test.tsFile · 0.90
createConsoleLoggerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected