Improve documentation of eframe, especially for wasm32 (#3295)

* Improve documentation of `eframe`, especially for wasm32

* remove dead code

* fix
This commit is contained in:
Emil Ernerfeldt
2023-09-04 09:55:47 +02:00
committed by GitHub
parent 209cbeb030
commit 5f742b9aba
12 changed files with 69 additions and 61 deletions
+3 -1
View File
@@ -4,12 +4,14 @@ pub struct WebLogger {
}
impl WebLogger {
/// Pipe all [`log`] events to the web console.
/// Install a new `WebLogger`, piping all [`log`] events to the web console.
pub fn init(filter: log::LevelFilter) -> Result<(), log::SetLoggerError> {
log::set_max_level(filter);
log::set_boxed_logger(Box::new(WebLogger::new(filter)))
}
/// Create a new [`WebLogger`] with the given filter,
/// but don't install it.
pub fn new(filter: log::LevelFilter) -> Self {
Self { filter }
}