Impl grammar
This commit is contained in:
@@ -1,9 +1,29 @@
|
||||
use <std::fmt>;
|
||||
|
||||
public enum LogLevel {
|
||||
Info,
|
||||
Warning,
|
||||
Error,
|
||||
}
|
||||
|
||||
impl fmt::Display for LogLevel {
|
||||
std::fmt::Result fmt(self*, std::fmt::Formatter<'_> mut* f) {
|
||||
match (self) {
|
||||
LogLevel::Info => {
|
||||
write!(f, "[INFO]");
|
||||
}
|
||||
|
||||
LogLevel::Warning => {
|
||||
write!(f, "[WARN]");
|
||||
}
|
||||
|
||||
LogLevel::Error => {
|
||||
write!(f, "[ERROR]");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class Logger {
|
||||
String prefix;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user