Write message supplied as a vararg CStr to the defualt log-channel of the current thread. If there is no defualt log-channel open, the message is written to stdout.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | threadLog | (const char*,) |
Declared in file: hzProcess.h
Defined in file : hzLogger.cpp
Function Logic:
Function body:
hzEcode threadLog (const char* va_alist)
{
// Category: Diagnostics
//
// Write message supplied as a vararg CStr to the defualt log-channel of the current thread. If there is no defualt log-channel open, the message is written to stdout.
//
// Arguments: 1) va_alist Variable args format string
//
// Returns: E_SENDFAIL If logging is to the logserver and could not be sent
// E_RECVFAIL If logging is to the logserver and acknowledgemnt was not recieved
// E_PROTOCOL If logging is to the logserver and said logserver did not observe protocol
// E_OK If the log action was completed
// _hzfunc("threadLog(va_alist)") ;
va_list ap ; // Variable argument list
hzLogger* plog ; // The calling thread's logfile
hzChain errmsg ; // The log message
// Do the varargs
va_start(ap, va_alist) ;
errmsg._vainto(va_alist, ap) ;
va_end(ap) ;
// Obtain the log if available
plog = GetThreadLogger() ;
if (!plog)
{
std::cout << errmsg ;
fflush(stdout) ;
return E_NOINIT ;
}
// Do the log
return plog->Log(errmsg) ;
}