(_options: Partial<Options>)
| 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)) { |
nothing calls this directly
no test coverage detected