Skip to content

Commit

Permalink
Set different log levels per environment
Browse files Browse the repository at this point in the history
  • Loading branch information
samtay committed Sep 5, 2024
1 parent f94c0ca commit f83c354
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
SUPABASE_ANON_KEY: ${{ secrets.PRODUCTION_ANON_KEY }}
ENV: production
APP_URL: https://talkbirdyto.me
RUST_LOG: error

steps:
- uses: actions/checkout@v4
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
SUPABASE_ANON_KEY: ${{ secrets.STAGING_ANON_KEY }}
ENV: staging
APP_URL: https://staging.talkbirdyto.me
RUST_LOG: debug

steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 4 additions & 1 deletion app/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ fn main() {
// Init storage
dioxus_sdk::set_dir!();
// Init logger
dioxus_logger::init(Level::DEBUG).expect("failed to init logger");
let log_level = option_env!("RUST_LOG")
.and_then(|level| level.parse().ok())
.unwrap_or(Level::INFO);
dioxus_logger::init(log_level).expect("failed to init logger");
// launch(App)
// use below until --port 3000 supported on fullstack
#[allow(clippy::let_unit_value)]
Expand Down

0 comments on commit f83c354

Please sign in to comment.