From 1d3588ef5a3677311f405c8112bc5c57be134f03 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 30 May 2021 15:42:47 -0700 Subject: [PATCH] stderr --- src/bundler.zig | 2 +- src/cli.zig | 10 +++++----- src/global.zig | 4 ++++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/bundler.zig b/src/bundler.zig index 5b92af3f9a..13a28edd48 100644 --- a/src/bundler.zig +++ b/src/bundler.zig @@ -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, diff --git a/src/cli.zig b/src/cli.zig index 572e544602..de0be93e27 100644 --- a/src/cli.zig +++ b/src/cli.zig @@ -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); diff --git a/src/global.zig b/src/global.zig index 0009e1a4cb..821f09b5fd 100644 --- a/src/global.zig +++ b/src/global.zig @@ -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;