flexi_logger_datadog/
error.rs1use log::error;
4use std::fmt::Debug;
5use std::io;
6use thiserror::Error;
7
8#[derive(Error, Debug)]
10pub enum Error {
11 #[error("Http Error")]
13 HttpError(#[from] reqwest::Error),
14 #[error("IO Error")]
16 IOError(#[from] io::Error),
17 #[error("Lock Error")]
19 LockError(String),
20 #[error("Adapter is shut down")]
22 AdapterShutdownError,
23 #[error("Channel communication error: `{0}`")]
25 ChannelError(String),
26}
27
28pub fn log_error<E: std::fmt::Display>(e: E) {
30 error!("Unexpected error: {}", e);
31 eprintln!("Unexpected error: {}", e);
32}