add switch to override default logs folder

This commit is contained in:
Nikita Smith
2026-06-02 12:10:04 -07:00
committed by Ryan Fleury
parent b4dd1f6fd3
commit b23323c03d
5 changed files with 32 additions and 22 deletions
+6 -11
View File
@@ -53,17 +53,12 @@ d_init(void)
d_ctrl_state->c2u_ring_size = KB(64);
d_ctrl_state->c2u_ring_max_string_size = d_ctrl_state->c2u_ring_size/2;
d_ctrl_state->c2u_ring_base = push_array_no_zero(arena, U8, d_ctrl_state->c2u_ring_size);
d_ctrl_state->c2u_ring_mutex = mutex_alloc();
d_ctrl_state->c2u_ring_cv = cond_var_alloc();
{
Temp scratch = scratch_begin(0, 0);
String8 user_program_data_path = get_process_info()->user_program_data_path;
String8 user_data_folder = push_str8f(scratch.arena, "%S/%Sraddbg/logs", user_program_data_path, program_data_folder_prefix_from_os(OperatingSystem_CURRENT));
make_directory(user_data_folder);
d_ctrl_state->ctrl_thread_log_path = push_str8f(d_ctrl_state->arena, "%S/ctrl_thread.raddbg_log", user_data_folder);
write_data_to_file_path(d_ctrl_state->ctrl_thread_log_path, str8_zero());
scratch_end(scratch);
}
d_ctrl_state->c2u_ring_mutex = mutex_alloc();
d_ctrl_state->c2u_ring_cv = cond_var_alloc();
{
d_ctrl_state->ctrl_thread_log_path = push_str8f(d_ctrl_state->arena, "%S/ctrl_thread.raddbg_log", g_logs_folder);
write_data_to_file_path(d_ctrl_state->ctrl_thread_log_path, str8_zero());
}
d_ctrl_state->ctrl_thread_entity_ctx_rw_mutex = rw_mutex_alloc();
d_ctrl_state->ctrl_thread_entity_store = d_entity_ctx_rw_store_alloc();
d_ctrl_state->ctrl_thread_eval_cache = e_cache_alloc();