Skip to content

Commit 2c8d53e

Browse files
fixup: log levels/wording
1 parent b2ba99f commit 2c8d53e

File tree

6 files changed

+13
-12
lines changed

6 files changed

+13
-12
lines changed

installers/binstall/src/install.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,7 @@ impl Installer {
7171

7272
fn write_bin_to_fs(&self) -> Result<(), InstallerError> {
7373
let bin_path = self.get_bin_path()?;
74-
tracing::debug!("copying from: {}", &self.executable_location);
75-
tracing::debug!("copying to: {}", &bin_path);
74+
tracing::debug!("copying \"{}\" to \"{}\"", &self.executable_location, &bin_path);
7675
// attempt to remove the old binary
7776
// but do not error if it doesn't exist.
7877
let _ = fs::remove_file(&bin_path);

src/command/graph/publish.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl Publish {
4747

4848
let schema_document = load_schema_from_flag(&self.schema, std::io::stdin())?;
4949

50-
tracing::debug!(?schema_document);
50+
tracing::debug!("Publishing \n{}", &schema_document);
5151

5252
let publish_response = publish::run(
5353
publish::publish_schema_mutation::Variables {

src/command/subgraph/publish.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ impl Publish {
7272

7373
let schema_document = load_schema_from_flag(&self.schema, std::io::stdin())?;
7474

75-
tracing::debug!("Schema Document to publish:\n{}", &schema_document);
75+
tracing::debug!("Publishing \n{}", &schema_document);
7676

7777
// This response is used to check whether or not the current graph is federated.
7878
let federated_response = is_federated::run(

src/utils/env.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ impl RoverEnv {
3333
/// returns the value of the environment variable if it exists
3434
pub fn get(&self, key: RoverEnvKey) -> io::Result<Option<String>> {
3535
let key_str = key.to_string();
36-
tracing::debug!("Checking for ${}", &key_str);
36+
tracing::trace!("Checking for ${}", &key_str);
3737
let result = match &self.mock_store {
3838
Some(mock_store) => Ok(mock_store.get(&key_str).map(|v| v.to_owned())),
3939
None => match env::var(&key_str) {
@@ -54,7 +54,7 @@ impl RoverEnv {
5454
if let Some(result) = &result {
5555
tracing::debug!("read {}", self.get_debug_value(key, result));
5656
} else {
57-
tracing::debug!("could not find #{}", &key_str);
57+
tracing::trace!("could not find ${}", &key_str);
5858
}
5959

6060
Ok(result)

src/utils/telemetry.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,18 @@ impl Report for Rover {
7575
let json_args = serde_json::to_string(&self)?;
7676
let mut value_args = serde_json::from_str(&json_args)?;
7777
let serialized_command = get_command_from_args(&mut value_args);
78-
tracing::debug!(serialized_command = ?serialized_command);
78+
tracing::debug!(?serialized_command);
7979
Ok(serialized_command)
8080
}
8181

8282
fn is_telemetry_enabled(&self) -> Result<bool, SputnikError> {
8383
let value = self.env_store.get(RoverEnvKey::TelemetryDisabled)?;
8484
let is_telemetry_disabled = value.is_some();
85-
tracing::debug!(is_telemetry_disabled);
85+
if is_telemetry_disabled {
86+
tracing::info!("Telemetry has been disabled.");
87+
} else {
88+
tracing::info!("Telemetry is enabled. To disable, set ${}=1", RoverEnvKey::TelemetryDisabled.to_string())
89+
}
8690
Ok(!is_telemetry_disabled)
8791
}
8892

src/utils/version.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,18 @@ pub fn check_for_update(config: config::Config, force: bool) -> Result<()> {
3131
do_update_check(&mut checked, force)?;
3232
} else if let Some(last_checked_time) = last_checked_time {
3333
let time_since_check = current_time.duration_since(last_checked_time)?.as_secs();
34-
tracing::debug!(
34+
tracing::trace!(
3535
"Time since last update check: {:?}h",
3636
time_since_check / ONE_HOUR
3737
);
3838

3939
if time_since_check > ONE_DAY {
4040
do_update_check(&mut checked, force)?;
41-
} else {
42-
tracing::debug!("No need to check for updates. Automatic checks happen once per day");
4341
}
4442
}
4543

4644
if checked {
47-
tracing::debug!("Checked for available updates. Writing current time to disk");
45+
tracing::trace!("Checked for available updates. Writing current time to disk");
4846
fs::write(&version_file, toml::to_string(&current_time)?)?;
4947
}
5048

0 commit comments

Comments
 (0)