MCPcopy Index your code
hub / github.com/promptfoo/promptfoo / normalizeLevel

Method normalizeLevel

src/python/stderr.ts:94–110  ·  view source on GitHub ↗
(level: string)

Source from the content-addressed store, hash-verified

92 }
93
94 private normalizeLevel(level: string): StderrLevel {
95 switch (level.toUpperCase()) {
96 case 'DEBUG':
97 return 'debug';
98 case 'INFO':
99 return 'info';
100 case 'WARN':
101 case 'WARNING':
102 return 'warn';
103 case 'ERROR':
104 case 'CRITICAL':
105 case 'FATAL':
106 return 'error';
107 default:
108 return 'warn';
109 }
110 }
111
112 private writeLog(level: StderrLevel, line: string): void {
113 logger[level](`${this.prefix}${line}`);

Callers 1

logLineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected