MCPcopy Create free account
hub / github.com/Easy-Editor/EasyEditor / constructor

Method constructor

packages/core/src/utils/logger.ts:169–184  ·  view source on GitHub ↗
(_options: Partial<Options>)

Source from the content-addressed store, hash-verified

167 targetLevel: string
168
169 constructor(_options: Partial<Options>) {
170 const options = { ...defaultOptions, ..._options }
171 const _location = location || ({} as any)
172 /**
173 * __logConf__ 格式为 logLevel[:bizName], bizName is used as: targetBizName like '%bizName%'
174 * 1. __logConf__=log or __logConf__=warn, etc.
175 * 2. __logConf__=log:* or __logConf__=warn:*, etc.
176 * 3. __logConf__=log:bizName or __logConf__=warn:partOfBizName, etc.
177 */
178 const logConf = (/__(?:logConf|logLevel)__=([^#/&]*)/.exec(_location.href) || [])[1]
179 const targetOptions = parseLogConf(logConf, options)
180
181 this.bizName = options.bizName
182 this.targetBizName = targetOptions.bizName
183 this.targetLevel = targetOptions.level
184 }
185
186 debug(...args: any[]) {
187 if (!shouldOutput('debug', this.targetLevel, this.bizName, this.targetBizName)) {

Callers

nothing calls this directly

Calls 1

parseLogConfFunction · 0.85

Tested by

no test coverage detected