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

Method constructor

packages/logger/src/index.ts:158–181  ·  view source on GitHub ↗

* Create a new logger for a specific module * @param module The name of the module (e.g., 'OpenAIProvider', 'AgentBlockHandler') * @param overrideConfig Optional configuration overrides

(module: string, overrideConfig?: LoggerConfig)

Source from the content-addressed store, hash-verified

156 * @param overrideConfig Optional configuration overrides
157 */
158 constructor(module: string, overrideConfig?: LoggerConfig) {
159 this.module = module
160 this.config = getLogConfig()
161 this.isDev = getNodeEnv() === 'development'
162
163 // Apply overrides if provided
164 if (overrideConfig) {
165 if (overrideConfig.logLevel !== undefined) {
166 const level =
167 typeof overrideConfig.logLevel === 'string'
168 ? (overrideConfig.logLevel as LogLevel)
169 : overrideConfig.logLevel
170 if (Object.values(LogLevel).includes(level)) {
171 this.config.minLevel = level
172 }
173 }
174 if (overrideConfig.colorize !== undefined) {
175 this.config.colorize = overrideConfig.colorize
176 }
177 if (overrideConfig.enabled !== undefined) {
178 this.config.enabled = overrideConfig.enabled
179 }
180 }
181 }
182
183 /**
184 * Creates a child logger with additional metadata merged in.

Callers

nothing calls this directly

Calls 2

getLogConfigFunction · 0.85
getNodeEnvFunction · 0.85

Tested by

no test coverage detected