@onivoro/server-pino 22.0.8 → 22.0.10

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,7 +12,7 @@ class ServerPinoConfig {
12
12
  useExisting;
13
13
  constructor(overrides) {
14
14
  const defaultValues = ServerPinoConfig.getDefaultParams();
15
- Object.entries(overrides || {}).forEach(([key, value]) => {
15
+ Object.entries({ ...defaultValues, ...(overrides || {}) }).forEach(([key, value]) => {
16
16
  this[key] = value;
17
17
  });
18
18
  }
@@ -12,22 +12,22 @@ function patchConsole(logger) {
12
12
  warn: console.warn,
13
13
  };
14
14
  console.debug = (...args) => {
15
- fmt(() => _console.debug(...args), ...args);
15
+ _console.debug({ msg: args });
16
16
  };
17
17
  console.error = (...args) => {
18
- fmt(() => _console.error(...args), ...args);
18
+ _console.error({ msg: args });
19
19
  };
20
20
  console.info = (...args) => {
21
- fmt(() => _console.info(...args), ...args);
21
+ _console.info({ msg: args });
22
22
  };
23
23
  console.log = (...args) => {
24
- fmt(() => _console.info(...args), ...args);
24
+ _console.info({ msg: args });
25
25
  };
26
26
  console.trace = (...args) => {
27
- fmt(() => _console.trace(...args), ...args);
27
+ _console.trace({ msg: args });
28
28
  };
29
29
  console.warn = (...args) => {
30
- fmt(() => _console.warn(...args), ...args);
30
+ _console.warn({ msg: args });
31
31
  };
32
32
  return {
33
33
  _console,
@@ -37,10 +37,4 @@ function patchConsole(logger) {
37
37
  });
38
38
  }
39
39
  };
40
- function fmt(executor, ...args) {
41
- process.stdout.write(JSON.stringify(args, null, 2));
42
- return args?.length === 1
43
- ? executor({ msg: args[0] })
44
- : executor(...args);
45
- }
46
40
  }
@@ -12,7 +12,7 @@ class ServerPinoConfig {
12
12
  useExisting;
13
13
  constructor(overrides) {
14
14
  const defaultValues = ServerPinoConfig.getDefaultParams();
15
- Object.entries(overrides || {}).forEach(([key, value]) => {
15
+ Object.entries({ ...defaultValues, ...(overrides || {}) }).forEach(([key, value]) => {
16
16
  this[key] = value;
17
17
  });
18
18
  }
@@ -12,22 +12,22 @@ function patchConsole(logger) {
12
12
  warn: console.warn,
13
13
  };
14
14
  console.debug = (...args) => {
15
- fmt(() => _console.debug(...args), ...args);
15
+ _console.debug({ msg: args });
16
16
  };
17
17
  console.error = (...args) => {
18
- fmt(() => _console.error(...args), ...args);
18
+ _console.error({ msg: args });
19
19
  };
20
20
  console.info = (...args) => {
21
- fmt(() => _console.info(...args), ...args);
21
+ _console.info({ msg: args });
22
22
  };
23
23
  console.log = (...args) => {
24
- fmt(() => _console.info(...args), ...args);
24
+ _console.info({ msg: args });
25
25
  };
26
26
  console.trace = (...args) => {
27
- fmt(() => _console.trace(...args), ...args);
27
+ _console.trace({ msg: args });
28
28
  };
29
29
  console.warn = (...args) => {
30
- fmt(() => _console.warn(...args), ...args);
30
+ _console.warn({ msg: args });
31
31
  };
32
32
  return {
33
33
  _console,
@@ -37,10 +37,4 @@ function patchConsole(logger) {
37
37
  });
38
38
  }
39
39
  };
40
- function fmt(executor, ...args) {
41
- process.stdout.write(JSON.stringify(args, null, 2));
42
- return args?.length === 1
43
- ? executor({ msg: args[0] })
44
- : executor(...args);
45
- }
46
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onivoro/server-pino",
3
- "version": "22.0.8",
3
+ "version": "22.0.10",
4
4
  "repository": {
5
5
  "url": "git+https://github.com/onivoro/server-pino.git"
6
6
  },