/** 带序号的轨迹打印,用来看「什么时候被调用了」 */ let seq = 0; export const resetTrace = (): void => { seq = 0; }; export const t = (who: string, what: string, extra?: unknown): void => { seq += 1; const tail = extra === undefined ? '' : ` ${JSON.stringify(extra)}`; console.log(` #${String(seq).padStart(2, '0')} ${who.padEnd(26)} ${what}${tail}`); };