MCPcopy Index your code
hub / github.com/simstudioai/sim / getMinLogLevel

Function getMinLogLevel

packages/logger/src/index.ts:63–80  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

61 * - Test: ERROR (only show errors in tests)
62 */
63const getMinLogLevel = (): LogLevel => {
64 const logLevelEnv = getLogLevel()
65 if (logLevelEnv && Object.values(LogLevel).includes(logLevelEnv as LogLevel)) {
66 return logLevelEnv as LogLevel
67 }
68
69 const nodeEnv = getNodeEnv()
70 switch (nodeEnv) {
71 case 'development':
72 return LogLevel.DEBUG
73 case 'production':
74 return LogLevel.ERROR
75 case 'test':
76 return LogLevel.ERROR
77 default:
78 return LogLevel.DEBUG
79 }
80}
81
82/**
83 * Configuration for different environments

Callers 1

getLogConfigFunction · 0.85

Calls 2

getLogLevelFunction · 0.85
getNodeEnvFunction · 0.85

Tested by

no test coverage detected