2 #include "util/mutex.h" 5 #define MAX_DEBUG_STRING_LENGTH 1024 25 static const char *
const NA;
26 static const char *
const NA_METHOD;
37 const char *
const functionName,
64 const std::string getClassName();
70 const char * getFileName();
79 const std::string getMethodName();
82 void write(
CLogger* pOutput)
const;
89 const char * fileName;
92 const char * methodName;
97 #pragma warning( push ) 99 #pragma warning( disable : 4251 ) 114 static CLogger& GetSingleton();
119 void AddLogStr(
const char * pStr);
120 void AddLogStr(
const wchar_t * pStr);
123 void AddLogStr_st(
const char * pStr);
124 void AddLogStr_st(
const wchar_t * pStr);
127 void SetLogFile(
const std::string& sFile);
128 const std::string& GetLogFile();
133 void WriteFormated(
const char *, ...);
134 void WriteFormatedVarList(
const char *, va_list args);
135 void WriteFormated(
const wchar_t *, ...);
136 void WriteFormated_WithTime(
const char *, ...);
139 void WriteFormated_st(
const char *, ...);
140 void WriteFormated_st(
const wchar_t *, ...);
148 int Write(
const char * buf,
int nLength);
151 int Write_st(
const char * buf,
int nLength);
163 const char* GetLog(
int fromPos,
int nCount);
169 FILE* GetLogFileHandle();
175 void WriteDebugStr(
const char * zFormat,
const char * str,
const char* sFile,
int nLine);
181 const std::string& GetName();
185 void SetAppendMode(
bool bAppendToExistingFile);
190 void SetForceFlush(
bool bForceFlush);
199 void SetLevel(
const int level1);
205 bool IsEnabledFor(
int level);
214 void log(
const int level,
const std::string& message,
216 void log(
const int level,
const char* message,
225 void log(
const int level,
const std::string& message);
226 void log(
const int level,
const char* message);
235 void ForcedLog(
const int level,
const std::string& message,
237 void ForcedLog(
const int level,
const char* message,
245 void ForcedLog(
const int level,
const std::string& message);
246 void ForcedLog(
const int level,
const char* message);
250 std::string m_log_file_name;
254 char m_buffer[MAX_DEBUG_STRING_LENGTH*2+2];
258 bool m_is_first_time_open;
273 #pragma warning( pop ) 279 #define OUTPUT_LOG ParaEngine::CLogger::GetSingleton().WriteFormated 283 #define OUTPUT_LOG1 ParaEngine::CLogger::GetSingleton().WriteFormated_WithTime 286 #define OUTPUT_DEBUG(a) ParaEngine::CLogger::GetSingleton().WriteDebugStr("%s called from %s:%d\n",a, __FILE__,__LINE__); 288 #define OUTPUT_DEBUG(a) 292 #if !defined(SERVICE_LOG_LOCATION) 293 #if defined(_MSC_VER) 295 #define __SERVICE_LOG_FUNC__ __FUNCSIG__ 298 #if defined(__GNUC__) 299 #define __SERVICE_LOG_FUNC__ __PRETTY_FUNCTION__ 302 #if !defined(__SERVICE_LOG_FUNC__) 303 #define __SERVICE_LOG_FUNC__ "" 305 #define SERVICE_LOG_LOCATION ParaEngine::LogDetail::LocationInfo(__FILE__, \ 306 __SERVICE_LOG_FUNC__, \ 315 #define APP_LOG(message) ParaEngine::CLogger::GetSingleton().ForcedLog(0, message, SERVICE_LOG_LOCATION); different physics engine has different winding order.
Definition: EventBinding.h:32
int m_level
The assigned level of this logger.
Definition: Log.h:269
bool m_bForceFlush
if true we will flush the new log to file immediately.
Definition: Log.h:262
static const char *const NA
When location information is not available the constant NA is returned.
Definition: Log.h:25
This class represents the location of a logging statement.
Definition: Log.h:17
cross platform mutex
Definition: mutex.h:95
std::string m_name
The name of this logger.
Definition: Log.h:265
a logger can only write to a given file.
Definition: Log.h:107