Skip to content

Commit

Permalink
test: log to use util.inspect
Browse files Browse the repository at this point in the history
  • Loading branch information
privatenumber committed Jun 4, 2024
1 parent e8bb062 commit 4ef6632
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/debug.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { inspect } from 'node:util';
import { writeSync } from 'node:fs';

export const log = (
...args: any[]
) => {
writeSync(1, `${JSON.stringify(args, null, 2)}\n\n`);
writeSync(1, `${inspect(args, { colors: true })}\n\n`);
};

export const time = <T extends (...args: any[]) => unknown>(
Expand Down

0 comments on commit 4ef6632

Please sign in to comment.