MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / severityLevelFromString

Function severityLevelFromString

packages/core/src/utils/severity.ts:9–13  ·  view source on GitHub ↗
(level: SeverityLevel | string)

Source from the content-addressed store, hash-verified

7 * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.
8 */
9export function severityLevelFromString(level: SeverityLevel | string): SeverityLevel {
10 return (
11 level === 'warn' ? 'warning' : ['fatal', 'error', 'warning', 'log', 'info', 'debug'].includes(level) ? level : 'log'
12 ) as SeverityLevel;
13}

Callers 7

severity.test.tsFile · 0.90
addConsoleBreadcrumbFunction · 0.90
consoleHandlerFunction · 0.90
onPinoStartFunction · 0.90
makeReplayDebugLoggerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected