Skip to content

Commit 01c2e6f

Browse files
committed
Better type of print and remove debug traces.
1 parent d3cb5d9 commit 01c2e6f

File tree

2 files changed

+3
-20
lines changed

2 files changed

+3
-20
lines changed

v-next/hardhat/src/internal/cli/main.ts

+2-19
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ import { printVersionMessage } from "./version.js";
3737

3838
export async function main(
3939
cliArguments: string[],
40-
print: (message?: any, ...optionalParams: any[]) => void = console.log,
40+
print: (message: string) => void = console.log,
4141
): Promise<void> {
42-
const hreInitStart = performance.now();
43-
4442
const usedCliArguments: boolean[] = new Array(cliArguments.length).fill(
4543
false,
4644
);
@@ -87,11 +85,6 @@ export async function main(
8785
},
8886
);
8987

90-
const hreInitEnd = performance.now();
91-
print("Time to initialize the HRE (ms):", hreInitEnd - hreInitStart);
92-
93-
const taskParsingStart = performance.now();
94-
9588
const taskOrId = parseTask(cliArguments, usedCliArguments, hre);
9689

9790
if (Array.isArray(taskOrId)) {
@@ -123,17 +116,7 @@ export async function main(
123116
task,
124117
);
125118

126-
const taskParsingEnd = performance.now();
127-
128-
print("Time to parse the task (ms):", taskParsingEnd - taskParsingStart);
129-
130-
const taskRunningStart = performance.now();
131-
132119
await task.run(taskArguments);
133-
134-
const taskRunningEnd = performance.now();
135-
136-
print("Time to run the task (ms):", taskRunningEnd - taskRunningStart);
137120
} catch (error) {
138121
process.exitCode = 1;
139122

@@ -144,7 +127,7 @@ export async function main(
144127

145128
// TODO: Print the errors nicely, especially `HardhatError`s.
146129

147-
print("Error running the task:", error.message);
130+
print(`Error running the task: ${error.message}`);
148131

149132
if (hardhatSpecialArgs.showStackTraces) {
150133
print("");
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { getHardhatVersion } from "../utils/package.js";
22

33
export async function printVersionMessage(
4-
print: (message?: any, ...optionalParams: any[]) => void = console.log,
4+
print: (message: string) => void = console.log,
55
): Promise<void> {
66
print(await getHardhatVersion());
77
}

0 commit comments

Comments
 (0)