OpenClonk
C4Log.h
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de/
5  * Copyright (c) 2009-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 
17 /* Log file handling */
18 
19 #ifndef INC_C4Log
20 #define INC_C4Log
21 
22 bool OpenLog();
23 bool OpenExtraLogs();
24 bool CloseLog();
25 
26 bool Log(const char *szMessage);
27 bool LogSilent(const char *szMessage);
28 bool LogF(const char *strMessage, ...) GNUC_FORMAT_ATTRIBUTE;
29 bool LogSilentF(const char *strMessage, ...) GNUC_FORMAT_ATTRIBUTE;
30 bool DebugLog(const char *strMessage);
31 bool DebugLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE;
32 bool ShaderLog(const char *strMessage);
33 bool ShaderLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE;
34 
35 bool LogFatal(const char *szMessage); // log message and store it as a fatal error
36 void ResetFatalError(); // clear any fatal error message
37 const char *GetFatalError(); // return message that was set as fatal error, if any
38 
39 size_t GetLogPos(); // get current log position;
40 bool GetLogSection(size_t iStart, size_t iLength, StdStrBuf &rsOut); // re-read log data from file
41 
42 // Used to print a backtrace after a crash
43 int GetLogFD();
44 
45 #endif
bool OpenExtraLogs()
Definition: C4Log.cpp:83
void ResetFatalError()
Definition: C4Log.cpp:252
bool OpenLog()
Definition: C4Log.cpp:48
bool LogSilentF(const char *strMessage,...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:272
bool GetLogSection(size_t iStart, size_t iLength, StdStrBuf &rsOut)
Definition: C4Log.cpp:304
bool ShaderLog(const char *strMessage)
Definition: C4Log.cpp:343
bool LogF(const char *strMessage,...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:262
size_t GetLogPos()
Definition: C4Log.cpp:298
bool Log(const char *szMessage)
Definition: C4Log.cpp:204
bool DebugLog(const char *strMessage)
Definition: C4Log.cpp:282
bool CloseLog()
Definition: C4Log.cpp:107
const char * GetFatalError()
Definition: C4Log.cpp:257
bool ShaderLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:356
bool DebugLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:290
bool LogSilent(const char *szMessage)
Definition: C4Log.cpp:197
bool LogFatal(const char *szMessage)
Definition: C4Log.cpp:239
int GetLogFD()
Definition: C4Log.cpp:118
#define GNUC_FORMAT_ATTRIBUTE