clarify proxy log messages (#520)

This commit is contained in:
bmc-msft
2021-02-08 17:39:26 -05:00
committed by GitHub
parent 8c9f65c0be
commit 5114332ea0
7 changed files with 67 additions and 16 deletions

View File

@ -12,6 +12,19 @@ pub enum ClientType {
Shared,
}
#[derive(Clone, Debug, PartialEq)]
pub enum Role {
Proxy,
}
impl Role {
pub fn as_str(&self) -> &'static str {
match self {
Self::Proxy => "proxy",
}
}
}
#[allow(non_camel_case_types)]
#[derive(Clone, Debug)]
pub enum Event {
@ -75,6 +88,7 @@ pub enum EventData {
CoverageMaxDepth(u64),
ToolName(String),
Region(String),
Role(Role),
}
impl EventData {
@ -111,6 +125,7 @@ impl EventData {
Self::Coverage(x) => ("coverage", x.to_string()),
Self::ToolName(x) => ("tool_name", x.to_owned()),
Self::Region(x) => ("region", x.to_owned()),
Self::Role(x) => ("role", x.as_str().to_owned()),
}
}
@ -149,6 +164,7 @@ impl EventData {
Self::Coverage(_) => true,
Self::ToolName(_) => true,
Self::Region(_) => false,
Self::Role(_) => false,
}
}
}