@wiajs/log 4.3.15 → 4.3.17

Sign up to get free protection for your applications and to get access to all the features.
package/dist/log.mjs CHANGED
@@ -9,135 +9,132 @@
9
9
  * m 为模块,fn 为函数名称
10
10
  */
11
11
  class Log {
12
- /** @type {string} 模块 */
13
- m = "";
14
-
15
- /** @type {string} 函数 */
16
- fn = "";
17
-
18
- /**
19
- * @param {string} m 模块
20
- */
21
- constructor(m) {
22
- this.m = m;
23
- }
24
-
25
- /**
26
- * get log desc
27
- * 描述字符串作为最后参数调用,显示时,前置
28
- * @param {*[]} args
29
- * @returns {{desc: string, arg: *[]}}
30
- */
31
- getDesc(args) {
32
- let R = {desc: '', arg: args};
33
- try {
34
- const _ = this;
35
- const { m } = _;
36
- let fn = "";
37
- let desc = "";
38
-
39
- if (args.length > 1) {
40
- const last = args.at(-1);
41
- if (typeof last === "object") {
42
- ({ desc, fn } = last);
43
- } else if (typeof last === "string") desc = last;
44
- if (desc || fn) {
45
- fn = fn || _.fn;
46
- _.fn = fn;
47
- args.pop();
48
- }
49
- }
50
- fn = fn || _.fn;
51
- if (m) desc = `${desc}[${m}${fn ? `:${fn}` : ""}]`; // eslint-disable-line
52
- R = {desc, arg: args};
53
- } catch (e) {
54
- console.error(`getDesc exp:${e.message}`);
55
- }
56
-
57
- return R;
58
- }
59
-
60
- /** @param {...any} args - params */
61
- log(...args) {
62
- const _ = this;
63
- const last = args.at(-1);
64
- // clear fn
65
- if (args.length === 1 && typeof last === "object" && last.fn) _.fn = "";
66
- else {
67
- const desc = _.getDesc(args);
68
- console.log(desc, ...args);
69
- }
70
- }
71
-
72
- /** @param {...any} args - params */
73
- debug(...args) {
74
- const _ = this;
75
- const desc = _.getDesc(args);
76
- if (desc) console.log(desc, ...args);
77
- else console.log(...args);
78
- }
79
-
80
- /** @param {...any} args - params */
81
- info(...args) {
82
- const _ = this;
83
- const desc = _.getDesc(args);
84
- if (desc) console.info(desc, ...args);
85
- else console.log(...args);
86
- }
87
-
88
- /** @param {...any} args - params */
89
- warn(...args) {
90
- const _ = this;
91
- const { desc, arg } = _.getDesc(args);
92
- if (desc) console.warn(desc, ...arg);
93
- else console.log(...args);
94
- }
95
-
96
- /** @param {...any} args - params */
97
- trace(...args) {
98
- const _ = this;
99
- const { desc, arg } = _.getDesc(args);
100
- if (desc) console.trace(desc, ...arg);
101
- else console.trace(...args);
102
- }
103
-
104
- /** @param {...any} args - params */
105
- error(...args) {
106
- const _ = this;
107
- const {desc, arg} = _.getDesc(args);
108
- if (desc) console.error(desc, ...arg);
109
- else console.log(...args);
110
- }
111
-
112
- /**
113
- * 用于 catch(e) log.err(e)
114
- * @param {...any} args - params */
115
- err(...args) {
116
- const _ = this;
117
- const first = args?.[0];
118
- if (
119
- first instanceof Error ||
120
- (first?.message && first?.cause && first?.stack)
121
- )
122
- args[0] = { exp: args[0].message };
123
- _.error(...args);
124
- }
12
+ /** @type {string} 模块 */
13
+ m = ''
14
+
15
+ /** @type {string} 函数 */
16
+ fn = ''
17
+
18
+ /**
19
+ * @param {string} m 模块
20
+ */
21
+ constructor(m) {
22
+ this.m = m;
23
+ }
24
+
25
+ /**
26
+ * get log desc
27
+ * 描述字符串作为最后参数调用,显示时,前置
28
+ * @param {*[]} args
29
+ * @returns {{desc: string, arg: *[]}}
30
+ */
31
+ getDesc(args) {
32
+ let R = {desc: '', arg: args};
33
+ try {
34
+ const _ = this;
35
+ const {m} = _;
36
+ let fn = '';
37
+ let desc = '';
38
+
39
+ if (args.length > 1) {
40
+ const last = args.at(-1);
41
+ if (typeof last === 'object') {
42
+ ;({desc, fn} = last);
43
+ } else if (typeof last === 'string') desc = last;
44
+ if (desc || fn) {
45
+ fn = fn || _.fn;
46
+ _.fn = fn;
47
+ args.pop();
48
+ }
49
+ }
50
+ fn = fn || _.fn;
51
+ if (m) desc = `${desc}[${m}${fn ? `:${fn}` : ''}]`; // eslint-disable-line
52
+ R = {desc, arg: args};
53
+ } catch (e) {
54
+ console.error(`getDesc exp:${e.message}`);
55
+ }
56
+
57
+ return R
58
+ }
59
+
60
+ /** @param {...any} args - params */
61
+ log(...args) {
62
+ const _ = this;
63
+ const last = args.at(-1);
64
+ // clear fn
65
+ if (args.length === 1 && typeof last === 'object' && last.fn) _.fn = '';
66
+ else {
67
+ const desc = _.getDesc(args);
68
+ console.log(desc, ...args);
69
+ }
70
+ }
71
+
72
+ /** @param {...any} args - params */
73
+ debug(...args) {
74
+ const _ = this;
75
+ const desc = _.getDesc(args);
76
+ if (desc) console.log(desc, ...args);
77
+ else console.log(...args);
78
+ }
79
+
80
+ /** @param {...any} args - params */
81
+ info(...args) {
82
+ const _ = this;
83
+ const desc = _.getDesc(args);
84
+ if (desc) console.info(desc, ...args);
85
+ else console.log(...args);
86
+ }
87
+
88
+ /** @param {...any} args - params */
89
+ warn(...args) {
90
+ const _ = this;
91
+ const {desc, arg} = _.getDesc(args);
92
+ if (desc) console.warn(desc, ...arg);
93
+ else console.log(...args);
94
+ }
95
+
96
+ /** @param {...any} args - params */
97
+ trace(...args) {
98
+ const _ = this;
99
+ const {desc, arg} = _.getDesc(args);
100
+ if (desc) console.trace(desc, ...arg);
101
+ else console.trace(...args);
102
+ }
103
+
104
+ /** @param {...any} args - params */
105
+ error(...args) {
106
+ const _ = this;
107
+ const {desc, arg} = _.getDesc(args);
108
+ if (desc) console.error(desc, ...arg);
109
+ else console.log(...args);
110
+ }
111
+
112
+ /**
113
+ * 用于 catch(e) log.err(e)
114
+ * @param {...any} args - params */
115
+ err(...args) {
116
+ const _ = this;
117
+ const first = args?.[0];
118
+ if (first instanceof Error || (first?.message && first?.cause && first?.stack))
119
+ args[0] = {exp: args[0].message};
120
+ _.error(...args);
121
+ }
125
122
  }
