@nocobase/logger 1.2.34-alpha → 1.2.35-alpha

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.
@@ -108,7 +108,7 @@ function child(defaultRequestMetadata) {
108
108
  const logger = this;
109
109
  return Object.create(logger, {
110
110
  write: {
111
- value: function(info) {
111
+ value: /* @__PURE__ */ __name(function(info) {
112
112
  const infoClone = Object.assign({}, defaultRequestMetadata, info);
113
113
  if (info instanceof Error) {
114
114
  infoClone.stack = info.stack;
@@ -116,7 +116,7 @@ function child(defaultRequestMetadata) {
116
116
  infoClone.cause = info.cause;
117
117
  }
118
118
  logger.write(infoClone);
119
- }
119
+ }, "value")
120
120
  }
121
121
  });
122
122
  }
package/lib/transports.js CHANGED
@@ -46,17 +46,17 @@ var import_config = require("./config");
46
46
  var import_path = __toESM(require("path"));
47
47
  var import_format = require("./format");
48
48
  const Transports = {
49
- console: (options) => new import_winston.default.transports.Console(options),
50
- file: (options) => new import_winston.default.transports.File({
49
+ console: /* @__PURE__ */ __name((options) => new import_winston.default.transports.Console(options), "console"),
50
+ file: /* @__PURE__ */ __name((options) => new import_winston.default.transports.File({
51
51
  maxsize: Number(process.env.LOGGER_MAX_SIZE) || 1024 * 1024 * 20,
52
52
  maxFiles: Number(process.env.LOGGER_MAX_FILES) || 10,
53
53
  ...options
54
- }),
55
- dailyRotateFile: (options) => new import_winston.default.transports.DailyRotateFile({
54
+ }), "file"),
55
+ dailyRotateFile: /* @__PURE__ */ __name((options) => new import_winston.default.transports.DailyRotateFile({
56
56
  maxSize: Number(process.env.LOGGER_MAX_SIZE),
57
57
  maxFiles: Number(process.env.LOGGER_MAX_FILES) || "14d",
58
58
  ...options
59
- })
59
+ }), "dailyRotateFile")
60
60
  };
61
61
  const getTransports = /* @__PURE__ */ __name((options) => {
62
62
  const { filename, format: _format, transports: _transports } = options;
@@ -72,19 +72,19 @@ const getTransports = /* @__PURE__ */ __name((options) => {
72
72
  (0, import_format.getFormat)(configFormat)
73
73
  );
74
74
  const transports = {
75
- console: () => Transports.console({
75
+ console: /* @__PURE__ */ __name(() => Transports.console({
76
76
  format: import_winston.default.format.combine(format)
77
- }),
78
- file: () => Transports.file({
77
+ }), "console"),
78
+ file: /* @__PURE__ */ __name(() => Transports.file({
79
79
  dirname,
80
80
  filename: filename.includes(".log") ? filename : `${filename}.log`,
81
81
  format
82
- }),
83
- dailyRotateFile: () => Transports.dailyRotateFile({
82
+ }), "file"),
83
+ dailyRotateFile: /* @__PURE__ */ __name(() => Transports.dailyRotateFile({
84
84
  dirname,
85
85
  filename: filename.includes("%DATE%") || filename.includes(".log") ? filename : `${filename}_%DATE%.log`,
86
86
  format
87
- })
87
+ }), "dailyRotateFile")
88
88
  };
89
89
  return (configTransports == null ? void 0 : configTransports.map((t) => typeof t === "string" ? transports[t]() : t)) || transports["console"]();
90
90
  }, "getTransports");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/logger",
3
- "version": "1.2.34-alpha",
3
+ "version": "1.2.35-alpha",
4
4
  "description": "nocobase logging library",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./lib/index.js",
@@ -18,5 +18,5 @@
18
18
  "winston-daily-rotate-file": "^5.0.0",
19
19
  "winston-transport": "^4.7.0"
20
20
  },
21
- "gitHead": "c62835e64106fcfb0b6554e75dac6c368276bcc2"
21
+ "gitHead": "37a4edc27153f9346b3b08c25a407fb57c78b68e"
22
22
  }