@bgord/bun 1.4.10 → 1.4.12

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/bun",
3
- "version": "1.4.10",
3
+ "version": "1.4.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": "Bartosz Gordon",
@@ -10,19 +10,30 @@ export class LoggerWinstonLocalAdapter {
10
10
  constructor(private readonly config: LoggerWinstonLocalAdapterConfigType) {}
11
11
 
12
12
  create(level: LogLevelEnum): LoggerPort {
13
+ const coloredConsoleTransport = new winston.transports.Console({
14
+ format: winston.format.combine(
15
+ winston.format.colorize({ all: true }),
16
+ winston.format.printf((info) => {
17
+ const {
18
+ level,
19
+ message,
20
+ timestamp,
21
+ [Symbol.for("level")]: _level,
22
+ [Symbol.for("message")]: _message,
23
+ ...rest
24
+ } = info;
25
+
26
+ return JSON.stringify({ level, message, ...rest, timestamp }, null, 2);
27
+ }),
28
+ ),
29
+ });
30
+
13
31
  return new LoggerWinstonAdapter({
14
32
  app: this.config.app,
15
33
  environment: NodeEnvironmentEnum.local,
16
34
  level,
17
35
  redactor: this.config.redactor,
18
- transports: [
19
- new winston.transports.Console({
20
- format: winston.format.combine(
21
- winston.format.colorize({ all: true }),
22
- winston.format.prettyPrint(),
23
- ),
24
- }),
25
- ],
36
+ transports: [coloredConsoleTransport],
26
37
  formats: [],
27
38
  filePath: null,
28
39
  });