Skip to content

Commit 895c4a9

Browse files
committed
Better type of print and remove debug traces.
1 parent b3fcdea commit 895c4a9

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
@@ -38,10 +38,8 @@ import { printVersionMessage } from "./version.js";
3838

3939
export async function main(
4040
cliArguments: string[],
41-
print: (message?: any, ...optionalParams: any[]) => void = console.log,
41+
print: (message: string) => void = console.log,
4242
): Promise<void> {
43-
const hreInitStart = performance.now();
44-
4543
const usedCliArguments: boolean[] = new Array(cliArguments.length).fill(
4644
false,
4745
);
@@ -91,11 +89,6 @@ export async function main(
9189
},
9290
);
9391

94-
const hreInitEnd = performance.now();
95-
print("Time to initialize the HRE (ms):", hreInitEnd - hreInitStart);
96-
97-
const taskParsingStart = performance.now();
98-
9992
const taskOrId = parseTask(cliArguments, usedCliArguments, hre);
10093

10194
if (Array.isArray(taskOrId)) {
@@ -127,17 +120,7 @@ export async function main(
127120
task,
128121
);
129122

130-
const taskParsingEnd = performance.now();
131-
132-
print("Time to parse the task (ms):", taskParsingEnd - taskParsingStart);
133-
134-
const taskRunningStart = performance.now();
135-
136123
await task.run(taskArguments);
137-
138-
const taskRunningEnd = performance.now();
139-
140-
print("Time to run the task (ms):", taskRunningEnd - taskRunningStart);
141124
} catch (error) {
142125
process.exitCode = 1;
143126

@@ -148,7 +131,7 @@ export async function main(
148131

149132
// TODO: Print the errors nicely, especially `HardhatError`s.
150133

151-
print("Error running the task:", error.message);
134+
print(`Error running the task: ${error.message}`);
152135

153136
if (hardhatSpecialArgs.showStackTraces) {
154137
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)