Skip to content

Commit

Permalink
Add default settings
Browse files Browse the repository at this point in the history
  • Loading branch information
macpie committed May 13, 2024
1 parent 4993bb9 commit 9b0dfa6
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions boost_manager/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct Settings {
/// "poc_entropy=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Cache location for generated verified reports
pub cache: String,
Expand Down
8 changes: 8 additions & 0 deletions custom_tracing/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,11 @@ pub struct Settings {
pub fn default_tracing_cfg_file() -> String {
"tracing.cfg".to_string()
}

impl Settings {
pub fn serde_default() -> Self {
Self {
tracing_cfg_file: default_tracing_cfg_file(),
}
}
}
1 change: 1 addition & 0 deletions ingest/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Settings {
/// "ingest=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Mode to run the server in (iot or mobile). Required
pub mode: Mode,
Expand Down
1 change: 1 addition & 0 deletions iot_config/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Settings {
/// "iot_config=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Listen address. Required. Default is 0.0.0.0:8080
#[serde(default = "default_listen_addr")]
Expand Down
1 change: 1 addition & 0 deletions iot_packet_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct Settings {
/// "iot_packet_verifier=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Cache location for generated verified reports
pub cache: String,
Expand Down
1 change: 1 addition & 0 deletions iot_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ pub struct Settings {
/// "iot_verifier=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Cache location for generated verified reports
pub cache: String,
Expand Down
1 change: 1 addition & 0 deletions mobile_config/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ pub struct Settings {
/// "mobile_config=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Listen address. Required. Default to 0.0.0.0::8080
#[serde(default = "default_listen_addr")]
Expand Down
1 change: 1 addition & 0 deletions mobile_packet_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct Settings {
/// "mobile_verifier=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Cache location for generated verified reports
pub cache: String,
Expand Down
1 change: 1 addition & 0 deletions mobile_verifier/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ pub struct Settings {
/// "mobile_verifier=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Cache location for generated verified reports
pub cache: String,
Expand Down
1 change: 1 addition & 0 deletions poc_entropy/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ pub struct Settings {
/// "poc_entropy=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Listen address for http requests for entropy. Default "0.0.0.0:8080"
#[serde(default = "default_listen_addr")]
Expand Down
1 change: 1 addition & 0 deletions price/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub struct Settings {
/// "price=debug"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Source URL for price data. Required
#[serde(default = "default_source")]
Expand Down
1 change: 1 addition & 0 deletions reward_index/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub struct Settings {
/// "poc_entropy=debug,poc_store=info"
#[serde(default = "default_log")]
pub log: String,
#[serde(default = "custom_tracing::Settings::serde_default")]
pub custom_tracing: custom_tracing::Settings,
/// Check interval in seconds. (Default is 900; 15 minutes)
#[serde(default = "default_interval")]
Expand Down

0 comments on commit 9b0dfa6

Please sign in to comment.