OpenClonk
C4SimpleLog.cpp
Go to the documentation of this file.
1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2005, Günther Brammer
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 // Implement a simplified version of Log so that we don't get undefined
18 // references when e.g. StdFile attempts to call it - we are not compiling
19 // C4Log.cpp into the small utility programs because it pulls in a whole
20 // lot of other dependencies.
21 
22 #include "C4Include.h"
23 #include "lib/C4Log.h"
24 
25 bool fQuiet = false;
26 
27 bool Log(const char *msg)
28 {
29  if (!fQuiet)
30  printf("%s\n", msg);
31  return true;
32 }
33 bool DebugLog(const char *strMessage) { return Log(strMessage); }
34 bool LogFatal(const char *strMessage) { return Log(strMessage); }
35 
36 #define IMPLEMENT_LOGF(func) \
37  bool func(const char *msg, ...) { \
38  va_list args; va_start(args, msg); \
39  StdStrBuf Buf; \
40  Buf.FormatV(msg, args); \
41  return Log(Buf.getData()); \
42  }
43 
47 
bool LogSilentF(const char *strMessage,...)
Definition: C4Log.cpp:272
bool LogF(const char *strMessage,...)
Definition: C4Log.cpp:262
bool DebugLogF(const char *strMessage ...)
Definition: C4Log.cpp:290
bool Log(const char *msg)
Definition: C4SimpleLog.cpp:27
bool DebugLog(const char *strMessage)
Definition: C4SimpleLog.cpp:33
bool LogFatal(const char *strMessage)
Definition: C4SimpleLog.cpp:34
#define IMPLEMENT_LOGF(func)
Definition: C4SimpleLog.cpp:36
bool fQuiet
Definition: C4SimpleLog.cpp:25