@@ -2306,30 +2306,25 @@ logging level:
2306
2306
// Full version, logging a value.
2307
2307
log(core::error, ~"file not found: " + filename);
2308
2308
2309
- // Log-level abbreviated, since core::* is imported by default.
2309
+ // Log-level abbreviated, since core::* is used by default.
2310
2310
log(error, ~"file not found: " + filename);
2311
2311
2312
- // Formatting the message using a format-string and # fmt
2312
+ // Formatting the message using a format-string and fmt!
2313
2313
log(error, fmt!("file not found: %s", filename));
2314
2314
2315
- // Using the # error macro, that expands to the previous call.
2315
+ // Using the error! macro, that expands to the previous call.
2316
2316
error!("file not found: %s", filename);
2317
2317
~~~~
2318
2318
2319
- A ` log ` expression is * not evaluated* when logging at the specified
2320
- logging-level, module or task is disabled at runtime. This makes inactive
2321
- ` log ` expressions very cheap; they should be used extensively in Rust
2322
- code, as diagnostic aids, as they add little overhead beyond a single
2323
- integer-compare and branch at runtime.
2324
-
2325
- Logging is presently implemented as a language built-in feature, as it makes
2326
- use of compiler-provided logic for allocating the associated per-module
2327
- logging-control structures visible to the runtime, and lazily evaluating
2328
- arguments. In the future, as more of the supporting compiler-provided logic is
2329
- moved into libraries, logging is likely to move to a component of the core
2330
- library. It is best to use the macro forms of logging (* #error* ,
2331
- * #debug* , etc.) to minimize disruption to code using the logging facility
2332
- when it is changed.
2319
+ A ` log ` expression is * not evaluated* when logging at the specified logging-level, module or task is disabled at runtime.
2320
+ This makes inactive ` log ` expressions very cheap;
2321
+ they should be used extensively in Rust code, as diagnostic aids,
2322
+ as they add little overhead beyond a single integer-compare and branch at runtime.
2323
+
2324
+ Logging is presently implemented as a language built-in feature,
2325
+ as it makes use of compiler-provided, per-module data tables and flags.
2326
+ In the future, logging will move into a library, and will no longer be a core expression type.
2327
+ It is therefore recommended to use the macro forms of logging (` error! ` , ` debug! ` , etc.) to minimize disruption in code that uses logging.
2333
2328
2334
2329
2335
2330
### Assert expressions
0 commit comments