fix logger
This commit is contained in:
@@ -1,17 +1,18 @@
|
|||||||
|
use <std::fmt::Formatter>;
|
||||||
use <std::fmt>;
|
use <std::fmt>;
|
||||||
|
|
||||||
pub trait TestLogging<T: fmt::Display>: fmt::Display {
|
pub trait TestLogging<T: fmt::Display>: fmt::Display {
|
||||||
String get();
|
String get();
|
||||||
}
|
}
|
||||||
|
|
||||||
pub enum LogLevel {
|
pub enum LogLevel<T> {
|
||||||
Info,
|
Info,
|
||||||
Warning,
|
Warning,
|
||||||
Error,
|
Error,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for LogLevel {
|
impl fmt::Display for LogLevel {
|
||||||
std::fmt::Result fmt(self*, std::fmt::Formatter<'_> mut* f) {
|
fmt::Result fmt(self*, Formatter<'_> mut* f) {
|
||||||
match (self) {
|
match (self) {
|
||||||
LogLevel::Info => {
|
LogLevel::Info => {
|
||||||
return write!(f, "[INFO]");
|
return write!(f, "[INFO]");
|
||||||
@@ -64,7 +65,7 @@ pub class Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display {
|
impl fmt::Display {
|
||||||
std::fmt::Result fmt(self*, std::fmt::Formatter<'_> mut* f) {
|
fmt::Result fmt(self*, Formatter<'_> mut* f) {
|
||||||
return write!(f, "logger ({})", self.prefix);
|
return write!(f, "logger ({})", self.prefix);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user