logxpert 1.0.3 → 1.0.4-0
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/main.js +4 -2
- package/package.json +2 -2
package/main.js
CHANGED
|
@@ -16,13 +16,15 @@ require('winston-daily-rotate-file');
|
|
|
16
16
|
* Might output: "This is the date: [2025-03-21 15:30:45] - "
|
|
17
17
|
*/
|
|
18
18
|
function formatCustomTimestamp(fmt) {
|
|
19
|
-
//
|
|
19
|
+
// Replace square brackets with temporary placeholders that won't interfere with Moment.js formatting
|
|
20
20
|
const temp = fmt.replace(/\[/g, '%%LB%%').replace(/\]/g, '%%RB%%');
|
|
21
|
+
// Format the timestamp using Moment.js
|
|
21
22
|
const formatted = moment().format(temp);
|
|
22
|
-
//
|
|
23
|
+
// Replace the placeholders back with the square brackets
|
|
23
24
|
return formatted.replace(/%%LB%%/g, '[').replace(/%%RB%%/g, ']');
|
|
24
25
|
}
|
|
25
26
|
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* @typedef {Object} ConsoleOptions
|
|
28
30
|
* @property {boolean} [enableTimestamp=true] - Enable or disable timestamp in console logs.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "logxpert",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4-0",
|
|
4
4
|
"description": "A powerful logging library for Node.js",
|
|
5
5
|
"main": "main.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
"winston": "^3.17.0",
|
|
15
15
|
"winston-daily-rotate-file": "^5.0.0"
|
|
16
16
|
}
|
|
17
|
-
}
|
|
17
|
+
}
|