-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed logging to warn level when web client is built in release mode. #588
base: main
Are you sure you want to change the base?
Changes from all commits
45aedf9
b60aa5c
eff2819
09bc0ad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -18,7 +18,27 @@ mod board_components; | |||||||||||||||||||||||
mod console; | ||||||||||||||||||||||||
mod hooks; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
use cfg_if::cfg_if; | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
fn main() { | ||||||||||||||||||||||||
wasm_logger::init(wasm_logger::Config::default()); | ||||||||||||||||||||||||
wasm_logger::init(wasm_logger::Config::new(get_log_level())); | ||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This could simply be something like this:
Suggested change
Then we don't need the |
||||||||||||||||||||||||
|
||||||||||||||||||||||||
yew::Renderer::<app::App>::new().render(); | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
|
||||||||||||||||||||||||
fn get_log_level() -> log::Level { | ||||||||||||||||||||||||
cfg_if! { | ||||||||||||||||||||||||
if #[cfg(feature = "web_client_log_level_trace")] { | ||||||||||||||||||||||||
log::Level::Trace | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
else if #[cfg(feature = "web_client_log_level_debug")] { | ||||||||||||||||||||||||
log::Level::Debug | ||||||||||||||||||||||||
} else if #[cfg(feature = "web_client_log_level_info")] { | ||||||||||||||||||||||||
log::Level::Info | ||||||||||||||||||||||||
} else if #[cfg(feature = "web_client_log_level_warn")] { | ||||||||||||||||||||||||
log::Level::Warn | ||||||||||||||||||||||||
} else { | ||||||||||||||||||||||||
log::Level::Error | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} | ||||||||||||||||||||||||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,9 +109,9 @@ async fn main() -> Result<()> { | |
} | ||
} | ||
}); | ||
let mut trunk = tokio::process::Command::new("../../scripts/wrapper.sh"); | ||
trunk.args(["trunk", "build", "--release", "crates/web-client/index.html"]); | ||
wasefire_cli_tools::cmd::execute(&mut trunk).await?; | ||
let mut trunk = std::process::Command::new("../../scripts/wrapper.sh"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You reverted the |
||
trunk.args(["trunk", "build", "--locked", "--release", "--features=web_client_log_level_warn", "crates/web-client/index.html"]); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess you're still working on computing this automatically. |
||
wasefire_cli_tools::cmd::execute(&mut trunk)?; | ||
let url = format!("{}:{}", flags.web_options.web_host, flags.web_options.web_port); | ||
web_server::Client::new(&url, sender).await? | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need to put this table before the
[lints]
one, because the sync script assumes[lints]
is the last one. We can also use much simple feature names: