feat: use the same app name for log output and GUI title
This commit is contained in:
parent
17b102aac1
commit
1df32ee4a4
1 changed files with 4 additions and 6 deletions
10
src/main.rs
10
src/main.rs
|
@ -9,23 +9,21 @@ pub(crate) mod console;
|
|||
mod errors;
|
||||
mod logging;
|
||||
|
||||
pub const APP_NAME: &str = concat!(env!("CARGO_PKG_NAME"), " v", env!("CARGO_PKG_VERSION"));
|
||||
|
||||
fn main() -> eyre::Result<()> {
|
||||
let process_mode = ProcessMode::from_current_process()?;
|
||||
|
||||
crate::errors::init()?;
|
||||
crate::logging::init(process_mode)?;
|
||||
tracing::info!(concat!(
|
||||
env!("CARGO_PKG_NAME"),
|
||||
" v",
|
||||
env!("CARGO_PKG_VERSION")
|
||||
));
|
||||
tracing::info!("{APP_NAME}");
|
||||
|
||||
match process_mode {
|
||||
ProcessMode::Console(_) => process_mode.detach_to_gui()?,
|
||||
ProcessMode::Gui => {
|
||||
tracing::info!("Attempting to natively render UI");
|
||||
eframe::run_native(
|
||||
"portable-msvc-rs",
|
||||
APP_NAME,
|
||||
NativeOptions {
|
||||
viewport: ViewportBuilder::default()
|
||||
.with_resizable(false)
|
||||
|
|
Loading…
Add table
Reference in a new issue