use super::Record;
use super::OwnedKeyValueList;
use std::{io, fmt};
pub trait Format: Send + Sync + Sized {
fn format(&self,
io: &mut io::Write,
info: &Record,
logger_values: &OwnedKeyValueList)
-> io::Result<()>;
}
pub trait Decorator : Send + Sync + Sized {
type RecordDecorator : RecordDecorator;
fn decorate(&self, record : &Record) -> Self::RecordDecorator;
}
pub trait RecordDecorator {
fn fmt_msg(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
fn fmt_key(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
fn fmt_separator(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
fn fmt_value(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
fn fmt_timestamp(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
fn fmt_level(&self, io : &mut io::Write, args : fmt::Arguments) -> io::Result<()> {
io.write_fmt(args)
}
}