Skip to content

Commit 6dc5e2c

Browse files
committed
auto merge of #8046 : kmcallister/rust/unused-log, r=pcwalton
2 parents 85b5513 + d0f54a5 commit 6dc5e2c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/rt/rust_log.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,9 @@ static void update_entry(const mod_entry* entry, void *cookie) {
234234
}
235235
}
236236
*entry->state = level;
237-
(*args->n_matches)++;
237+
if (longest_match > 0) {
238+
(*args->n_matches)++;
239+
}
238240
}
239241

240242
void update_module_map(const mod_entry* map, log_directive* dirs,
@@ -318,11 +320,10 @@ void update_log_settings(void* crate_map, char* settings) {
318320
n_dirs, &n_matches);
319321

320322
if (n_matches < n_dirs) {
321-
// NB: Android compiler is complaining about format specifiers here
322-
// and I don't understand why
323-
/*printf("warning: got %" PRIdPTR " RUST_LOG specs, "
324-
"enabled %" PRIdPTR " flags.",
325-
(uintptr_t)n_dirs, (uintptr_t)n_matches);*/
323+
fprintf(stderr, "warning: got %lu RUST_LOG specs but only matched %lu of them.\n"
324+
"You may have mistyped a RUST_LOG spec.\n"
325+
"Use RUST_LOG=::help to see the list of crates and modules.\n",
326+
(unsigned long)n_dirs, (unsigned long)n_matches);
326327
}
327328

328329
free(buffer);

0 commit comments

Comments
 (0)