Skip to content
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

chore: disable ansi codes when in GCP #128

Merged
merged 1 commit into from
Apr 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions mpc-recovery/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,14 @@ async fn load_account_creator_sk(

#[tokio::main]
async fn main() -> anyhow::Result<()> {
// install global collector configured based on RUST_LOG env var.
tracing_subscriber::fmt::init();
// Install global collector configured based on RUST_LOG env var.
let mut subscriber = tracing_subscriber::fmt();
// Check if running in Google Cloud Run: https://cloud.google.com/run/docs/container-contract#services-env-vars
if std::env::var("K_SERVICE").is_ok() {
// Disable colored logging as it messes up Google's log formatting
subscriber = subscriber.with_ansi(false);
}
subscriber.init();
let _span = tracing::trace_span!("cli").entered();

match Cli::parse() {
Expand Down