mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-14 23:34:08 +00:00
libobs: Add date/time to crash handler
This commit is contained in:
parent
39a91d749c
commit
523e1ace49
|
@ -16,6 +16,7 @@
|
|||
******************************************************************************/
|
||||
|
||||
#include <windows.h>
|
||||
#include <time.h>
|
||||
#include <dbghelp.h>
|
||||
#include <shellapi.h>
|
||||
#include <tlhelp32.h>
|
||||
|
@ -248,12 +249,20 @@ static inline void init_module_info(struct exception_handler_data *data)
|
|||
|
||||
static inline void write_header(struct exception_handler_data *data)
|
||||
{
|
||||
char date_time[80];
|
||||
time_t now = time(0);
|
||||
struct tm ts;
|
||||
ts = *localtime(&now);
|
||||
strftime(date_time, sizeof(date_time), "%Y-%m-%d, %X", &ts);
|
||||
|
||||
dstr_catf(&data->str, "Unhandled exception: %x\r\n"
|
||||
"Date/Time: %s\r\n"
|
||||
"Fault address: %"PRIX64" (%s)\r\n"
|
||||
"libobs version: "OBS_VERSION"\r\n"
|
||||
"Windows version: %d.%d build %d (revision %d)\r\n"
|
||||
"CPU: %s\r\n\r\n",
|
||||
data->exception->ExceptionRecord->ExceptionCode,
|
||||
date_time,
|
||||
data->main_trace.instruction_ptr,
|
||||
data->module_name.array,
|
||||
data->win_version.major, data->win_version.minor,
|
||||
|
|
Loading…
Reference in a new issue