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:
@@ -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
|
||||
|
||||
@@ -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);}
|
||||
|
||||
Reference in New Issue
Block a user