oxyde_cloud_cli/commands/log.rs
1use crate::api_key::api_key;
2use anyhow::{Context, Result};
3use oxyde_cloud_client::Client;
4
5pub async fn log(name: &str) -> Result<()> {
6 let api_key = api_key().context("Failed to get API key")?;
7 let client = Client::new(api_key);
8
9 let logs = client
10 .log(name)
11 .await
12 .with_context(|| format!("Failed to fetch logs for app '{name}'"))?;
13
14 println!("{logs}");
15
16 Ok(())
17}