www.pudn.com > remote_thread.zip > Log.h
// Log.h: interface for the CLog class. // ////////////////////////////////////////////////////////////////////// #if !defined(AFX_LOG_H__E94CE6DC_662A_4988_A4DB_71D80ECF7B73__INCLUDED_) #define AFX_LOG_H__E94CE6DC_662A_4988_A4DB_71D80ECF7B73__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #define MLLOG(s) "%s(%d):\n%s", __FILE__, __LINE__, s #ifdef _DEBUG #define PrintLog g_log.Print #else #define PrintLog #endif // _DEBUG #includeclass CLog { public: CLog(); ~CLog(); inline void Print(const char* format, ...) { va_list ap; va_start(ap, format); ReallyPrint(format, ap); va_end(ap); } private: void ReallyPrintLine(char* line); void ReallyPrint(const char* format, va_list ap); }; extern CLog g_log; #endif // !defined(AFX_LOG_H__E94CE6DC_662A_4988_A4DB_71D80ECF7B73__INCLUDED_)