mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-26 16:41:49 +00:00
23 lines
617 B
TypeScript
23 lines
617 B
TypeScript
import crypto from "node:crypto";
|
|
import path from "node:path";
|
|
import { createSuiteTempRootTracker } from "../test-helpers/temp-dir.js";
|
|
|
|
export function createSuiteLogPathTracker(prefix: string) {
|
|
const rootTracker = createSuiteTempRootTracker({ prefix });
|
|
let logRoot = "";
|
|
|
|
return {
|
|
async setup(): Promise<void> {
|
|
await rootTracker.setup();
|
|
logRoot = await rootTracker.make("case");
|
|
},
|
|
nextPath(): string {
|
|
return path.join(logRoot, `${crypto.randomUUID()}.log`);
|
|
},
|
|
async cleanup(): Promise<void> {
|
|
await rootTracker.cleanup();
|
|
logRoot = "";
|
|
},
|
|
};
|
|
}
|