Skip to content

Commit 396b6e5

Browse files
committed
---
yaml --- r: 24467 b: refs/heads/master c: 0dd4b42 h: refs/heads/master i: 24465: b67b098 24463: 5cfa48a v: v3
1 parent 90ca03e commit 396b6e5

File tree

2 files changed

+13
-18
lines changed

2 files changed

+13
-18
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 2f50607d8840d2ea7de6a7367ab9854d6951e889
2+
refs/heads/master: 0dd4b42a00e01189a28ec12d20a8b144b4e02a14
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/doc/rust.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,30 +2306,25 @@ logging level:
23062306
// Full version, logging a value.
23072307
log(core::error, ~"file not found: " + filename);
23082308
2309-
// Log-level abbreviated, since core::* is imported by default.
2309+
// Log-level abbreviated, since core::* is used by default.
23102310
log(error, ~"file not found: " + filename);
23112311
2312-
// Formatting the message using a format-string and #fmt
2312+
// Formatting the message using a format-string and fmt!
23132313
log(error, fmt!("file not found: %s", filename));
23142314
2315-
// Using the #error macro, that expands to the previous call.
2315+
// Using the error! macro, that expands to the previous call.
23162316
error!("file not found: %s", filename);
23172317
~~~~
23182318

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.
23332328

23342329

23352330
### Assert expressions

0 commit comments

Comments
 (0)