use crate::logger::{log, Level};
pub struct Log;
impl Log {
pub fn info(msg: impl AsRef<str>) {
log(Level::Info, msg.as_ref());
}
pub fn debug(msg: impl AsRef<str>) {
log(Level::Debug, msg.as_ref());
}
pub fn warning(msg: impl AsRef<str>) {
log(Level::Warn, msg.as_ref());
}
pub fn error(msg: impl AsRef<str>) {
log(Level::Error, msg.as_ref());
}
pub fn info_with(msg: impl AsRef<str>, context: &serde_json::Value) {
let msg_with_ctx = format!("{} - Context: {}", msg.as_ref(), context);
log(Level::Info, &msg_with_ctx);
}
pub fn debug_with(msg: impl AsRef<str>, context: &serde_json::Value) {
let msg_with_ctx = format!("{} - Context: {}", msg.as_ref(), context);
log(Level::Debug, &msg_with_ctx);
}
pub fn warning_with(msg: impl AsRef<str>, context: &serde_json::Value) {
let msg_with_ctx = format!("{} - Context: {}", msg.as_ref(), context);
log(Level::Warn, &msg_with_ctx);
}
pub fn error_with(msg: impl AsRef<str>, context: &serde_json::Value) {
let msg_with_ctx = format!("{} - Context: {}", msg.as_ref(), context);
log(Level::Error, &msg_with_ctx);
}
}