Writes out the supplied chain to the logfile 'as is' with no time-stamp or other supporting information.
| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzLogger::Out | (hzChain&,) |
Declared in file: hzProcess.h
Defined in file : hzLogger.cpp
Function Logic:
Function body:
hzEcode hzLogger::Out (hzChain& Z)
{
// Writes out the supplied chain to the logfile 'as is' with no time-stamp or other supporting information.
//
// Arguments: 1) Z Chain to output to logfile
//
// 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("hzLogger::Out(hzChain)") ;
hzChain::Iter zi ; // Message chain iterator
char* i ; // For population of buffer
uint32_t nBytes ; // Number of bytes in buffer
hzEcode rc = E_OK ; // Return code
if (!_hzGlobal_currProc)
{
printf("Fatal - no current process\n") ;
exit(-1);
}
if (Z.Size())
{
m_Lock.Lock() ;
_logrotate() ;
if (m_bVerbose)
std::cout << Z ;
if (m_pFile)
{
for (zi = Z ; rc == E_OK && !zi.eof() ;)
{
for (i = m_pDataPtr, nBytes = 0; !zi.eof() && nBytes < HZ_LOGCHUNK ; nBytes++, zi++)
*i++ = *zi ;
if (!nBytes)
break ;
m_pDataPtr[nBytes] = 0;
rc = _write(nBytes) ;
}
}
m_Lock.Unlock() ;
}
return rc ;
}