| Return Type | Function name | Arguments |
|---|---|---|
| hzEcode | hzLogger::OpenFile | (const char*,hzLogRotate,) |
Declared in file: hzProcess.h
Defined in file : hzLogger.cpp
Function Logic:
Function body:
hzEcode hzLogger::OpenFile (const char* fpath, hzLogRotate eRotate)
{
_hzfunc("hzLogger::OpenFile") ;
char cvDir [HZ_MAXPATHLEN] ;
char* cpCWD ;
if (!fpath || !fpath[0])
hzexit(E_ARGUMENT, "No path supplied") ;
if (IsOpen())
hzexit(E_INITDUP, "%s: This log channel is already open", fpath) ;
if (fpath[0]== CHAR_FWSLASH)
m_Base = fpath ;
else
{
cpCWD = getcwd(cvDir, HZ_MAXPATHLEN) ;
for (; *cpCWD ; cpCWD++) ;
*cpCWD++ = CHAR_FWSLASH ;
strcpy(cpCWD, fpath) ;
m_Base = cvDir ;
}
m_nSessID = 0;
m_eRotate = eRotate ;
m_pDataPtr = m_cvData ;
return E_OK ;
}