mirror of
https://mzte.de/git/LordMZTE/dotfiles.git
synced 2024-11-11 20:43:00 +01:00
21 lines
783 B
Zig
21 lines
783 B
Zig
const std = @import("std");
|
|
const at = @import("ansi-term");
|
|
|
|
const util = @import("util.zig");
|
|
|
|
pub fn msg(comptime fmt: []const u8, args: anytype) !void {
|
|
const writer = std.io.getStdErr().writer();
|
|
var style: ?at.style.Style = null;
|
|
|
|
try util.updateStyle(writer, &style, .{ .font_style = .{ .bold = true } });
|
|
try writer.writeByte('[');
|
|
try util.updateStyle(writer, &style, .{ .font_style = .{ .bold = true }, .foreground = .Red });
|
|
try writer.writeAll(" MZTEINIT ");
|
|
try util.updateStyle(writer, &style, .{ .font_style = .{ .bold = true } });
|
|
try writer.writeByte(']');
|
|
try util.updateStyle(writer, &style, .{ .foreground = .Cyan });
|
|
|
|
try std.fmt.format(writer, " " ++ fmt ++ "\n", args);
|
|
|
|
try util.updateStyle(writer, &style, .{});
|
|
}
|