1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2025-12-21 18:53:32 +00:00

Added ability to log control channel messages

This commit is contained in:
Bryan Roe
2019-02-14 14:03:33 -08:00
parent ed92a0b21c
commit b9af163039
4 changed files with 80 additions and 7 deletions

View File

@@ -9355,6 +9355,18 @@ char* ILibCriticalLog (const char* msg, const char* file, int line, int user1, i
}
return(ILibCriticalLogBuffer);
}
void ILIBLOGMESSAGEX(char *format, ...)
{
char dest[4096];
int len = 0;
va_list argptr;
va_start(argptr, format);
len += vsnprintf(dest + len, sizeof(dest) - len, format, argptr);
va_end(argptr);
ILIBLOGMESSSAGE(dest);
}
//! Platform Agnostic method to Spawn a detached worker thread with normal priority/affinity
/*!
\param method Handler to dispatch on the new thread

View File

@@ -1370,6 +1370,8 @@ int ILibIsRunningOnChainThread(void* chain);
#define ILIBCRITICALEXITMSG(code, msg) {printf("%s", ILibCriticalLog(msg, NULL, 0, 0, 0)); exit(code);}
#define ILIBLOGMESSSAGE(msg) ILibCriticalLog(msg, NULL, 0, 0, 0)
void ILIBLOGMESSAGEX(char *format, ...);
#if defined(WIN32)
#define ILIBCRITICALERREXIT(ex) { ILibCriticalLog(NULL, __FILE__, __LINE__, GetLastError(), 0); exit(ex); }
#define ILIBCRITICALEXIT(ex) {ILibCriticalLog(NULL, __FILE__, __LINE__, ex, GetLastError());printf("CRITICALEXIT, FILE: %s, LINE: %d\r\n", __FILE__, __LINE__); exit(ex);}