@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.
- package/package.json +1 -1
- package/src/logger.ts +3 -2
package/package.json
CHANGED
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}
|
|
131
|
+
warn(`${op} done`, { duration, op });
|
|
131
132
|
if (longOpRecord) {
|
|
132
133
|
longOpBuffer.push([op, duration]);
|
|
133
134
|
}
|
|
134
135
|
} else {
|
|
135
|
-
debug(`${op}
|
|
136
|
+
debug(`${op} done`, { duration, op });
|
|
136
137
|
}
|
|
137
138
|
}
|
|
138
139
|
|