diff options
| author | bors <bors@rust-lang.org> | 2013-07-28 12:52:25 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-07-28 12:52:25 -0700 |
| commit | 6dc5e2c61f828aeeb2eeffbb235938edbe18c809 (patch) | |
| tree | ee89527a5520fe0868a5271c0163b73bc1c1035a /src/rt/rust_log.cpp | |
| parent | 85b55131bebb5f485fa94c9b786ef76b7e01c32f (diff) | |
| parent | d0f54a5cfb13e9ec437083666eb1b2cca6a39941 (diff) | |
| download | rust-6dc5e2c61f828aeeb2eeffbb235938edbe18c809.tar.gz rust-6dc5e2c61f828aeeb2eeffbb235938edbe18c809.zip | |
auto merge of #8046 : kmcallister/rust/unused-log, r=pcwalton
Diffstat (limited to 'src/rt/rust_log.cpp')
| -rw-r--r-- | src/rt/rust_log.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/rt/rust_log.cpp b/src/rt/rust_log.cpp index 8179c53e96d..f7b117a8cb1 100644 --- a/src/rt/rust_log.cpp +++ b/src/rt/rust_log.cpp @@ -234,7 +234,9 @@ static void update_entry(const mod_entry* entry, void *cookie) { } } *entry->state = level; - (*args->n_matches)++; + if (longest_match > 0) { + (*args->n_matches)++; + } } void update_module_map(const mod_entry* map, log_directive* dirs, @@ -318,11 +320,10 @@ void update_log_settings(void* crate_map, char* settings) { n_dirs, &n_matches); if (n_matches < n_dirs) { - // NB: Android compiler is complaining about format specifiers here - // and I don't understand why - /*printf("warning: got %" PRIdPTR " RUST_LOG specs, " - "enabled %" PRIdPTR " flags.", - (uintptr_t)n_dirs, (uintptr_t)n_matches);*/ + fprintf(stderr, "warning: got %lu RUST_LOG specs but only matched %lu of them.\n" + "You may have mistyped a RUST_LOG spec.\n" + "Use RUST_LOG=::help to see the list of crates and modules.\n", + (unsigned long)n_dirs, (unsigned long)n_matches); } free(buffer); |
