-
Notifications
You must be signed in to change notification settings - Fork 2
Always create initial logging directory.[CPP-407] #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
96d65b5
to
6671d54
Compare
6671d54
to
6aef1b3
Compare
Some(logger) | ||
} | ||
Err(e) => { | ||
error!("issue creating file, {:?}, error, {}", sbp_log_file, e); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not 100% certain but I think the double slashes are due to using the Debug
to format the path. I think using Path::display would give you single slashes.
error!("issue creating file, {}, error, {}", sbp_json_log_file.display(), e);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You were 100% correct this make for a much cleaner solution thank you!
console_backend/src/utils.rs
Outdated
|
||
/// Formats a pathbuf replacing double backslahes with single forward slashes. | ||
pub fn pathbuf_to_unix_filepath(path: PathBuf) -> PathBuf { | ||
PathBuf::from(path.to_string_lossy().replace("\\", "/")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forward slashes are not the typical path separator for Windows. Whatever we implement should display a single backslash for Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that is the behavior of Path::display
, single forward slash on unix and single backslash on windows. I think the double slash is just the Debug
impl showing you the escape character
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to using .display for all occurrences I could find throughout the app.
1a00fb4
to
4997a36
Compare
Uh oh!
There was an error while loading. Please reload this page.