#[doc = crate::_tags!(log)]
#[doc = crate::_doc_meta!{location("sys/log")}]
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash, Ord, PartialOrd)]
#[allow(missing_docs)]
pub enum DiagLevel {
Trace,
Debug,
#[default]
Info,
Warn,
Error,
}
#[doc = crate::_tags!(log)]
#[doc = crate::_doc_meta!{location("sys/log")}]
pub trait DiagOut {
type Error;
fn diag(&mut self, level: DiagLevel, text: &str) -> Result<(), Self::Error>;
fn trace(&mut self, text: &str) -> Result<(), Self::Error> {
self.diag(DiagLevel::Trace, text)
}
fn debug(&mut self, text: &str) -> Result<(), Self::Error> {
self.diag(DiagLevel::Debug, text)
}
fn info(&mut self, text: &str) -> Result<(), Self::Error> {
self.diag(DiagLevel::Info, text)
}
fn warn(&mut self, text: &str) -> Result<(), Self::Error> {
self.diag(DiagLevel::Warn, text)
}
fn error(&mut self, text: &str) -> Result<(), Self::Error> {
self.diag(DiagLevel::Error, text)
}
}