OpenClonk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
log-handle.cpp File Reference
#include "C4Include.h"
#include "lib/C4Log.h"
Include dependency graph for log-handle.cpp:

Go to the source code of this file.

Macros

#define IMPLEMENT_LOGF(func)
 

Functions

bool Log (const char *msg)
 
bool DebugLog (const char *strMessage)
 
bool LogFatal (const char *strMessage)
 
void c4_log_handle_clear ()
 
const char * c4_log_handle_get_first_log_message ()
 
unsigned int c4_log_handle_get_n_log_messages ()
 

Variables

std::string first_log
 
unsigned int n_logs = 0
 

Macro Definition Documentation

#define IMPLEMENT_LOGF (   func)
Value:
bool func(const char *msg, ...) { \
va_list args; va_start(args, msg); \
StdStrBuf Buf; \
Buf.FormatV(msg, args); \
return Log(Buf.getData()); \
}
bool Log(const char *msg)
Definition: log-handle.cpp:24

Definition at line 40 of file log-handle.cpp.

Function Documentation

void c4_log_handle_clear ( )

Definition at line 55 of file log-handle.cpp.

References first_log, and n_logs.

Referenced by c4_mapgen_handle_new(), and c4_mapgen_handle_new_script().

56 {
57  first_log.clear();
58  n_logs = 0;
59 }
std::string first_log
Definition: log-handle.cpp:21
unsigned int n_logs
Definition: log-handle.cpp:22

Here is the caller graph for this function:

const char* c4_log_handle_get_first_log_message ( )

Definition at line 61 of file log-handle.cpp.

References first_log.

Referenced by c4_mapgen_handle_new(), and c4_mapgen_handle_new_script().

62 {
63  if(first_log.empty()) return nullptr;
64  return first_log.c_str();
65 }
std::string first_log
Definition: log-handle.cpp:21

Here is the caller graph for this function:

unsigned int c4_log_handle_get_n_log_messages ( )

Definition at line 67 of file log-handle.cpp.

References n_logs.

Referenced by c4_mapgen_handle_new(), and c4_mapgen_handle_new_script().

68 {
69  return n_logs;
70 }
unsigned int n_logs
Definition: log-handle.cpp:22

Here is the caller graph for this function:

bool DebugLog ( const char *  strMessage)

Definition at line 37 of file log-handle.cpp.

References C4Game::DebugMode, Game, Log(), and LogSilent().

37 { return Log(strMessage); }
bool Log(const char *msg)
Definition: log-handle.cpp:24

Here is the call graph for this function:

bool Log ( const char *  msg)

Definition at line 24 of file log-handle.cpp.

References Application, C4AbstractApp::AssertMainThread(), Console, first_log, C4AulDebug::GetDebugger(), C4Network2::GetLobby(), GraphicsSystem, iDisableLog, LogSilent(), C4GraphicsSystem::MessageBoard, n_logs, Network, C4GameLobby::MainDlg::OnLog(), and C4ConsoleGUI::Out().

Referenced by DebugLog(), and LogFatal().

25 {
26  if(first_log.empty())
27  {
28  assert(n_logs == 0);
29  first_log = msg;
30  }
31 
32  if(*msg != '\0')
33  ++n_logs;
34 
35  return true;
36 }
std::string first_log
Definition: log-handle.cpp:21
unsigned int n_logs
Definition: log-handle.cpp:22

Here is the call graph for this function:

Here is the caller graph for this function:

bool LogFatal ( const char *  strMessage)

Definition at line 38 of file log-handle.cpp.

References StdStrBuf::Append(), StdStrBuf::AppendChar(), FormatString(), StdStrBuf::getData(), StdStrBuf::isNull(), LoadResStr(), Log(), and SSearch().

38 { return Log(strMessage); }
bool Log(const char *msg)
Definition: log-handle.cpp:24

Here is the call graph for this function:

Variable Documentation

std::string first_log

Definition at line 21 of file log-handle.cpp.

Referenced by c4_log_handle_clear(), c4_log_handle_get_first_log_message(), and Log().

unsigned int n_logs = 0

Definition at line 22 of file log-handle.cpp.

Referenced by c4_log_handle_clear(), c4_log_handle_get_n_log_messages(), and Log().