1use std::str::FromStr;
2use strum_macros::EnumString;
3
4use crate::DateTime;
5
6#[derive(Debug)]
7pub struct Log {
8 pub date: DateTime,
9 pub typ: Type,
10 pub msg: Vec<String>,
11}
12
13impl Log {
14 pub fn new(date: DateTime, typ: Option<&str>, msg: Vec<String>) -> Self {
15 let typ = if let Some(typ) = typ {
16 Type::from_str(typ).unwrap()
17 } else {
18 Type::Message
19 };
20 Self { date, typ, msg }
21 }
22}
23
24#[derive(PartialEq, Debug, EnumString)]
25pub enum Type {
26 #[strum(disabled)]
27 Message, #[strum(default)]
30 Unimplemented(String),
31
32 API,
33 Always,
34 AssetBundleDownloadManager,
35 AvatarPlayableController,
36 GC,
37 IkController,
38 NetworkManager,
39 ObjectInstantiator,
40 Player,
41 PlayerManager,
42 RoomManager,
43 SpawnManager,
44 USpeaker,
45 VRCApplicationSetup,
46 VRCAvatarManager,
47 VRCFlowManagerVRC,
48 VRCFlowNetworkManager,
49 VRCHandGrasper,
50 VRCVrIkController,
51 VRC_AnimationController,
52}