Add std.debug.print for "printf debugging"

master
Isaac Freund 2020-06-02 19:22:22 +02:00
parent 8e5393a779
commit c3e0224792
No known key found for this signature in database
GPG Key ID: 86DED400DDFD7A11
1 changed files with 7 additions and 2 deletions

View File

@ -52,8 +52,13 @@ pub const LineInfo = struct {
var stderr_mutex = std.Mutex.init();
/// Deprecated. Use `std.log` functions for logging.
pub fn warn(comptime fmt: []const u8, args: var) void {
/// Deprecated. Use `std.log` functions for logging or `std.debug.print` for
/// "printf debugging".
pub const warn = print;
/// Print to stderr, unbuffered, and silently returning on failure. Intended
/// for use in "printf debugging." Use `std.log` functions for proper logging.
pub fn print(comptime fmt: []const u8, args: var) void {
const held = stderr_mutex.acquire();
defer held.release();
const stderr = io.getStdErr().writer();