@@ -212,7 +212,7 @@ do drop
212212else enum extern
213213false fn for
214214if impl
215- let log loop
215+ let loop
216216match mod mut
217217priv pub pure
218218ref return
@@ -805,21 +805,20 @@ Use declarations support a number of "convenience" notations:
805805An example of ` use ` declarations:
806806
807807~~~~
808- use foo = core::info;
809808use core::float::sin;
810809use core::str::{slice, to_upper};
811810use core::option::Some;
812811
813812fn main() {
814- // Equivalent to 'log(core:: info, core::float::sin(1.0));'
815- log(foo, sin(1.0));
813+ // Equivalent to 'info!( core::float::sin(1.0));'
814+ info!( sin(1.0));
816815
817- // Equivalent to 'log(core:: info, core::option::Some(1.0));'
818- log( info, Some(1.0));
816+ // Equivalent to 'info!( core::option::Some(1.0));'
817+ info!( Some(1.0));
819818
820- // Equivalent to 'log(core::info,
821- // core::str::to_upper(core::str::slice("foo", 0, 1)));'
822- log( info, to_upper(slice("foo", 0, 1)));
819+ // Equivalent to
820+ // 'info!( core::str::to_upper(core::str::slice("foo", 0, 1)));'
821+ info!( to_upper(slice("foo", 0, 1)));
823822}
824823~~~~
825824
@@ -990,7 +989,7 @@ output slot type would normally be. For example:
990989
991990~~~~
992991fn my_err(s: &str) -> ! {
993- log( info, s);
992+ info!( s);
994993 fail!();
995994}
996995~~~~
@@ -2397,58 +2396,6 @@ fn max(a: int, b: int) -> int {
23972396}
23982397~~~~
23992398
2400- ### Log expressions
2401-
2402- ~~~~~~~~ {.ebnf .gram}
2403- log_expr : "log" '(' level ',' expr ')' ;
2404- ~~~~~~~~
2405-
2406- Evaluating a ` log ` expression may, depending on runtime configuration, cause a
2407- value to be appended to an internal diagnostic logging buffer provided by the
2408- runtime or emitted to a system console. Log expressions are enabled or
2409- disabled dynamically at run-time on a per-task and per-item basis. See
2410- [ logging system] ( #logging-system ) .
2411-
2412- Each ` log ` expression must be provided with a * level* argument in
2413- addition to the value to log. The logging level is a ` u32 ` value, where
2414- lower levels indicate more-urgent levels of logging. By default, the lowest
2415- four logging levels (` 1_u32 ... 4_u32 ` ) are predefined as the constants
2416- ` error ` , ` warn ` , ` info ` and ` debug ` in the ` core ` library.
2417-
2418- Additionally, the macros ` error! ` , ` warn! ` , ` info! ` and ` debug! ` are defined
2419- in the default syntax-extension namespace. These expand into calls to the
2420- logging facility composed with calls to the ` fmt! ` string formatting
2421- syntax-extension.
2422-
2423- The following examples all produce the same output, logged at the ` error `
2424- logging level:
2425-
2426- ~~~~
2427- # let filename = "bulbasaur";
2428-
2429- // Full version, logging a value.
2430- log(core::error, ~"file not found: " + filename);
2431-
2432- // Log-level abbreviated, since core::* is used by default.
2433- log(error, ~"file not found: " + filename);
2434-
2435- // Formatting the message using a format-string and fmt!
2436- log(error, fmt!("file not found: %s", filename));
2437-
2438- // Using the error! macro, that expands to the previous call.
2439- error!("file not found: %s", filename);
2440- ~~~~
2441-
2442- A ` log ` expression is * not evaluated* when logging at the specified logging-level, module or task is disabled at runtime.
2443- This makes inactive ` log ` expressions very cheap;
2444- they should be used extensively in Rust code, as diagnostic aids,
2445- as they add little overhead beyond a single integer-compare and branch at runtime.
2446-
2447- Logging is presently implemented as a language built-in feature,
2448- as it makes use of compiler-provided, per-module data tables and flags.
2449- In the future, logging will move into a library, and will no longer be a core expression type.
2450- It is therefore recommended to use the macro forms of logging (` error! ` , ` debug! ` , etc.) to minimize disruption in code that uses logging.
2451-
24522399
24532400# Type system
24542401
@@ -3149,7 +3096,7 @@ communication facilities.
31493096
31503097The runtime contains a system for directing [ logging
31513098expressions] ( #log-expressions ) to a logging console and/or internal logging
3152- buffers. Logging expressions can be enabled per module.
3099+ buffers. Logging can be enabled per module.
31533100
31543101Logging output is enabled by setting the ` RUST_LOG ` environment
31553102variable. ` RUST_LOG ` accepts a logging specification made up of a
0 commit comments