diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2020-06-18 21:40:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-06-18 21:40:06 -0400 |
| commit | 0d18eda1d6e5ae6d4eb544b37ecd888e3bf41c2b (patch) | |
| tree | 62be437c046b39e943f808805c9e993c03cdd237 /lib/std/debug.zig | |
| parent | c70633eacdf4e17cfafe0ab44f4ea83323b6d7a3 (diff) | |
| parent | c3e0224792510e69763dbc6ba68794f9134925f2 (diff) | |
| download | zig-0d18eda1d6e5ae6d4eb544b37ecd888e3bf41c2b.tar.gz zig-0d18eda1d6e5ae6d4eb544b37ecd888e3bf41c2b.zip | |
Merge pull request #5348 from ifreund/std-log
Introduce std.log
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 591f2d1a80..92b79be35c 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -52,9 +52,13 @@ pub const LineInfo = struct { var stderr_mutex = std.Mutex.init(); -/// Tries to write to stderr, unbuffered, and ignores any error returned. -/// Does not append a newline. -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(); |
