Use host max log level when initializing the RuntimeLogger (#8655)

* Use host max log level when initializing the `RuntimeLogger`

This should fix performance problems introduced by logging under certain
circumstances. Before we always called into the host and the host was
doing the log filtering, now as the correct max log level is set, we
don't call into the host for every log line to check if it should be
logged. However, we would still call into the host to determine if
something should be logged when `something=trace` is given as we don't
forward the log targets that are enabled.

* Finish the pr
This commit is contained in:
Bastian Köcher authored and GitHub committed 2021-04-23 13:22:39 +00:00
1 parent 8cc1af31c4
commit 541692c4a8
4 files changed
+75 -26

No files matched your search

+1 -1
View File
@@ -1019,7 +1019,7 @@ cfg_if! {
}
fn do_trace_log() {
log::error!("Hey I'm runtime: {}", log::STATIC_MAX_LEVEL);
log::trace!("Hey I'm runtime: {}", log::STATIC_MAX_LEVEL);
}
}