Function
parseLogConf
(logConf: string, options: Options)
Source from the content-addressed store, hash-verified
| 126 | } |
| 127 | |
| 128 | const parseLogConf = (logConf: string, options: Options): { level: string; bizName: string } => { |
| 129 | if (!logConf) { |
| 130 | return { |
| 131 | level: options.level, |
| 132 | bizName: options.bizName, |
| 133 | } |
| 134 | } |
| 135 | if (logConf.indexOf(':') > -1) { |
| 136 | const pair = logConf.split(':') |
| 137 | return { |
| 138 | level: pair[0], |
| 139 | bizName: pair[1] || '*', |
| 140 | } |
| 141 | } |
| 142 | return { |
| 143 | level: logConf, |
| 144 | bizName: '*', |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | const defaultOptions: Options = { |
| 149 | level: 'warn', |
Tested by
no test coverage detected