|
/********************************************************************\
created: 2001/03/22
created: 22:3:2001 20:20
filename: c:\my projects\dualmagic\controlappl\include\cfunclog.h
file path: c:\my projects\dualmagic\controlappl\include
file base: cfunclog
file ext: h
author: Alex Kucherenko
purpose:
\********************************************************************/
#ifndef _LOG_SYSTEM_FUNCTION_LOG_H_
#define _LOG_SYSTEM_FUNCTION_LOG_H_
#include <string>
#include "CLog.h"
class CFuncLog
{
public:
CFuncLog( CLog *pLog, std::string FunctionName )
{
m_pLog = pLog;
m_strFuncName = FunctionName.c_str();
if( m_pLog != NULL )
m_pLog->LogString( 2, std::string( FunctionName + " enter\n" ) );
};
~CFuncLog( )
{
if( m_pLog != NULL )
m_pLog->LogString( 2, std::string( m_strFuncName + " leave\n" ) );
m_pLog = NULL;
};
int LogString( long Level, std::string Message )
{
int retValue = 0;
if( m_pLog != NULL )
retValue = m_pLog->LogString( Level, m_strFuncName + Message.c_str() );
return retValue;
};
std::string FormatString( std::string Format, ... )
{
va_list args;
va_start( args, Format );
std::string RetValue;
if( m_pLog != NULL )
RetValue = m_pLog->LogFormatString( Format, args );
va_end( args );
return RetValue;
}
private:
std::string m_strFuncName;
CLog *m_pLog;
};
#endif /* _LOG_SYSTEM_FUNCTION_LOG_H_ */
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.