Skip to content

Commit 557b9bd

Browse files
committed
WIP revert state tracking
1 parent 0255379 commit 557b9bd

File tree

2 files changed

+212
-128
lines changed

2 files changed

+212
-128
lines changed

common/src/log.rs

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ impl Default for InternalLogOrigin {
2222
Self::Unknown
2323
}
2424
}
25+
2526
#[derive(Clone, Debug, Deserialize, Serialize)]
2627
#[cfg_attr(feature = "openapi", derive(ToSchema))]
2728
#[cfg_attr(feature = "openapi", schema(as = shuttle_common::log::Item))]
@@ -33,14 +34,6 @@ pub struct Item {
3334
#[cfg_attr(feature = "openapi", schema(value_type = KnownFormat::DateTime))]
3435
pub timestamp: DateTime<Utc>,
3536
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>,
4437
}
4538

4639
#[cfg(feature = "display")]
@@ -58,43 +51,6 @@ impl std::fmt::Display for Item {
5851
}
5952
}
6053

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-
9854
#[cfg(test)]
9955
mod tests {
10056
use super::*;

0 commit comments

Comments
 (0)