This commit is contained in:
Jarred Sumner
2021-05-30 15:42:47 -07:00
parent 4a3b4953ee
commit 1d3588ef5a
3 changed files with 10 additions and 6 deletions

View File

@@ -634,7 +634,7 @@ pub const Bundler = struct {
// }
if (enableTracing) {
Output.print(
Output.printError(
"\n---Tracing---\nResolve time: {d}\nParsing time: {d}\n---Tracing--\n\n",
.{
bundler.resolver.elapsed,

View File

@@ -391,10 +391,10 @@ pub const Cli = struct {
}
if (isDebug) {
Output.println("Expr count: {d}", .{js_ast.Expr.icount});
Output.println("Stmt count: {d}", .{js_ast.Stmt.icount});
Output.println("Binding count: {d}", .{js_ast.Binding.icount});
Output.println("File Descriptors: {d} / {d}", .{
Output.errorLn("Expr count: {d}", .{js_ast.Expr.icount});
Output.errorLn("Stmt count: {d}", .{js_ast.Stmt.icount});
Output.errorLn("Binding count: {d}", .{js_ast.Binding.icount});
Output.errorLn("File Descriptors: {d} / {d}", .{
fs.FileSystem.max_fd,
open_file_limit,
});
@@ -424,7 +424,7 @@ pub const Cli = struct {
if (did_write and duration < @as(i128, @as(i128, std.time.ns_per_s) * @as(i128, 2))) {
var elapsed = @divTrunc(duration, @as(i128, std.time.ns_per_ms));
try writer.print("\nCompleted in {d}ms", .{elapsed});
try err_writer.print("\nCompleted in {d}ms", .{elapsed});
}
std.os.exit(0);

View File

@@ -111,6 +111,10 @@ pub const Output = struct {
return printError(fmt, args);
}
pub fn errorLn(comptime fmt: string, args: anytype) void {
return printErrorln(fmt, args);
}
pub fn printError(comptime fmt: string, args: anytype) void {
if (isWasm) {
source.error_stream.seekTo(0) catch return;