Skip to content

Commit

Permalink
test: simplify fixture log files
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-hm committed Aug 19, 2024
1 parent df54051 commit 8945cf8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/fixture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
},
"dependencies": {
"@types/debug": "^4.1.12",
"date-fns": "^3.6.0",
"debug": "^4.3.5",
"dotenv": "^16.4.5",
"execa": "^9.3.0",
Expand Down
8 changes: 5 additions & 3 deletions packages/fixture/src/logging.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import debug from "debug";
import { format } from "date-fns";
import fs from "node:fs";
import path from "node:path";

debug.enable("nillion:*");
export const Log = debug("nillion:fixture");
Log.log = console.log.bind(console);

const formattedDate = format(new Date(), "yyyy-MM-dd_HH-mm-ss");
export const LOG_RUN_DIR = path.resolve(`./logs/${formattedDate}`);
export const LOG_RUN_DIR = path.resolve("./logs");

export const setupLoggingDir = () => {
fs.mkdirSync(LOG_RUN_DIR, { recursive: true });

const runTimestamp = new Date().toISOString();
fs.writeFileSync(`${LOG_RUN_DIR}/timestamp.log`, runTimestamp);

fs.writeFileSync(getDevnetLogFile(), "");
fs.writeFileSync(getTestLogFile(), "");
fs.writeFileSync(getPrepareProgramsLogFile(), "");
Expand Down

0 comments on commit 8945cf8

Please sign in to comment.