@oh-my-pi/pi-utils 12.18.0 → 12.18.3

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/package.json +1 -1
  2. package/src/logger.ts +3 -2
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@oh-my-pi/pi-utils",
4
- "version": "12.18.0",
4
+ "version": "12.18.3",
5
5
  "description": "Shared utilities for pi packages",
6
6
  "homepage": "https://github.com/can1357/oh-my-pi",
7
7
  "author": "Can Bölük",
package/src/logger.ts CHANGED
@@ -126,13 +126,14 @@ const longOpBuffer = new RingBuffer<[op: string, duration: number]>(1000);
126
126
  let longOpRecord = false;
127
127
 
128
128
  function logTiming(op: string, duration: number): void {
129
+ duration = Math.round(duration * 100) / 100;
129
130
  if (duration > LOGGED_TIMING_THRESHOLD_MS) {
130
- warn(`${op} took ${duration}ms`, { duration, op });
131
+ warn(`${op} done`, { duration, op });
131
132
  if (longOpRecord) {
132
133
  longOpBuffer.push([op, duration]);
133
134
  }
134
135
  } else {
135
- debug(`${op} took ${duration}ms`, { duration, op });
136
+ debug(`${op} done`, { duration, op });
136
137
  }
137
138
  }
138
139