Skip to content

Commit 28f76e4

Browse files
thomasywangmeta-codesync[bot]
authored andcommitted
Fix log file suffix (#2146)
Summary: Pull Request resolved: #2146 This has been manifesting as "monarch_log_.log" when we intend an empty suffix to just be "monarch_log.log" Reviewed By: zdevito Differential Revision: D89216922 fbshipit-source-id: c5b0847069191dbd94d35a8c340b93d961e58e65
1 parent b5314c5 commit 28f76e4

File tree

1 file changed

+9
-1
lines changed
  • hyperactor_telemetry/src

1 file changed

+9
-1
lines changed

hyperactor_telemetry/src/lib.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,15 @@ pub fn log_file_path(
199199
env: env::Env,
200200
suffix: Option<&str>,
201201
) -> Result<(String, String), anyhow::Error> {
202-
let suffix = suffix.map(|s| format!("_{}", s)).unwrap_or_default();
202+
let suffix = suffix
203+
.map(|s| {
204+
if s.is_empty() {
205+
String::new()
206+
} else {
207+
format!("_{}", s)
208+
}
209+
})
210+
.unwrap_or_default();
203211
match env {
204212
env::Env::Local | env::Env::MastEmulator => {
205213
let username = if whoami::username().is_empty() {

0 commit comments

Comments
 (0)