socket-function 0.51.0 → 0.52.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket-function",
3
- "version": "0.51.0",
3
+ "version": "0.52.0",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
@@ -4,6 +4,7 @@ import { _setSocketContext } from "../SocketFunction";
4
4
  import { entries, isNode } from "./misc";
5
5
  import debugbreak from "debugbreak";
6
6
  import { measureWrap } from "./profiling/measure";
7
+ import { formatTime } from "./formatting/format";
7
8
 
8
9
  let classes: {
9
10
  [classGuid: string]: {
@@ -148,7 +149,7 @@ export const runClientHooks = measureWrap(async function runClientHooks(
148
149
  await hook(context);
149
150
  time = Date.now() - time;
150
151
  if (time > 100) {
151
- console.warn(`Slow client hook: ${JSON.stringify(hook.name || hook.toString().slice(0, 100))} took ${time}ms`);
152
+ console.warn(`Slow (${formatTime(time)}) client hook: ${JSON.stringify(hook.name || hook.toString().slice(0, 100))} for ${callType.classGuid}.${callType.functionName}(...)`);
152
153
  }
153
154
  // NOTE: See ClientHookContext.overrideResult for why we break here
154
155
  if ("overrideResult" in context) {