Skip to content

Commit

Permalink
debug: use timestamp for log file names
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanaz committed Jan 12, 2025
1 parent cf0826b commit f5bcaa9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/dll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@ pub unsafe extern "system" fn DllGetClassObject(
#[cfg(debug_assertions)]
{
// Set up logging to the project directory.
use std::time::SystemTime;
let duration = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH);
if duration.is_err() {
return E_UNEXPECTED;
}
let secs = duration.unwrap().as_secs();
let dir = env!("CARGO_MANIFEST_DIR");
simple_logging::log_to_file(
format!("{}\\debug.log", env!("CARGO_MANIFEST_DIR")),
format!("{dir}\\debug-{secs}.log"),
log::LevelFilter::Trace,
)
.unwrap();
Expand Down

0 comments on commit f5bcaa9

Please sign in to comment.