Display debug log messages in Visual Studio Output window

pEpMIME_windows
Thomas 4 years ago
parent 2900201550
commit 9c222d9d12

@ -2024,6 +2024,10 @@ DYNAMIC_API PEP_STATUS log_event(
)
{
#if defined(_WIN32) && !defined(NDEBUG)
log_output_debug(title, entity, description, comment);
#endif
// N.B. If testing (so NDEBUG not defined) but this message is spam,
// put -D_PEP_SERVICE_LOG_OFF into CFLAGS/CXXFLAGS
#if !defined(NDEBUG) && !defined(_PEP_SERVICE_LOG_OFF)

@ -372,6 +372,18 @@ void uuid_unparse_upper(pEpUUID uu, uuid_string_t out)
}
}
void log_output_debug(const char *title,
const char *entity,
const char *description,
const char *comment)
{
const size_t size = 256;
char str[size];
snprintf(str, size, "*** %s %s %s %s\n", title, entity, description, comment);
OutputDebugStringA(str);
}
time_t timegm(struct tm* tm) {
return _mkgmtime(tm);
}

@ -81,6 +81,8 @@ const char *windoze_system_db(void);
const char *gpg_conf(void);
const char *gpg_agent_conf(void);
void log_output_debug(const char *title, const char *entity, const char *description, const char *comment);
long random(void);
// on Windoze, uuid_t needs pointer semantics

Loading…
Cancel
Save