Enhanced Logging (closes #27) #31

Merged
Neshura merged 5 commits from logging into main 2023-12-27 20:31:52 +00:00
Showing only changes of commit 0ab2c8c1a3 - Show all commits

View file

@ -27,6 +27,7 @@ struct CloudflareApiResult {
}
pub(crate) struct CloudflareZone {
name: String,
email: String,
key: String,
id: String,
@ -36,6 +37,7 @@ impl CloudflareZone {
pub(crate) fn new(zone: &ZoneConfig) -> Result<Self, VarError> {
let key = env::var("CF_API_TOKEN")?;
Ok(Self {
name: zone.name.clone(),
email: zone.email.clone(),
key,
id: zone.id.clone(),
@ -75,7 +77,7 @@ impl CloudflareZone {
Ok(entries.result)
} else {
let err_msg = format!("Unable to fetch Cloudflare Zone Entries. Error: {}", response.status());
let err_msg = format!("Unable to fetch Cloudflare Zone Entries for {}. Error: {}",self.name ,response.status());
match connected_to_journal() {
true => error!("[ERROR] {err_msg}"),
false => eprintln!("[ERROR] {err_msg}"),