logs: create user,tag,person, change handle
This commit is contained in:
16
src/logs.rs
16
src/logs.rs
@@ -14,6 +14,10 @@ pub struct LogEntry {
|
|||||||
pub enum LogAction {
|
pub enum LogAction {
|
||||||
Initialize,
|
Initialize,
|
||||||
RegenInfradmin,
|
RegenInfradmin,
|
||||||
|
CreateUser { id: Uuid, handle: String },
|
||||||
|
CreateTag { id: Uuid, name: String },
|
||||||
|
CreatePerson { id: Uuid, pname: String },
|
||||||
|
ChangeUserHandle { id: Uuid, old: String, new: String },
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for LogAction {
|
impl Display for LogAction {
|
||||||
@@ -21,6 +25,18 @@ impl Display for LogAction {
|
|||||||
match self {
|
match self {
|
||||||
LogAction::Initialize => write!(f, "Initialized Mnemosyne."),
|
LogAction::Initialize => write!(f, "Initialized Mnemosyne."),
|
||||||
LogAction::RegenInfradmin => write!(f, "Regenerated the Infradmin account."),
|
LogAction::RegenInfradmin => write!(f, "Regenerated the Infradmin account."),
|
||||||
|
LogAction::CreateUser { id, handle } => {
|
||||||
|
write!(f, "Created user @{handle} (uid: {id})")
|
||||||
|
}
|
||||||
|
LogAction::CreateTag { id, name } => {
|
||||||
|
write!(f, "Created tag #{name} (id: {id})")
|
||||||
|
}
|
||||||
|
LogAction::CreatePerson { id, pname } => {
|
||||||
|
write!(f, "Created person ~{pname} (id: {id})")
|
||||||
|
}
|
||||||
|
LogAction::ChangeUserHandle { id, old, new } => {
|
||||||
|
write!(f, "Changed user handle @{old} -> @{new} (uid: {id})")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user