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
2021-04-23 15:22:39 +02:00
committed by GitHub
parent 8cc1af31c4
commit 541692c4a8
4 changed files with 75 additions and 26 deletions
+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);
}
}