@@ -22,6 +22,7 @@ impl Default for InternalLogOrigin {
22
22
Self :: Unknown
23
23
}
24
24
}
25
+
25
26
#[ derive( Clone , Debug , Deserialize , Serialize ) ]
26
27
#[ cfg_attr( feature = "openapi" , derive( ToSchema ) ) ]
27
28
#[ cfg_attr( feature = "openapi" , schema( as = shuttle_common:: log:: Item ) ) ]
@@ -33,14 +34,6 @@ pub struct Item {
33
34
#[ cfg_attr( feature = "openapi" , schema( value_type = KnownFormat :: DateTime ) ) ]
34
35
pub timestamp : DateTime < Utc > ,
35
36
pub line : String ,
36
- // #[cfg_attr(feature = "openapi", schema(value_type = shuttle_common::deployment::State))]
37
- // pub state: State,
38
- // #[cfg_attr(feature = "openapi", schema(value_type = shuttle_common::log::Level))]
39
- // pub level: Level,
40
- // pub file: Option<String>,
41
- // pub line: Option<u32>,
42
- // pub target: String,
43
- // pub fields: Vec<u8>,
44
37
}
45
38
46
39
#[ cfg( feature = "display" ) ]
@@ -58,43 +51,6 @@ impl std::fmt::Display for Item {
58
51
}
59
52
}
60
53
61
- #[ derive( Clone , Debug , Deserialize , Serialize , Eq , PartialEq ) ]
62
- #[ serde( rename_all = "lowercase" ) ]
63
- #[ cfg_attr( feature = "openapi" , derive( ToSchema ) ) ]
64
- #[ cfg_attr( feature = "openapi" , schema( as = shuttle_common:: log:: Level ) ) ]
65
- pub enum Level {
66
- Trace ,
67
- Debug ,
68
- Info ,
69
- Warn ,
70
- Error ,
71
- }
72
-
73
- #[ cfg( feature = "display" ) ]
74
- impl Level {
75
- fn get_colored ( & self ) -> StyledContent < & str > {
76
- match self {
77
- Level :: Trace => "TRACE" . magenta ( ) ,
78
- Level :: Debug => "DEBUG" . blue ( ) ,
79
- Level :: Info => " INFO" . green ( ) ,
80
- Level :: Warn => " WARN" . yellow ( ) ,
81
- Level :: Error => "ERROR" . red ( ) ,
82
- }
83
- }
84
- }
85
-
86
- impl From < & tracing:: Level > for Level {
87
- fn from ( level : & tracing:: Level ) -> Self {
88
- match * level {
89
- tracing:: Level :: ERROR => Self :: Error ,
90
- tracing:: Level :: WARN => Self :: Warn ,
91
- tracing:: Level :: INFO => Self :: Info ,
92
- tracing:: Level :: DEBUG => Self :: Debug ,
93
- tracing:: Level :: TRACE => Self :: Trace ,
94
- }
95
- }
96
- }
97
-
98
54
#[ cfg( test) ]
99
55
mod tests {
100
56
use super :: * ;
0 commit comments