authorgravatar for heidezomp@protonmail.comheidezomp <heidezomp@protonmail.com> 2020-08-12 15:54:21+02:00
committergravatar for heidezomp@protonmail.comheidezomp <heidezomp@protonmail.com> 2020-08-12 15:54:21+02:00
logbf2ed0f571736241151a358b2533d45cb769db68
treeed21b8fb7fafaecf3cbd7db4ca91cda20dc0cb5d
parent25607079f0f405d09202378d7435a59a7a96d649

std.log: don't state in docs that messages are logged to stderr

Since the logger implementation can be overridden, the messages might not be logged to stderr at all.

1 files changed, 16 insertions(+), 16 deletions(-)

lib/std/log.zig+16-16
...@@ -129,7 +129,7 @@ fn log(...@@ -129,7 +129,7 @@ fn log(
129 }129 }
130}130}
131131
132/// Log an emergency message to stderr. This log level is intended to be used132/// Log an emergency message. This log level is intended to be used
133/// for conditions that cannot be handled and is usually followed by a panic.133/// for conditions that cannot be handled and is usually followed by a panic.
134pub fn emerg(134pub fn emerg(
135 comptime scope: @Type(.EnumLiteral),135 comptime scope: @Type(.EnumLiteral),
...@@ -140,7 +140,7 @@ pub fn emerg(...@@ -140,7 +140,7 @@ pub fn emerg(
140 log(.emerg, scope, format, args);140 log(.emerg, scope, format, args);
141}141}
142142
143/// Log an alert message to stderr. This log level is intended to be used for143/// Log an alert message. This log level is intended to be used for
144/// conditions that should be corrected immediately (e.g. database corruption).144/// conditions that should be corrected immediately (e.g. database corruption).
145pub fn alert(145pub fn alert(
146 comptime scope: @Type(.EnumLiteral),146 comptime scope: @Type(.EnumLiteral),
...@@ -151,7 +151,7 @@ pub fn alert(...@@ -151,7 +151,7 @@ pub fn alert(
151 log(.alert, scope, format, args);151 log(.alert, scope, format, args);
152}152}
153153
154/// Log a critical message to stderr. This log level is intended to be used154/// Log a critical message. This log level is intended to be used
155/// when a bug has been detected or something has gone wrong and it will have155/// when a bug has been detected or something has gone wrong and it will have
156/// an effect on the operation of the program.156/// an effect on the operation of the program.
157pub fn crit(157pub fn crit(
...@@ -163,7 +163,7 @@ pub fn crit(...@@ -163,7 +163,7 @@ pub fn crit(
163 log(.crit, scope, format, args);163 log(.crit, scope, format, args);
164}164}
165165
166/// Log an error message to stderr. This log level is intended to be used when166/// Log an error message. This log level is intended to be used when
167/// a bug has been detected or something has gone wrong but it is recoverable.167/// a bug has been detected or something has gone wrong but it is recoverable.
168pub fn err(168pub fn err(
169 comptime scope: @Type(.EnumLiteral),169 comptime scope: @Type(.EnumLiteral),
...@@ -174,7 +174,7 @@ pub fn err(...@@ -174,7 +174,7 @@ pub fn err(
174 log(.err, scope, format, args);174 log(.err, scope, format, args);
175}175}
176176
177/// Log a warning message to stderr. This log level is intended to be used if177/// Log a warning message. This log level is intended to be used if
178/// it is uncertain whether something has gone wrong or not, but the178/// it is uncertain whether something has gone wrong or not, but the
179/// circumstances would be worth investigating.179/// circumstances would be worth investigating.
180pub fn warn(180pub fn warn(
...@@ -185,7 +185,7 @@ pub fn warn(...@@ -185,7 +185,7 @@ pub fn warn(
185 log(.warn, scope, format, args);185 log(.warn, scope, format, args);
186}186}
187187
188/// Log a notice message to stderr. This log level is intended to be used for188/// Log a notice message. This log level is intended to be used for
189/// non-error but significant conditions.189/// non-error but significant conditions.
190pub fn notice(190pub fn notice(
191 comptime scope: @Type(.EnumLiteral),191 comptime scope: @Type(.EnumLiteral),
...@@ -195,7 +195,7 @@ pub fn notice(...@@ -195,7 +195,7 @@ pub fn notice(
195 log(.notice, scope, format, args);195 log(.notice, scope, format, args);
196}196}
197197
198/// Log an info message to stderr. This log level is intended to be used for198/// Log an info message. This log level is intended to be used for
199/// general messages about the state of the program.199/// general messages about the state of the program.
200pub fn info(200pub fn info(
201 comptime scope: @Type(.EnumLiteral),201 comptime scope: @Type(.EnumLiteral),
...@@ -205,7 +205,7 @@ pub fn info(...@@ -205,7 +205,7 @@ pub fn info(
205 log(.info, scope, format, args);205 log(.info, scope, format, args);
206}206}
207207
208/// Log a debug message to stderr. This log level is intended to be used for208/// Log a debug message. This log level is intended to be used for
209/// messages which are only useful for debugging.209/// messages which are only useful for debugging.
210pub fn debug(210pub fn debug(
211 comptime scope: @Type(.EnumLiteral),211 comptime scope: @Type(.EnumLiteral),
...@@ -219,7 +219,7 @@ pub fn debug(...@@ -219,7 +219,7 @@ pub fn debug(
219/// provided here.219/// provided here.
220pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {220pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
221 return struct {221 return struct {
222 /// Log an emergency message to stderr. This log level is intended to be used222 /// Log an emergency message. This log level is intended to be used
223 /// for conditions that cannot be handled and is usually followed by a panic.223 /// for conditions that cannot be handled and is usually followed by a panic.
224 pub fn emerg(224 pub fn emerg(
225 comptime format: []const u8,225 comptime format: []const u8,
...@@ -229,7 +229,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -229,7 +229,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
229 log(.emerg, scope, format, args);229 log(.emerg, scope, format, args);
230 }230 }
231231
232 /// Log an alert message to stderr. This log level is intended to be used for232 /// Log an alert message. This log level is intended to be used for
233 /// conditions that should be corrected immediately (e.g. database corruption).233 /// conditions that should be corrected immediately (e.g. database corruption).
234 pub fn alert(234 pub fn alert(
235 comptime format: []const u8,235 comptime format: []const u8,
...@@ -239,7 +239,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -239,7 +239,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
239 log(.alert, scope, format, args);239 log(.alert, scope, format, args);
240 }240 }
241241
242 /// Log a critical message to stderr. This log level is intended to be used242 /// Log a critical message. This log level is intended to be used
243 /// when a bug has been detected or something has gone wrong and it will have243 /// when a bug has been detected or something has gone wrong and it will have
244 /// an effect on the operation of the program.244 /// an effect on the operation of the program.
245 pub fn crit(245 pub fn crit(
...@@ -250,7 +250,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -250,7 +250,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
250 log(.crit, scope, format, args);250 log(.crit, scope, format, args);
251 }251 }
252252
253 /// Log an error message to stderr. This log level is intended to be used when253 /// Log an error message. This log level is intended to be used when
254 /// a bug has been detected or something has gone wrong but it is recoverable.254 /// a bug has been detected or something has gone wrong but it is recoverable.
255 pub fn err(255 pub fn err(
256 comptime format: []const u8,256 comptime format: []const u8,
...@@ -260,7 +260,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -260,7 +260,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
260 log(.err, scope, format, args);260 log(.err, scope, format, args);
261 }261 }
262262
263 /// Log a warning message to stderr. This log level is intended to be used if263 /// Log a warning message. This log level is intended to be used if
264 /// it is uncertain whether something has gone wrong or not, but the264 /// it is uncertain whether something has gone wrong or not, but the
265 /// circumstances would be worth investigating.265 /// circumstances would be worth investigating.
266 pub fn warn(266 pub fn warn(
...@@ -270,7 +270,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -270,7 +270,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
270 log(.warn, scope, format, args);270 log(.warn, scope, format, args);
271 }271 }
272272
273 /// Log a notice message to stderr. This log level is intended to be used for273 /// Log a notice message. This log level is intended to be used for
274 /// non-error but significant conditions.274 /// non-error but significant conditions.
275 pub fn notice(275 pub fn notice(
276 comptime format: []const u8,276 comptime format: []const u8,
...@@ -279,7 +279,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -279,7 +279,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
279 log(.notice, scope, format, args);279 log(.notice, scope, format, args);
280 }280 }
281281
282 /// Log an info message to stderr. This log level is intended to be used for282 /// Log an info message. This log level is intended to be used for
283 /// general messages about the state of the program.283 /// general messages about the state of the program.
284 pub fn info(284 pub fn info(
285 comptime format: []const u8,285 comptime format: []const u8,
...@@ -288,7 +288,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {...@@ -288,7 +288,7 @@ pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
288 log(.info, scope, format, args);288 log(.info, scope, format, args);
289 }289 }
290290
291 /// Log a debug message to stderr. This log level is intended to be used for291 /// Log a debug message. This log level is intended to be used for
292 /// messages which are only useful for debugging.292 /// messages which are only useful for debugging.
293 pub fn debug(293 pub fn debug(
294 comptime format: []const u8,294 comptime format: []const u8,