xcraft-core-utils 4.21.2 → 4.22.1

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.
Files changed (2) hide show
  1. package/lib/log.js +4 -2
  2. package/package.json +1 -1
package/lib/log.js CHANGED
@@ -53,9 +53,11 @@ exports.decorate = function (mode, prefix, mod, log, maxWidth, stripBegin) {
53
53
 
54
54
  var len = exports.computeIndent(prefix, mod);
55
55
  var spaces = mode.length < 4 ? ' ' : ' ';
56
+ const localTime = new Date().toLocaleTimeString().slice(0, 5);
56
57
  var begin = util.format(
57
- '%s [%s%s] %s:%s',
58
+ '%s %s [%s%s] %s:%s',
58
59
  colors.white(prefix),
60
+ localTime,
59
61
  colors.whiteBright(colors.bold(mod)),
60
62
  new Array(len + 1).join(colors.blackBright('.')),
61
63
  colored[mode](xUtils.string.capitalize(mode)),
@@ -71,7 +73,7 @@ exports.decorate = function (mode, prefix, mod, log, maxWidth, stripBegin) {
71
73
 
72
74
  let beginEmbedded = '';
73
75
  let textNoColor = text.replace(ansiRegex(), '');
74
- const embedded = /^[a-zA-Z]+ \[[a-zA-Z/.\-_]+\] (?:Verb|Info|Warn|Err|Dbg):/.test(
76
+ const embedded = /^[a-zA-Z]+ [0-9:]+ \[[a-zA-Z/.\-_]+\] (?:Verb|Info|Warn|Err|Dbg):/.test(
75
77
  textNoColor
76
78
  );
77
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xcraft-core-utils",
3
- "version": "4.21.2",
3
+ "version": "4.22.1",
4
4
  "description": "Xcraft utils",
5
5
  "main": "index.js",
6
6
  "engines": {