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 errors;
|
||||||
mod logging;
|
mod logging;
|
||||||
|
|
||||||
|
pub const APP_NAME: &str = concat!(env!("CARGO_PKG_NAME"), " v", env!("CARGO_PKG_VERSION"));
|
||||||
|
|
||||||
fn main() -> eyre::Result<()> {
|
fn main() -> eyre::Result<()> {
|
||||||
let process_mode = ProcessMode::from_current_process()?;
|
let process_mode = ProcessMode::from_current_process()?;
|
||||||
|
|
||||||
crate::errors::init()?;
|
crate::errors::init()?;
|
||||||
crate::logging::init(process_mode)?;
|
crate::logging::init(process_mode)?;
|
||||||
tracing::info!(concat!(
|
tracing::info!("{APP_NAME}");
|
||||||
env!("CARGO_PKG_NAME"),
|
|
||||||
" v",
|
|
||||||
env!("CARGO_PKG_VERSION")
|
|
||||||
));
|
|
||||||
|
|
||||||
match process_mode {
|
match process_mode {
|
||||||
ProcessMode::Console(_) => process_mode.detach_to_gui()?,
|
ProcessMode::Console(_) => process_mode.detach_to_gui()?,
|
||||||
ProcessMode::Gui => {
|
ProcessMode::Gui => {
|
||||||
tracing::info!("Attempting to natively render UI");
|
tracing::info!("Attempting to natively render UI");
|
||||||
eframe::run_native(
|
eframe::run_native(
|
||||||
"portable-msvc-rs",
|
APP_NAME,
|
||||||
NativeOptions {
|
NativeOptions {
|
||||||
viewport: ViewportBuilder::default()
|
viewport: ViewportBuilder::default()
|
||||||
.with_resizable(false)
|
.with_resizable(false)
|
||||||
|
|
Loading…
Add table
Reference in a new issue