@akc42/server-utils 3.4.0 → 3.4.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/debug.js +5 -3
  2. package/package.json +1 -1
package/debug.js CHANGED
@@ -51,12 +51,14 @@ export function Debug (topic) {
51
51
  logLine += output;
52
52
  //eslint-disable-next-line no-console
53
53
  console.log(logLine);
54
- }
55
- cache.push(output);
54
+ }
55
+ const time = chalk.whiteBright(new Date().toISOtring().substring(11,23)); //store millisecond timing
56
+ cache.push(`${time} ${output}`);
56
57
  if (cache.length > cachelimit) cache.splice(0,cache.length - cachelimit); //prevent it getting too big
57
58
  }
58
59
  };
59
60
  export function dumpDebugCache() {
61
+ const time = chalk.whiteBright(new Date().toISOString());
60
62
  const output = chalk.white.bgBlue('Above are all the debug calls (most recent first) which lead up to, and then followed on from, the error above');
61
63
  cache.reverse();
62
64
  for(const line of cache) {
@@ -65,7 +67,7 @@ export function dumpDebugCache() {
65
67
  }
66
68
  cache.reverse();
67
69
  //eslint-disable-next-line no-console
68
- console.log(output);
70
+ console.log(`${time} - ${output}`);
69
71
  };
70
72
  export function setDebugConfig(con, limit = 50) {
71
73
  cachelimit = limit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akc42/server-utils",
3
- "version": "3.4.0",
3
+ "version": "3.4.1",
4
4
  "type": "module",
5
5
  "description": "A Set of Utilities to use on the Server Side of a Project",
6
6
  "main": "./utils.js",