126
123
 
127
124
  /**
128
125
  * get log desc
129
126
  * 描述字符串作为最后参数调用,显示时,前置
130
- * @param {*[]} args
127
+ * @param {*[]} args
131
128
  * @returns {{desc: string, arg: *[]}}
132
129
  */
133
130
  function getDesc(args) {
134
- let desc = "";
135
- const last = args.at(-1);
136
- if (typeof last === "string") {
137
- desc = last;
138
- args.pop();
139
- }
140
- return {desc, arg: args};
131
+ let desc = '';
132
+ const last = args.at(-1);
133
+ if (typeof last === 'string') {
134
+ desc = last;
135
+ args.pop();
136
+ }
137
+ return {desc, arg: args}
141
138
  }
142
139
 
143
140
  /**
@@ -147,77 +144,74 @@ function getDesc(args) {
147
144
  * returns {*}
148
145
  */
149
146
  function log(...args) {
150
- const last = args.at(-1);
151
-
152
- // 全局日志
153
- if (args.length !== 1 || !last?.m) {
154
- const desc = getDesc(args);
155
- desc ? console.log(desc, ...args) : console.log(...args);
156
- return; // 退出,不创建实例
157
- }
158
-
159
- // 唯一 m 属性,则构造新的 log 实例,这种写法,能被jsDoc识别子属性
160
- const lg = new Log(last?.m);
161
- /** @param {*} args2 */
162
- const R = (...args2) => lg.log(...args2);
163
- R.debug = lg.debug.bind(lg);
164
- R.info = lg.info.bind(lg);
165
- R.warn = lg.warn.bind(lg);
166
- R.info = lg.info.bind(lg);
167
- R.trace = lg.trace.bind(lg);
168
- R.error = lg.error.bind(lg);
169
- R.err = lg.err.bind(lg);
170
-
171
- return R;
147
+ const last = args.at(-1);
148
+
149
+ // 全局日志
150
+ if (args.length !== 1 || !last?.m) {
151
+ const desc = getDesc(args);
152
+ desc ? console.log(desc, ...args) : console.log(...args);
153
+ return // 退出,不创建实例
154
+ }
155
+
156
+ // 唯一 m 属性,则构造新的 log 实例,这种写法,能被jsDoc识别子属性
157
+ const lg = new Log(last?.m);
158
+ /** @param {*} args2 */
159
+ const R = (...args2) => lg.log(...args2);
160
+ R.debug = lg.debug.bind(lg);
161
+ R.info = lg.info.bind(lg);
162
+ R.warn = lg.warn.bind(lg);
163
+ R.info = lg.info.bind(lg);
164
+ R.trace = lg.trace.bind(lg);
165
+ R.error = lg.error.bind(lg);
166
+ R.err = lg.err.bind(lg);
167
+
168
+ return R
172
169
  }
