DayZ Enforce
Script API
Static Private Member Functions | Static Private Attributes | List of all members
DebugPrint Class Reference

#include <DebugPrint.h>

Static Private Member Functions

static void  OnInit ()
 
static void  OnDestroy ()
 
static void  Log (string msg)
  Prints debug message with normal prio. More...
 
static void  LogAndTrace (string msg)
  Prints debug message as normal message and prints stack trace of calls. More...
 
static void  LogWarning (string msg)
  Prints debug message as warning message. More...
 
static void  LogWarningAndTrace (string msg)
  Prints debug message as warning message and prints stack trace of calls. More...
 
static void  LogError (string msg)
  Prints debug message as error message. More...
 
static void  LogErrorAndTrace (string msg)
  Prints debug message as error message and prints stack trace of calls. More...
 
static string  AdjustDebugLog (string msg)
  Function adjust received message for debug console (Do not use) More...
 
static string  EnableTracingLogs (bool enable)
 
static private bool  IsDebugLog (string msg)
 
static private string  TrimDebugLog (string msg)
 
static private bool  IsStackTrace (string msg)
 
static private string  TrimStackTrace (string msg)
 
static private void  LogMessage (string msg, int msg_type, bool trace=false)
 

Static Private Attributes

static private const int  MSG_LOG = 0
 
static private const int  MSG_WARNING = 1
 
static private const int  MSG_ERROR = 2
 
static private const int  MSG_COUNT = 3
 
static private string  s_MsgPrefix [MSG_COUNT]
 
static private string  s_MsgStackMarkStart
 
static private string  s_MsgStackMarkEnd
 
static private bool  s_MsgStackMarked
 
static private bool  s_TraceAllLogs
 

Member Function Documentation

static void DebugPrint::OnInit ( )
staticprivate

References MSG_ERROR, MSG_LOG, and MSG_WARNING.

static void DebugPrint::OnDestroy ( )
staticprivate
static void DebugPrint::Log ( string  msg )
staticprivate

Prints debug message with normal prio.

Parameters
msg string Debug message for print
Returns
void None
DebugPrint.Log("Hello World");
>> [Log]: Hello World;

References LogMessage(), MSG_LOG, and s_TraceAllLogs.

static void DebugPrint::LogAndTrace ( string  msg )
staticprivate

Prints debug message as normal message and prints stack trace of calls.

Parameters
msg string Debug message for print
Returns
void None
DebugPrint.LogAndTrace("Hello World, this is normal log");
>> [Log]: Hello World, this is normal log
>> -- Stack trace --
>> OnKeyPress() Scripts/mission/missionGameplay.c : 230
>> OnKeyPress() Scripts/DayZGame.c : 346
>> -----------------

References LogMessage(), and MSG_LOG.

static void DebugPrint::LogWarning ( string  msg )
staticprivate

Prints debug message as warning message.

Parameters
msg string Debug message for warning print
Returns
void None
DebugPrint.LogWarning("Hello World, this is warning log");
>> [Warning]: Hello World, this is warning log

References LogMessage(), MSG_WARNING, and s_TraceAllLogs.

static void DebugPrint::LogWarningAndTrace ( string  msg )
staticprivate

Prints debug message as warning message and prints stack trace of calls.

Parameters
msg string Debug message for warning print
Returns
void None
DebugPrint.LogWarningAndTrace("Hello World, this is warning log");
>> [Warning]: Hello World, this is warning log
>> -- Stack trace --
>> OnKeyPress() Scripts/mission/missionGameplay.c : 230
>> OnKeyPress() Scripts/DayZGame.c : 346
>> -----------------

References LogMessage(), and MSG_WARNING.

static void DebugPrint::LogError ( string  msg )
staticprivate

Prints debug message as error message.

Parameters
msg string Debug message for error print
Returns
void None
DebugPrint.LogError("Hello World, this is error log");
>> [Error]: Hello World, this is error log

References LogMessage(), MSG_ERROR, and s_TraceAllLogs.

static void DebugPrint::LogErrorAndTrace ( string  msg )
staticprivate

Prints debug message as error message and prints stack trace of calls.

Parameters
msg string Debug message for error print
Returns
void None
DebugPrint.LogErrorAndTrace("Hello World, this is error log");
>> [Error]: Hello World, this is error log
>> -- Stack trace --
>> OnKeyPress() Scripts/mission/missionGameplay.c : 230
>> OnKeyPress() Scripts/DayZGame.c : 346
>> -----------------

References LogMessage(), and MSG_ERROR.

static string DebugPrint::AdjustDebugLog ( string  msg )
staticprivate

Function adjust received message for debug console (Do not use)

Parameters
msg string Message for adjust
Returns
string Adjusted Message
string msg = DebugPrint.AdjustDebugLog("s = 'Hello World, this is error log'");
>> Hello World, this is error log

References IsDebugLog(), IsStackTrace(), TrimDebugLog(), and TrimStackTrace().

static string DebugPrint::EnableTracingLogs ( bool  enable )
staticprivate

References s_TraceAllLogs.

static private bool DebugPrint::IsDebugLog ( string  msg )
staticprivate

References EnString::Contains(), MSG_COUNT, and s_MsgPrefix.

Referenced by AdjustDebugLog().

static private string DebugPrint::TrimDebugLog ( string  msg )
staticprivate
static private bool DebugPrint::IsStackTrace ( string  msg )
staticprivate
static private string DebugPrint::TrimStackTrace ( string  msg )
staticprivate

References EnString::Contains(), and EnString::Empty.

Referenced by AdjustDebugLog().

static private void DebugPrint::LogMessage ( string  msg,
int  msg_type,
bool  trace = false 
)
staticprivate

Member Data Documentation

private const int DebugPrint::MSG_LOG = 0
staticprivate

Referenced by Log(), LogAndTrace(), and OnInit().

private const int DebugPrint::MSG_WARNING = 1
staticprivate
private const int DebugPrint::MSG_ERROR = 2
staticprivate

Referenced by LogError(), LogErrorAndTrace(), and OnInit().

private const int DebugPrint::MSG_COUNT = 3
staticprivate

Referenced by IsDebugLog().

private string DebugPrint::s_MsgPrefix[MSG_COUNT]
staticprivate

Referenced by IsDebugLog(), and LogMessage().

private string DebugPrint::s_MsgStackMarkStart
staticprivate

Referenced by IsStackTrace().

private string DebugPrint::s_MsgStackMarkEnd
staticprivate

Referenced by IsStackTrace().

private bool DebugPrint::s_MsgStackMarked
staticprivate

Referenced by IsStackTrace().

private bool DebugPrint::s_TraceAllLogs
staticprivate

The documentation for this class was generated from the following files:
Converted from CHM to HTML with chm2web Pro 2.85 (unicode)