mirror of
https://github.com/Astatin3/unshell.git
synced 2026-06-09 06:47:59 -06:00
Add base62 encoding
This commit is contained in:
@@ -0,0 +1 @@
|
||||
|
||||
+26
-1
@@ -1,12 +1,16 @@
|
||||
#![no_main]
|
||||
|
||||
pub mod client;
|
||||
pub mod crypt;
|
||||
pub mod logger;
|
||||
pub mod module;
|
||||
pub mod server;
|
||||
|
||||
mod announcement;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::{
|
||||
fmt,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
||||
pub use announcement::Announcement;
|
||||
|
||||
@@ -18,9 +22,30 @@ pub enum ModuleError {
|
||||
LibLoadingError(libloading::Error),
|
||||
// LogError(log::SetLoggerError),
|
||||
LinkError(String),
|
||||
CryptError(String),
|
||||
Error(String),
|
||||
}
|
||||
|
||||
impl std::error::Error for ModuleError {
|
||||
fn source(&self) -> Option<&(dyn std::error::Error + 'static)> {
|
||||
None
|
||||
}
|
||||
|
||||
fn description(&self) -> &str {
|
||||
"description() is deprecated; use Display"
|
||||
}
|
||||
|
||||
fn cause(&self) -> Option<&dyn std::error::Error> {
|
||||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for ModuleError {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
f.write_str(format!("{:?}", self).as_str())
|
||||
}
|
||||
}
|
||||
|
||||
/// Trait for defining modules that have a runtime.
|
||||
pub trait ModuleRuntime: Send {
|
||||
/// Returns true if the module is running.
|
||||
|
||||
@@ -18,10 +18,10 @@ static GREY: &str = "\x1b[90m";
|
||||
impl Logger for PrettyLogger {
|
||||
fn log(&self, message: Record) {
|
||||
let log_level = match message.log_level {
|
||||
LogLevel::Debug => format!("{DEBUG_COLOR}DEBUG"),
|
||||
LogLevel::Debug => format!("{DEBUG_COLOR}DBUG"),
|
||||
LogLevel::Info => format!("{INFO_COLOR}INFO"),
|
||||
LogLevel::Warn => format!("{WARN_COLOR}WARN"),
|
||||
LogLevel::Error => format!("{ERROR_COLOR}ERROR"),
|
||||
LogLevel::Error => format!("{ERROR_COLOR}ERR!"),
|
||||
};
|
||||
|
||||
let date: DateTime<Utc> = message.time.into();
|
||||
|
||||
Reference in New Issue
Block a user