[][src]Function win_dbg_logger::rust_win_dbg_logger_init_debug

#[no_mangle]pub extern "C" fn rust_win_dbg_logger_init_debug()

This can be called from C/C++ code to register the debug logger.

For Windows DLLs that have statically linked an instance of win_dbg_logger into them, DllMain should call win_dbg_logger_init_<level>() from the DLL_PROCESS_ATTACH handler. For example:

This example is not tested
// Calls into Rust code.
extern "C" void __cdecl rust_win_dbg_logger_init_debug();

BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD reason, LPVOID reserved) {
    switch (reason) {
        case DLL_PROCESS_ATTACH:
            rust_win_dbg_logger_init_debug();
            // ...
    }
    // ...
}

For Windows executables that have statically linked an instance of win_dbg_logger into them, call win_dbg_logger_init_<level>() during app startup.