173
170
 
174
171
  /**
175
172
  * 用于 catch(e) log.err(e)
176
173
  * @param {...any} args - params */
177
174
  log.err = (...args) => {
178
- const {desc, arg} = getDesc(args);
179
- const first = args?.[0];
180
- if (
181
- first instanceof Error ||
182
- (first?.message && first?.cause && first?.stack)
183
- )
184
- args[0] = { exp: args[0].message };
185
- desc ? console.error(desc, ...arg) : console.error(...args);
175
+ const {desc, arg} = getDesc(args);
176
+ const first = args?.[0];
177
+ if (first instanceof Error || (first?.message && first?.cause && first?.stack))
178
+ args[0] = {exp: args[0].message};
179
+ desc ? console.error(desc, ...arg) : console.error(...args);
186
180
  };
187
181
 
188
182
  /**
189
183
  * @param {...any} args - params */
190
184
  log.error = (...args) => {
191
- const {desc, arg} = getDesc(args);
192
- desc ? console.error(desc, ...arg) : console.error(...args);
185
+ const {desc, arg} = getDesc(args);
186
+ desc ? console.error(desc, ...arg) : console.error(...args);
193
187
  };
194
188
 
195
189
  /**
196
190
  * @param {...any} args - params */
197
191
  log.warn = (...args) => {
198
- const {desc, arg} = getDesc(args);
199
- desc ? console.warn(desc, ...arg) : console.warn(...args);
192
+ const {desc, arg} = getDesc(args);
193
+ desc ? console.warn(desc, ...arg) : console.warn(...args);
200
194
  };
201
195
 
202
196
  /**
203
197
  * @param {...any} args - params */
204
198
  log.info = (...args) => {
205
- const {desc, arg} = getDesc(args);
206
- desc ? console.info(desc, ...arg) : console.info(...args);
199
+ const {desc, arg} = getDesc(args);
200
+ desc ? console.info(desc, ...arg) : console.info(...args);
207
201
  };
208
202
 
209
203
  /**
210
204
  * @param {...any} args - params */
211
205
  log.debug = (...args) => {
212
- const {desc, arg} = getDesc(args);
213
- desc ? console.log(desc, ...arg) : console.log(...args);
206
+ const {desc, arg} = getDesc(args);
207
+ desc ? console.log(desc, ...arg) : console.log(...args);
214
208
  };
215
209
 
216
210
  /**
217
211
  * @param {...any} args - params */
218
212
  log.trace = (...args) => {
219
- const {desc, arg} = getDesc(args);
220
- desc ? console.trace(desc, ...arg) : console.trace(...args);
213
+ const {desc, arg} = getDesc(args);
214
+ desc ? console.trace(desc, ...arg) : console.trace(...args);
221
215
  };
222
216
 
223
217
  export { log as default };
package/lib/browser.js CHANGED
@@ -4,28 +4,33 @@
4
4
  * m 为模块,fn 为函数名称
