p-api-log 0.0.1 → 0.0.2

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/dist/index.cjs CHANGED
@@ -35,6 +35,7 @@ __export(index_exports, {
35
35
  module.exports = __toCommonJS(index_exports);
36
36
  var import_winston = __toESM(require("winston"), 1);
37
37
  var import_winston_daily_rotate_file = require("winston-daily-rotate-file");
38
+ var import_path = __toESM(require("path"), 1);
38
39
  var WinstonLogger = class {
39
40
  constructor(config) {
40
41
  this.config = config;
@@ -52,7 +53,7 @@ var WinstonLogger = class {
52
53
  transports: [
53
54
  // info 日志
54
55
  new import_winston.transports.DailyRotateFile({
55
- dirname: config.logger_path,
56
+ dirname: import_path.default.join(config.logger_path, "info"),
56
57
  filename: "info-%DATE%.log",
57
58
  datePattern: "YYYY-MM-DD",
58
59
  maxSize: "20m",
@@ -60,7 +61,7 @@ var WinstonLogger = class {
60
61
  }),
61
62
  // error 日志
62
63
  new import_winston.transports.DailyRotateFile({
63
- dirname: config.logger_path,
64
+ dirname: import_path.default.join(config.logger_path, "error"),
64
65
  filename: "error-%DATE%.log",
65
66
  level: "error",
66
67
  datePattern: "YYYY-MM-DD",
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  // src/index.ts
2
2
  import winston, { format, transports } from "winston";
3
3
  import "winston-daily-rotate-file";
4
+ import path from "path";
4
5
  var WinstonLogger = class {
5
6
  constructor(config) {
6
7
  this.config = config;
@@ -18,7 +19,7 @@ var WinstonLogger = class {
18
19
  transports: [
19
20
  // info 日志
20
21
  new transports.DailyRotateFile({
21
- dirname: config.logger_path,
22
+ dirname: path.join(config.logger_path, "info"),
22
23
  filename: "info-%DATE%.log",
23
24
  datePattern: "YYYY-MM-DD",
24
25
  maxSize: "20m",
@@ -26,7 +27,7 @@ var WinstonLogger = class {
26
27
  }),
27
28
  // error 日志
28
29
  new transports.DailyRotateFile({
29
- dirname: config.logger_path,
30
+ dirname: path.join(config.logger_path, "error"),
30
31
  filename: "error-%DATE%.log",
31
32
  level: "error",
32
33
  datePattern: "YYYY-MM-DD",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "p-api-log",
4
- "version": "0.0.1",
4
+ "version": "0.0.2",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "files": [
@@ -21,6 +21,7 @@
21
21
  "license": "ISC",
22
22
  "description": "",
23
23
  "devDependencies": {
24
+ "@types/node": "^25.0.3",
24
25
  "javascript-obfuscator": "^4.1.1",
25
26
  "tsup": "^8.4.0",
26
27
  "typescript": "5.8.3"
@@ -29,4 +30,4 @@
29
30
  "winston": "^3.19.0",
30
31
  "winston-daily-rotate-file": "^5.0.0"
31
32
  }
32
- }
33
+ }