pub fn scoped(comptime scope: @EnumLiteral()) type pub fn err(comptime format: []const u8, args: anytype) voidLog an error message. This log level is intended to be used when something has gone wrong. This might be recoverable or might be followed by the program exiting.
pub fn warn(comptime format: []const u8, args: anytype) voidLog a warning message. This log level is intended to be used if it is uncertain whether something has gone wrong or not, but the circumstances would be worth investigating.
pub fn info(comptime format: []const u8, args: anytype) voidLog an info message. This log level is intended to be used for general messages about the state of the program.
pub fn debug(comptime format: []const u8, args: anytype) voidLog a debug message. This log level is intended to be used for messages which are only useful for debugging.
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178pub fn scoped(comptime scope: @EnumLiteral()) type {
return struct {
/// Log an error message. This log level is intended to be used
/// when something has gone wrong. This might be recoverable or might
/// be followed by the program exiting.
pub fn err(
comptime format: []const u8,
args: anytype,
) void {
@branchHint(.cold);
log(.err, scope, format, args);
}
/// Log a warning message. This log level is intended to be used if
/// it is uncertain whether something has gone wrong or not, but the
/// circumstances would be worth investigating.
pub fn warn(
comptime format: []const u8,
args: anytype,
) void {
log(.warn, scope, format, args);
}
/// Log an info message. This log level is intended to be used for
/// general messages about the state of the program.
pub fn info(
comptime format: []const u8,
args: anytype,
) void {
log(.info, scope, format, args);
}
/// Log a debug message. This log level is intended to be used for
/// messages which are only useful for debugging.
pub fn debug(
comptime format: []const u8,
args: anytype,
) void {
log(.debug, scope, format, args);
}
};
}
Returns a scoped logging namespace that logs all messages using the scope provided here.