5
5
  */ let Log = class Log {
6
6
  /**
7
- * @param {string} m 模块
8
- */ constructor(m){
9
- /** @type {string} 模块 */ this.m = "";
10
- /** @type {string} 函数 */ this.fn = "";
7
+ * @param {string} m 模块
8
+ */ constructor(m){
9
+ /** @type {string} 模块 */ this.m = '';
10
+ /** @type {string} 函数 */ this.fn = '';
11
11
  this.m = m;
12
12
  }
13
13
  /**
14
- * get log desc
15
- * 描述字符串后置调用,前置显示
16
- * @param {*[]} args
17
- * @returns {string}
18
- */ getDesc(args) {
19
- let R = "";
14
+ * get log desc
15
+ * 描述字符串作为最后参数调用,显示时,前置
16
+ * @param {*[]} args
17
+ * @returns {{desc: string, arg: *[]}}
18
+ */ getDesc(args) {
19
+ let R = {
20
+ desc: '',
21
+ arg: args
22
+ };
20
23
  try {
21
24
  const _ = this;
22
25
  const { m } = _;
23
- let fn = "", desc = "";
26
+ let fn = '';
27
+ let desc = '';
24
28
  if (args.length > 1) {
25
29
  const last = args.at(-1);
26
- if (typeof last === "object") {
30
+ if (typeof last === 'object') {
31
+ ;
27
32
  ({ desc, fn } = last);
28
- } else if (typeof last === "string") desc = last;
33
+ } else if (typeof last === 'string') desc = last;
29
34
  if (desc || fn) {
30
35
  fn = fn || _.fn;
31
36
  _.fn = fn;
@@ -33,8 +38,12 @@
33
38
  }
34
39
  }
35
40
  fn = fn || _.fn;
36
- if (m) desc = `${desc}[${m}${fn ? ":" + fn : ""}]`; // eslint-disable-line
37
- R = desc;
41
+ if (m) desc = `${desc}[${m}${fn ? `:${fn}` : ''}]` // eslint-disable-line
42
+ ;
43
+ R = {
44
+ desc,
45
+ arg: args
46
+ };
38
47
  } catch (e) {
39
48
  console.error(`getDesc exp:${e.message}`);
40
49
  }
@@ -44,7 +53,7 @@
44
53
  const _ = this;
45
54
  const last = args.at(-1);
46
55
  // clear fn
47
- if (args.length === 1 && typeof last === "object" && last.fn) _.fn = "";
56
+ if (args.length === 1 && typeof last === 'object' && last.fn) _.fn = '';
48
57
  else {
49
58
  const desc = _.getDesc(args);
50
59
  console.log(desc, ...args);
@@ -76,29 +85,37 @@
76
85
  }
77
86
  /** @param {...any} args - params */ error(...args) {
78
87
  const _ = this;
79
- const desc = _.getDesc(args);
80
- if (desc) console.error(desc, ...args);
88
+ const { desc, arg } = _.getDesc(args);
89
+ if (desc) console.error(desc, ...arg);
81
90
  else console.log(...args);
82
91
  }
83
92
  /**
84
- * 用于 catch(e) log.err(e)
85
- * @param {...any} args - params */ err(...args) {
93
+ * 用于 catch(e) log.err(e)
94
+ * @param {...any} args - params */ err(...args) {
86
95
  const _ = this;
87
96
  const first = args?.[0];
88
- if (first instanceof Error || first && first.message && first.cause && first.stack) args[0] = {
97
+ if (first instanceof Error || first?.message && first?.cause && first?.stack) args[0] = {
89
98
  exp: args[0].message
90
99
  };
91
100
  _.error(...args);
92
101
  }
93
102
  };
94
- function getDesc(args) {
95
- let desc = "";
103
+ /**
104
+ * get log desc
105
+ * 描述字符串作为最后参数调用,显示时,前置
106
+ * @param {*[]} args
107
+ * @returns {{desc: string, arg: *[]}}
108
+ */ function getDesc(args) {
109
+ let desc = '';
96
110
  const last = args.at(-1);
97
- if (typeof last === "string") {
111
+ if (typeof last === 'string') {
98
112
  desc = last;
99
113
  args.pop();
100
114
  }
101
- return desc;
115
+ return {
116
+ desc,
117
+ arg: args
118
+ };
102
119
  }
103
120
  /**
104
121
  * 标准日志输出或构建模块日志类实例,用于模块中带[m:xxx]标记日志输出
@@ -111,7 +128,7 @@ function getDesc(args) {
111
128
  if (args.length !== 1 || !last?.m) {
112
129
  const desc = getDesc(args);
113
130
  desc ? console.log(desc, ...args) : console.log(...args);
114
- return;
131
+ return; // 退出,不创建实例
115
132
  }
116
133
  // 唯一 m 属性,则构造新的 log 实例,这种写法,能被jsDoc识别子属性
117
134
  const lg = new Log(last?.m);
@@ -128,49 +145,36 @@ function getDesc(args) {
128
145
  /**
129
146
  * 用于 catch(e) log.err(e)
130
147
  * @param {...any} args - params */ log.err = (...args)=>{
131
- const desc = getDesc(args);
148
+ const { desc, arg } = getDesc(args);
132
149
  const first = args?.[0];
133
- if (first instanceof Error || first && first.message && first.cause && first.stack) args[0] = {
150
+ if (first instanceof Error || first?.message && first?.cause && first?.stack) args[0] = {
134
151
  exp: args[0].message
135
152
  };
136
- desc ? console.error(desc, ...args) : console.error(...args);
153
+ desc ? console.error(desc, ...arg) : console.error(...args);
137
154
  };
138
155
  /**
139
156
  * @param {...any} args - params */ log.error = (...args)=>{
140
- const desc = getDesc(args);
141
- desc ? console.error(desc, ...args) : console.error(...args);
157
+ const { desc, arg } = getDesc(args);
158
+ desc ? console.error(desc, ...arg) : console.error(...args);
142
159
  };
143
160
  /**
144
161
  * @param {...any} args - params */ log.warn = (...args)=>{
145
- const desc = getDesc(args);
146
- desc ? console.warn(desc, ...args) : console.warn(...args);
162
+ const { desc, arg } = getDesc(args);
163
+ desc ? console.warn(desc, ...arg) : console.warn(...args);
147
164
  };
148
165
  /**
149
166
  * @param {...any} args - params */ log.info = (...args)=>{
150
- const desc = getDesc(args);
151
- desc ? console.info(desc, ...args) : console.info(...args);
167
+ const { desc, arg } = getDesc(args);
168
+ desc ? console.info(desc, ...arg) : console.info(...args);
152
169
  };
153
170
  /**
154
171
  * @param {...any} args - params */ log.debug = (...args)=>{
155
- const desc = getDesc(args);
156
- desc ? console.log(desc, ...args) : console.log(...args);
172
+ const { desc, arg } = getDesc(args);
173
+ desc ? console.log(desc, ...arg) : console.log(...args);
157
174
  };
158
175
  /**
159
176
  * @param {...any} args - params */ log.trace = (...args)=>{
160
- const desc = getDesc(args);
161
- desc ? console.trace(desc, ...args) : console.trace(...args);
177
+ const { desc, arg } = getDesc(args);
178
+ desc ? console.trace(desc, ...arg) : console.trace(...args);
162
179
  };
163
- /**
164
- * 获取模块文件名称
165
- * esm: import.meta.url or cjs: __filename
166
- * @param {string} file
167
- * @returns
168
- */ function name(file) {
169
- // import.meta.url: 'file:///D:/prj/wiajs/req/test/log.t.js'
170
- // file = fileURLToPath(file) // fileUrl 转成路径
171
- // const baseName = path.basename(file)
172
- // return baseName.replace(path.extname(baseName), '')
173
- return '';
174
- }
175
- export { name, log }; // export default log;
176
- // export { log, Log };
180
+ export default log;
package/lib/node.js CHANGED
@@ -23,17 +23,17 @@ import debug from 'debug';
23
23
  */ constructor(opts){
24
24
  let { env } = opts;
25
25
  env = env ?? '';
26
- const ds = {} // debugs
26
+ const dgs = {} // debugs
27
27
  ;
28
- ds.debug = debug(`${env}`);
29
- ds.info = debug(`${env}:info`);
30
- ds.err = debug(`${env}:err`);
31
- ds.warn = debug(`${env}:warn`);
28
+ dgs.debug = debug(`${env}`);
29
+ dgs.info = debug(`${env}:info`);
30
+ dgs.err = debug(`${env}:err`);
31
+ dgs.warn = debug(`${env}:warn`);
32
32
  // 仅最后调用生效,覆盖环境变量
33
- if (ds.debug.enabled) debug.enable('*');
34
- else if (ds.info.enabled) debug.enable(`${env}:info,${env}:err,${env}:warn`);
33
+ if (dgs.debug.enabled) debug.enable('*');
34
+ else if (dgs.info.enabled) debug.enable(`${env}:info,${env}:err,${env}:warn`);
35
35
  else debug.enable(`${env}:err,${env}:warn`);
36
- this.ds = ds;
36
+ this.dgs = dgs;
37
37
  }
38
38
  /**
39
39
  *
@@ -42,9 +42,9 @@ import debug from 'debug';
42
42
  const first = args?.at(0);
43
43
  const last = args?.at(-1);
44
44
  if (typeof first === 'string') {
45
- args[0] = `${first}`;
46
- this.ds.debug(...args);
47
- } else if (typeof first === 'object' && typeof last === 'string') this.ds.debug(`${last}:%O`, first);
45
+ args.shift();
46
+ this.dgs.debug(first, ...args);
47
+ } else if (typeof first === 'object' && typeof last === 'string') this.dgs.debug(`${last}:%O`, first);
48
48
  // args[0] = `${this.pre}:${args[0]}`
49
49
  // console.debug(...args)
50
50
  // console.debug(this.pre, ...args)
@@ -56,9 +56,9 @@ import debug from 'debug';
56
56
  const first = args?.at(0);
57
57
  const last = args?.at(-1);
58
58
  if (typeof first === 'string') {
59
- args[0] = ` ${first}`;
60
- this.ds.err(...args);
61
- } else if (typeof first === 'object' && typeof last === 'string') this.ds.err(` ${last}:%O`, first);
59
+ args.shift();
60
+ this.dgs.err(` ${first}`, ...args);
61
+ } else if (typeof first === 'object' && typeof last === 'string') this.dgs.err(` ${last}:%O`, first);
62
62
  }
63
63
  /**
64
64
  *
@@ -79,8 +79,10 @@ import debug from 'debug';
79
79
  */ warn(...args) {
80
80
  const first = args?.at(0);
81
81
  const last = args?.at(-1);
82
- if (typeof first === 'string') this.ds.warn(...args);
83
- else if (typeof first === 'object' && typeof last === 'string') this.ds.warn(`${last}:%O`, first);
82
+ if (typeof first === 'string') {
83
+ args.shift();
84
+ this.dgs.warn(first, ...args);
85
+ } else if (typeof first === 'object' && typeof last === 'string') this.dgs.warn(`${last}:%O`, first);
84
86
  }
85
87
  /**
86
88
  *
@@ -88,8 +90,12 @@ import debug from 'debug';
88
90
  */ info(...args) {
89
91
  const first = args?.at(0);
90
92
  const last = args?.at(-1);
91
- if (typeof first === 'string') this.ds.info(...args);
92
- else if (typeof first === 'object' && typeof last === 'string') this.ds.info(`${last}:%O`, first);
93
+ // const dg = debug('ab')
94
+ // dg()
95
+ if (typeof first === 'string') {
96
+ args.shift();
97
+ this.dgs.info(first, ...args);
98
+ } else if (typeof first === 'object' && typeof last === 'string') this.dgs.info(`${last}:%O`, first);
93
99
  }
94
100
  }
95
101
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wiajs/log",
3
3
  "description": "Lightweight debugging utility for Node.js and the browser",
4
- "version": "4.3.15",
4
+ "version": "4.3.17",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "types": "./types/log.d.ts",
@@ -0,0 +1,18 @@
1
+ export default log;
2
+ declare function log(...args: any[]): {
3
+ (...args2: any): void;
4
+ debug: (...args: any[]) => void;
5
+ info: (...args: any[]) => void;
6
+ warn: (...args: any[]) => void;
7
+ trace: (...args: any[]) => void;
8
+ error: (...args: any[]) => void;
9
+ err: (...args: any[]) => void;
10
+ };
11
+ declare namespace log {
12
+ function err(...args: any[]): void;
13
+ function error(...args: any[]): void;
14
+ function warn(...args: any[]): void;
15
+ function info(...args: any[]): void;
16
+ function debug(...args: any[]): void;
17
+ function trace(...args: any[]): void;
18
+ }