docta-package 1.2.116 → 1.2.117

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.
@@ -1,8 +1,4 @@
1
1
  "use strict";
2
- // import winston from "winston";
3
- // import "winston-daily-rotate-file";
4
- // import path from "path";
5
- // import fs from "fs";
6
2
  var __rest = (this && this.__rest) || function (s, e) {
7
3
  var t = {};
8
4
  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
@@ -19,62 +15,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
19
15
  };
20
16
  Object.defineProperty(exports, "__esModule", { value: true });
21
17
  exports.logger = void 0;
22
- // const errorLogDir = path.join(process.cwd(), "logs/error");
23
- // // ensure logs directory exists
24
- // if (!fs.existsSync(errorLogDir)) {
25
- // fs.mkdirSync(errorLogDir, { recursive: true });
26
- // }
27
- // /**
28
- // * ERROR → file
29
- // */
30
- // const errorTransport = new winston.transports.DailyRotateFile({
31
- // level: "error",
32
- // dirname: errorLogDir,
33
- // filename: "%DATE%.log",
34
- // datePattern: "YYYY-MM-DD",
35
- // maxSize: "20m",
36
- // maxFiles: "14d",
37
- // });
38
- // /**
39
- // * INFO → console with request information
40
- // */
41
- // const infoTransport = new winston.transports.Console({
42
- // level: "info",
43
- // format: winston.format.combine(
44
- // winston.format.colorize(),
45
- // winston.format.timestamp(),
46
- // winston.format.printf(
47
- // ({ timestamp, level, message, method, path, request_id, ...meta }) => {
48
- // let logMessage = `[${timestamp}] ${level}: ${message}`;
49
- // // Add request information if available
50
- // const requestInfo: string[] = [];
51
- // if (method) requestInfo.push(`method=${method}`);
52
- // if (path) requestInfo.push(`path=${path}`);
53
- // if (request_id) requestInfo.push(`request_id=${request_id}`);
54
- // if (requestInfo.length > 0) {
55
- // logMessage += ` | ${requestInfo.join(", ")}`;
56
- // }
57
- // // Add any remaining metadata
58
- // const remainingMeta = Object.keys(meta).filter(
59
- // (key) => key !== "timestamp"
60
- // );
61
- // if (remainingMeta.length > 0) {
62
- // const metaObj = remainingMeta.reduce(
63
- // (acc, key) => ({ ...acc, [key]: meta[key] }),
64
- // {}
65
- // );
66
- // logMessage += ` | meta=${JSON.stringify(metaObj)}`;
67
- // }
68
- // return logMessage;
69
- // }
70
- // )
71
- // ),
72
- // });
73
- // export const logger = winston.createLogger({
74
- // level: "info",
75
- // transports: [infoTransport, errorTransport],
76
- // });
77
- ///////YOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
78
18
  const winston_1 = __importDefault(require("winston"));
79
19
  require("winston-daily-rotate-file");
80
20
  const path_1 = __importDefault(require("path"));
@@ -109,7 +49,7 @@ const debugTransport = new winston_1.default.transports.DailyRotateFile({
109
49
  datePattern: "YYYY-MM-DD",
110
50
  maxSize: "20m",
111
51
  maxFiles: "7d",
112
- format: winston_1.default.format.combine(winston_1.default.format.colorize(), winston_1.default.format.timestamp(), winston_1.default.format((info) => (info.level === "debug" ? info : false))()),
52
+ format: winston_1.default.format.combine(winston_1.default.format((info) => (info.level === "debug" ? info : false))(), winston_1.default.format.timestamp(), winston_1.default.format.colorize()),
113
53
  });
114
54
  /**
115
55
  * CONSOLE → everything (CloudWatch)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "docta-package",
3
- "version": "1.2.116",
3
+ "version": "1.2.117",
4
4
  "description": "This package will contail all the required files to run the docta micro-service app",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",