Skip to content

Commit b13d986

Browse files
committed
---
yaml --- r: 134701 b: refs/heads/try c: 84bd6bb h: refs/heads/master i: 134699: 5469dd6 v: v3
1 parent 433b314 commit b13d986

File tree

2 files changed

+1
-59
lines changed

2 files changed

+1
-59
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 58413c09cd52ea4005d6ea7733ba1fb3a8f36589
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 437179ed8bf7f7672f84b19265df1ce569e70490
5-
refs/heads/try: 68b8901fffa0646f3da56a2c2b8d8515c8d595c8
5+
refs/heads/try: 84bd6bba45997aca9b1bd9f55d3f2b5c949c7b77
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/src/doc/reference.md

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -4243,64 +4243,6 @@ In general, `--crate-type=bin` or `--crate-type=lib` should be sufficient for
42434243
all compilation needs, and the other options are just available if more
42444244
fine-grained control is desired over the output format of a Rust crate.
42454245

4246-
### Logging system
4247-
4248-
The runtime contains a system for directing [logging
4249-
expressions](#logging-expressions) to a logging console and/or internal logging
4250-
buffers. Logging can be enabled per module.
4251-
4252-
Logging output is enabled by setting the `RUST_LOG` environment variable.
4253-
`RUST_LOG` accepts a logging specification made up of a comma-separated list of
4254-
paths, with optional log levels. For each module containing log expressions, if
4255-
`RUST_LOG` contains the path to that module or a parent of that module, then
4256-
logs of the appropriate level will be output to the console.
4257-
4258-
The path to a module consists of the crate name, any parent modules, then the
4259-
module itself, all separated by double colons (`::`). The optional log level
4260-
can be appended to the module path with an equals sign (`=`) followed by the
4261-
log level, from 1 to 4, inclusive. Level 1 is the error level, 2 is warning, 3
4262-
info, and 4 debug. You can also use the symbolic constants `error`, `warn`,
4263-
`info`, and `debug`. Any logs less than or equal to the specified level will
4264-
be output. If not specified then log level 4 is assumed. Debug messages can be
4265-
omitted by passing `--cfg ndebug` to `rustc`.
4266-
4267-
As an example, to see all the logs generated by the compiler, you would set
4268-
`RUST_LOG` to `rustc`, which is the crate name (as specified in its `crate_id`
4269-
[attribute](#attributes)). To narrow down the logs to just crate resolution,
4270-
you would set it to `rustc::metadata::creader`. To see just error logging use
4271-
`rustc=0`.
4272-
4273-
Note that when compiling source files that don't specify a crate name the crate
4274-
is given a default name that matches the source file, with the extension
4275-
removed. In that case, to turn on logging for a program compiled from, e.g.
4276-
`helloworld.rs`, `RUST_LOG` should be set to `helloworld`.
4277-
4278-
#### Logging Expressions
4279-
4280-
Rust provides several macros to log information. Here's a simple Rust program
4281-
that demonstrates all four of them:
4282-
4283-
```
4284-
#![feature(phase)]
4285-
#[phase(plugin, link)] extern crate log;
4286-
4287-
fn main() {
4288-
error!("This is an error log")
4289-
warn!("This is a warn log")
4290-
info!("this is an info log")
4291-
debug!("This is a debug log")
4292-
}
4293-
```
4294-
4295-
These four log levels correspond to levels 1-4, as controlled by `RUST_LOG`:
4296-
4297-
```sh
4298-
$ RUST_LOG=rust=3 ./rust
4299-
This is an error log
4300-
This is a warn log
4301-
this is an info log
4302-
```
4303-
43044246
# Appendix: Rationales and design tradeoffs
43054247

43064248
*TODO*.

0 commit comments

Comments
 (0)