in src/dxapi/native/util/logger.cpp [177:220]
void dbg_logdata_full(struct Logger * const self, const _LogDesc_ * const l, va_list arg, const void * const data, unsigned datalen)
{
SYSTEMTIME st;
char hms[32];
char msg[512];
if (NULL == self) {
return;
}
if (self->mode) {
DxCriticalSectionEnterSpin(&self->crit_section);
GetLocalTime(&st);
/*fprintf(hb_debugfile, "[%02d:%02d:%02d.%03d] ",
st.wHour, st.wMinute, st.wSecond, st.wMilliseconds );*/
sprintf(hms, "%02d-%02d %02d:%02d:%02d", st.wMonth, st.wDay,
st.wHour, st.wMinute, st.wSecond);
fprintf(self->file, "[%s.%03d] ",
hms, st.wMilliseconds);
if (l->level >= _LOG_ERROR)
fprintf(self->file, "ERROR in ");
vsnprintf(msg, sizeof(msg), l->fmt, arg);
msg[sizeof(msg) - 1] = '\0';
if (l->file) {
fprintf(self->file, "%s:%d\n\t%s\n", l->file, l->line, msg);
}
else {
fprintf(self->file, "\n\t%s\n", msg);
}
if (datalen) {
binlog(self, data, datalen);
}
fflush(self->file);
// TODO: move into debug object property!!!! (or not)
#ifdef LOG_SIZE_LIMIT
sizecheck(debug);
#endif // LOG_SIZE_LIMIT
DxCriticalSectionLeave(&self->crit_section);
}
}