use crate::logs::LogRecord;
use crate::Resource;
use async_trait::async_trait;
#[cfg(feature = "logs_level_enabled")]
use opentelemetry::logs::Severity;
use opentelemetry::{
logs::{LogError, LogResult},
InstrumentationLibrary,
};
use std::borrow::Cow;
use std::fmt::Debug;
#[async_trait]
pub trait LogExporter: Send + Sync + Debug {
async fn export<'a>(&mut self, batch: Vec<Cow<'a, LogData>>) -> LogResult<()>;
fn shutdown(&mut self) {}
#[cfg(feature = "logs_level_enabled")]
fn event_enabled(&self, _level: Severity, _target: &str, _name: &str) -> bool {
true
}
fn set_resource(&mut self, _resource: &Resource) {}
}
#[derive(Clone, Debug)]
pub struct LogData {
pub record: LogRecord,
pub instrumentation: InstrumentationLibrary,
}
pub type ExportResult = Result<(), LogError>;