102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
dttr_log.h File Reference
#include <log.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define DTTR_LOG_AT(level, ...)
#define DTTR_LOG_TRACE(...)
#define DTTR_LOG_DEBUG(...)
#define DTTR_LOG_INFO(...)
#define DTTR_LOG_WARN(...)
#define DTTR_LOG_ERROR(...)
#define DTTR_LOG_FATAL(...)

Functions

bool DTTR_Log_IsEnabled (int level)
void DTTR_Log (int level, const char *file, int line, const char *fmt,...)
void DTTR_Log_Unchecked (int level, const char *file, int line, const char *fmt,...)
void DTTR_Log_SetLevel (int level)
int DTTR_Log_AddFP (FILE *fp, int level)

Macro Definition Documentation

◆ DTTR_LOG_AT

#define DTTR_LOG_AT ( level,
... )
Value:
do { \
if (DTTR_Log_IsEnabled(level)) { \
DTTR_Log_Unchecked(level, __FILE__, __LINE__, __VA_ARGS__); \
} \
} while (0)
bool DTTR_Log_IsEnabled(int level)
Definition log.c:79

Definition at line 20 of file dttr_log.h.

◆ DTTR_LOG_DEBUG

◆ DTTR_LOG_ERROR

#define DTTR_LOG_ERROR ( ...)
Value:
DTTR_LOG_AT(LOG_ERROR, __VA_ARGS__)

Definition at line 31 of file dttr_log.h.

Referenced by apply_rate(), audio_init_system(), begin_frame(), build_sidecar_shellcode(), compile_shader(), compute_exe_hash(), copy_memory_checked(), create_device(), create_fbo(), create_graphics_pipelines(), create_msaa_fbo(), create_program(), decode_prologue(), decode_until_video_frame(), decoder_init(), dttr_audio_init(), DTTR_Config_Load(), DTTR_Config_Save(), DTTR_Core_HookAttachFunction(), DTTR_Core_HookAttachPointer(), DTTR_Core_HookCleanupAll(), DTTR_Core_HookPatchBytes(), DTTR_CrashDump_Init(), DTTR_CrashDump_LogAndTraceReport(), DTTR_CrashDump_Write(), dttr_crt_hook_open_file_callback(), dttr_graphics_hooks_init(), dttr_graphics_init(), dttr_graphics_opengl_init(), dttr_graphics_sdl3gpu_create_pipelines(), dttr_graphics_sdl3gpu_create_resources(), dttr_graphics_sdl3gpu_init(), dttr_graphics_sdl3gpu_resize_render_textures(), dttr_hook_directdraw_create_ex_callback(), dttr_hook_resolve_pcdogs_path_callback(), DTTR_Hook_WinMainCallback(), dttr_inputs_handle_device_event(), dttr_inputs_hook_dinput_poll_callback(), dttr_inputs_hooks_init(), dttr_inputs_init(), dttr_launcher_main(), dttr_movies_init(), dttr_movies_start(), dttr_mss_ail_open_stream(), dttr_mss_ail_set_sample_file(), dttr_mss_ail_start_sample(), dttr_mss_ail_waveOutClose(), dttr_mss_core_ensure_mix_initialized(), dttr_mss_core_ensure_mixer(), dttr_mss_sdl_release_hooks(), errors_show(), extract_iso_file(), extract_iso_game_cache(), file_open_with_mode(), function_link_create(), function_link_detach(), handle_audio_device_added(), handle_audio_device_removed(), hook_create(), hook_detach_index(), initialize_shellcode_payload(), load_sample_audio_from_memory(), load_sdl(), log_win32_failure(), open_codec(), open_movie(), prepare_audio(), prepend_modules_to_path(), queue_audio_frame(), queue_video_frame(), read_entry_point_rva_from_remote_image(), read_remote_bytes(), receive_video_frame(), render_sample_audio(), require_pcdogs_call(), resize_fbo(), resolve_iso(), resolve_iso_direct(), resolve_sidecar_dll_path(), run_browse_dialog(), save_selected_path(), send_packet(), set_dump_dir(), set_env(), set_joystick_available(), store_pointer(), surface_texture_create_or_retain(), terminate_child(), trampoline_relocate(), try_configured_path(), try_create_device_for_driver(), try_fix_permissions(), try_open_configured_gamepad(), write_bytes(), write_function_jump(), and write_remote_payload().

◆ DTTR_LOG_FATAL

#define DTTR_LOG_FATAL ( ...)
Value:
DTTR_LOG_AT(LOG_FATAL, __VA_ARGS__)

Definition at line 32 of file dttr_log.h.

◆ DTTR_LOG_INFO

◆ DTTR_LOG_TRACE

◆ DTTR_LOG_WARN

Function Documentation

◆ DTTR_Log()

void DTTR_Log ( int level,
const char * file,
int line,
const char * fmt,
... )

Definition at line 125 of file log.c.

References DTTR_Log_IsEnabled(), dttr_vlog_unchecked(), and fmt.

◆ DTTR_Log_AddFP()

int DTTR_Log_AddFP ( FILE * fp,
int level )

Definition at line 161 of file log.c.

References add_log_callback(), and file_callback().

Referenced by DTTR_Hook_WinMainCallback(), and open_log_file().

◆ DTTR_Log_IsEnabled()

bool DTTR_Log_IsEnabled ( int level)

Definition at line 79 of file log.c.

References callback_count, callbacks, and current_log_level.

Referenced by DTTR_Log().

◆ DTTR_Log_SetLevel()

void DTTR_Log_SetLevel ( int level)

Definition at line 143 of file log.c.

References current_log_level.

Referenced by DTTR_Hook_WinMainCallback(), and dttr_launcher_main().

◆ DTTR_Log_Unchecked()

void DTTR_Log_Unchecked ( int level,
const char * file,
int line,
const char * fmt,
... )

Definition at line 136 of file log.c.

References dttr_vlog_unchecked(), and fmt.