Merge pull request #245 from rhysd/error-msg-newlines

Add missing \n in error message output to stderr
This commit is contained in:
Auguste Rame 2021-03-12 14:21:25 -05:00 committed by GitHub
commit d5c46aef26
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ pub fn log(
defer arena.deinit(); defer arena.deinit();
var message = std.fmt.allocPrint(&arena.allocator, "[{s}-{s}] " ++ format, .{ @tagName(message_level), @tagName(scope) } ++ args) catch |err| { var message = std.fmt.allocPrint(&arena.allocator, "[{s}-{s}] " ++ format, .{ @tagName(message_level), @tagName(scope) } ++ args) catch |err| {
std.debug.print("Failed to allocPrint message.", .{}); std.debug.print("Failed to allocPrint message.\n", .{});
return; return;
}; };
@ -66,7 +66,7 @@ pub fn log(
}, },
}, },
}) catch |err| { }) catch |err| {
std.debug.print("Failed to send show message notification (error: {}).", .{err}); std.debug.print("Failed to send show message notification (error: {}).\n", .{err});
}; };
} else { } else {
const message_type: types.MessageType = if (message_level == .debug) const message_type: types.MessageType = if (message_level == .debug)
@ -83,7 +83,7 @@ pub fn log(
}, },
}, },
}) catch |err| { }) catch |err| {
std.debug.print("Failed to send show message notification (error: {}).", .{err}); std.debug.print("Failed to send show message notification (error: {}).\n", .{err});
}; };
} }
} }
@ -1599,9 +1599,9 @@ pub fn main() anyerror!void {
defer allocator.free(arg); defer allocator.free(arg);
if (std.mem.eql(u8, arg, "--debug-log")) { if (std.mem.eql(u8, arg, "--debug-log")) {
actual_log_level = .debug; actual_log_level = .debug;
std.debug.print("Enabled debug logging", .{}); std.debug.print("Enabled debug logging\n", .{});
} else { } else {
std.debug.print("Unrecognized argument {s}", .{arg}); std.debug.print("Unrecognized argument {s}\n", .{arg});
std.os.exit(1); std.os.exit(1);
} }
} }