OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
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 #include "lib/StdBuf.h"
23 
24 bool OpenLog();
25 bool OpenExtraLogs();
26 bool CloseLog();
27 
28 bool Log(const char *szMessage);
29 bool LogSilent(const char *szMessage);
30 bool LogF(const char *strMessage, ...) GNUC_FORMAT_ATTRIBUTE;
31 bool LogSilentF(const char *strMessage, ...) GNUC_FORMAT_ATTRIBUTE;
32 bool DebugLog(const char *strMessage);
33 bool DebugLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE;
34 bool ShaderLog(const char *strMessage);
35 bool ShaderLogF(const char *strMessage ...) GNUC_FORMAT_ATTRIBUTE;
36 
37 bool LogFatal(const char *szMessage); // log message and store it as a fatal error
38 void ResetFatalError(); // clear any fatal error message
39 const char *GetFatalError(); // return message that was set as fatal error, if any
40 
41 size_t GetLogPos(); // get current log position;
42 bool GetLogSection(size_t iStart, size_t iLength, StdStrBuf &rsOut); // re-read log data from file
43 
44 // Used to print a backtrace after a crash
45 int GetLogFD();
46 
47 #endif
size_t GetLogPos()
Definition: C4Log.cpp:289
#define GNUC_FORMAT_ATTRIBUTE
int GetLogFD()
Definition: C4Log.cpp:109
bool ShaderLogF(const char *strMessage...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:347
const char * GetFatalError()
Definition: C4Log.cpp:248
bool GetLogSection(size_t iStart, size_t iLength, StdStrBuf &rsOut)
Definition: C4Log.cpp:295
bool DebugLogF(const char *strMessage...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:281
bool ShaderLog(const char *strMessage)
Definition: C4Log.cpp:334
bool OpenLog()
Definition: C4Log.cpp:51
bool LogFatal(const char *szMessage)
Definition: C4Log.cpp:230
void ResetFatalError()
Definition: C4Log.cpp:243
bool LogF(const char *strMessage,...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:253
bool LogSilent(const char *szMessage)
Definition: C4Log.cpp:188
bool LogSilentF(const char *strMessage,...) GNUC_FORMAT_ATTRIBUTE
Definition: C4Log.cpp:263
bool OpenExtraLogs()
Definition: C4Log.cpp:76
bool DebugLog(const char *strMessage)
Definition: C4Log.cpp:273
bool CloseLog()
Definition: C4Log.cpp:100
bool Log(const char *szMessage)
Definition: C4Log.cpp:195