rust/src/test/run-fail
Alex Crichton cc6ec8df95 log: Introduce liblog, the old std::logging
This commit moves all logging out of the standard library into an external
crate. This crate is the new crate which is responsible for all logging macros
and logging implementation. A few reasons for this change are:

* The crate map has always been a bit of a code smell among rust programs. It
  has difficulty being loaded on almost all platforms, and it's used almost
  exclusively for logging and only logging. Removing the crate map is one of the
  end goals of this movement.

* The compiler has a fair bit of special support for logging. It has the
  __log_level() expression as well as generating a global word per module
  specifying the log level. This is unfairly favoring the built-in logging
  system, and is much better done purely in libraries instead of the compiler
  itself.

* Initialization of logging is much easier to do if there is no reliance on a
  magical crate map being available to set module log levels.

* If the logging library can be written outside of the standard library, there's
  no reason that it shouldn't be. It's likely that we're not going to build the
  highest quality logging library of all time, so third-party libraries should
  be able to provide just as high-quality logging systems as the default one
  provided in the rust distribution.

With a migration such as this, the change does not come for free. There are some
subtle changes in the behavior of liblog vs the previous logging macros:

* The core change of this migration is that there is no longer a physical
  log-level per module. This concept is still emulated (it is quite useful), but
  there is now only a global log level, not a local one. This global log level
  is a reflection of the maximum of all log levels specified. The previously
  generated logging code looked like:

    if specified_level <= __module_log_level() {
        println!(...)
    }

  The newly generated code looks like:

    if specified_level <= ::log::LOG_LEVEL {
        if ::log::module_enabled(module_path!()) {
            println!(...)
        }
    }

  Notably, the first layer of checking is still intended to be "super fast" in
  that it's just a load of a global word and a compare. The second layer of
  checking is executed to determine if the current module does indeed have
  logging turned on.

  This means that if any module has a debug log level turned on, all modules
  with debug log levels get a little bit slower (they all do more expensive
  dynamic checks to determine if they're turned on or not).

  Semantically, this migration brings no change in this respect, but
  runtime-wise, this will have a perf impact on some code.

* A `RUST_LOG=::help` directive will no longer print out a list of all modules
  that can be logged. This is because the crate map will no longer specify the
  log levels of all modules, so the list of modules is not known. Additionally,
  warnings can no longer be provided if a malformed logging directive was
  supplied.

The new "hello world" for logging looks like:

    #[phase(syntax, link)]
    extern crate log;

    fn main() {
        debug!("Hello, world!");
    }
2014-03-15 22:26:36 -07:00
..
args-fail.rs
assert-as-macro.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
assert-eq-macro-fail.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
assert-macro-explicit.rs
assert-macro-fmt.rs
assert-macro-owned.rs
assert-macro-static.rs
binop-fail-2.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
binop-fail-3.rs
binop-fail.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
bounds-check-no-overflow.rs Uppercase numeric constants 2014-01-25 21:38:25 +13:00
bug-811.rs
bug-2470-bounds-check-overflow-2.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
bug-2470-bounds-check-overflow-3.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
bug-2470-bounds-check-overflow.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
die-macro-expr.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
die-macro-pure.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
die-macro.rs Added tests to make tidy 2014-02-07 12:49:24 -06:00
divide-by-zero.rs
doublefail.rs
explicit-fail-msg.rs
explicit-fail.rs
expr-fn-fail.rs
expr-if-fail-fn.rs
expr-if-fail.rs
expr-match-fail-fn.rs
expr-match-fail.rs
extern-fail.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
fail-arg.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
fail-macro-any-wrapped.rs
fail-macro-any.rs Cleaned up std::any 2014-03-04 21:10:23 +01:00
fail-macro-explicit.rs
fail-macro-fmt.rs
fail-macro-owned.rs
fail-macro-static.rs
fail-main.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
fail-parens.rs
fail-task-name-none.rs Remove do keyword from test/ 2014-01-29 09:15:42 -05:00
fail-task-name-owned.rs Update clients of the TaskBuilder API 2014-02-16 15:34:02 -08:00
fail-task-name-send-str.rs Update clients of the TaskBuilder API 2014-02-16 15:34:02 -08:00
fail-task-name-static.rs Update clients of the TaskBuilder API 2014-02-16 15:34:02 -08:00
fail.rs
fmt-fail.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
for-each-loop-fail.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
glob-use-std.rs
if-check-fail.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
if-cond-bot.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
issue-948.rs
issue-2061.rs test: Clean out the test suite a bit 2014-02-25 09:21:09 -08:00
issue-2272.rs
issue-2444.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
issue-2761.rs
issue-3029.rs
issue-5500.rs Reenable some ignored test cases 2014-02-12 20:23:45 +01:00
main-fail.rs
match-bot-fail.rs
match-disc-bot.rs
match-wildcards.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
mod-zero.rs
morestack1.rs Change xfail directives in compiletests to ignore, closes #11363 2014-02-11 18:23:20 +01:00
morestack2.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
morestack3.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
morestack4.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
native-failure.rs extern mod => extern crate 2014-02-14 22:55:21 -08:00
result-get-fail.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
rhs-type.rs
rt-set-exit-status-fail2.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
rt-set-exit-status-fail.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
rt-set-exit-status.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
run-unexported-tests.rs extra: Put the nail in the coffin, delete libextra 2014-03-14 13:59:02 -07:00
str-overrun.rs
task-spawn-barefn.rs
test-fail.rs extra: Capture stdout/stderr of tests by default 2014-02-14 07:46:29 -08:00
test-tasks-invalid-value.rs
tls-exit-status.rs
too-much-recursion-unwinding.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unimplemented-macro-fail.rs Add unimplemented! macro 2014-02-08 04:43:39 +11:00
unique-fail.rs
unreachable-macro-fail.rs Add missing test for unreachable! macro 2014-02-08 04:43:51 +11:00
unwind-assert.rs
unwind-box-fn-unique.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box-res.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box-str.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box-unique-unique.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box-unique.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box-vec.rs log: Introduce liblog, the old std::logging 2014-03-15 22:26:36 -07:00
unwind-box.rs
unwind-fail.rs
unwind-initializer-indirect.rs
unwind-initializer.rs
unwind-interleaved.rs
unwind-iter2.rs
unwind-iter.rs
unwind-lambda.rs
unwind-match.rs
unwind-misc-1.rs Move std::{trie, hashmap} to libcollections 2014-02-23 00:35:11 -08:00
unwind-move.rs
unwind-nested.rs
unwind-partial-box.rs
unwind-partial-unique.rs
unwind-partial-vec.rs
unwind-rec2.rs
unwind-rec.rs
unwind-resource-fail2.rs Change xfail directives in compiletests to ignore, closes #11363 2014-02-11 18:23:20 +01:00
unwind-resource-fail3.rs
unwind-resource-fail.rs
unwind-stacked.rs
unwind-tup2.rs
unwind-tup.rs
unwind-uninitialized.rs
unwind-unique.rs
vec-overrun.rs
while-body-fails.rs
while-fail.rs