@onivoro/server-pino 22.0.5 → 22.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -12,22 +12,22 @@ function patchConsole(logger) {
12
12
  warn: console.warn,
13
13
  };
14
14
  console.debug = (...args) => {
15
- _console.debug(fmt(...args));
15
+ fmt(() => _console.debug(...args), ...args);
16
16
  };
17
17
  console.error = (...args) => {
18
- _console.error(fmt(...args));
18
+ fmt(() => _console.error(...args), ...args);
19
19
  };
20
20
  console.info = (...args) => {
21
- _console.info(fmt(...args));
21
+ fmt(() => _console.info(...args), ...args);
22
22
  };
23
23
  console.log = (...args) => {
24
- _console.info(fmt(...args)); // what should this be? which is higher level?
24
+ fmt(() => _console.info(...args), ...args);
25
25
  };
26
26
  console.trace = (...args) => {
27
- _console.trace(fmt(...args));
27
+ fmt(() => _console.trace(...args), ...args);
28
28
  };
29
29
  console.warn = (...args) => {
30
- _console.warn(fmt(...args));
30
+ fmt(() => _console.warn(...args), ...args);
31
31
  };
32
32
  return {
33
33
  _console,
@@ -37,7 +37,10 @@ function patchConsole(logger) {
37
37
  });
38
38
  }
39
39
  };
40
- }
41
- function fmt(...args) {
42
- return args?.length === 1 ? [{ "msg": args[0] }] : args;
40
+ function fmt(executor, ...args) {
41
+ _console.debug({ args });
42
+ return args?.length === 1
43
+ ? executor({ msg: args[0] })
44
+ : executor(...args);
45
+ }
43
46
  }
@@ -12,22 +12,22 @@ function patchConsole(logger) {
12
12
  warn: console.warn,
13
13
  };
14
14
  console.debug = (...args) => {
15
- _console.debug(fmt(...args));
15
+ fmt(() => _console.debug(...args), ...args);
16
16
  };
17
17
  console.error = (...args) => {
18
- _console.error(fmt(...args));
18
+ fmt(() => _console.error(...args), ...args);
19
19
  };
20
20
  console.info = (...args) => {
21
- _console.info(fmt(...args));
21
+ fmt(() => _console.info(...args), ...args);
22
22
  };
23
23
  console.log = (...args) => {
24
- _console.info(fmt(...args)); // what should this be? which is higher level?
24
+ fmt(() => _console.info(...args), ...args);
25
25
  };
26
26
  console.trace = (...args) => {
27
- _console.trace(fmt(...args));
27
+ fmt(() => _console.trace(...args), ...args);
28
28
  };
29
29
  console.warn = (...args) => {
30
- _console.warn(fmt(...args));
30
+ fmt(() => _console.warn(...args), ...args);
31
31
  };
32
32
  return {
33
33
  _console,
@@ -37,7 +37,10 @@ function patchConsole(logger) {
37
37
  });
38
38
  }
39
39
  };
40
- }
41
- function fmt(...args) {
42
- return args?.length === 1 ? [{ "msg": args[0] }] : args;
40
+ function fmt(executor, ...args) {
41
+ _console.debug({ args });
42
+ return args?.length === 1
43
+ ? executor({ msg: args[0] })
44
+ : executor(...args);
45
+ }
43
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-pino",
3
- "version": "22.0.5",
3
+ "version": "22.0.7",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/server-pino.git"
6
6
  },