Dayz Build 1.29.163047, Scripts Rev. 123548
Dayz Code Explorer by Zeroy
Loading...
Searching...
No Matches
DebugPrint Class Reference

Static Private Member Functions

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

Static Private Attributes

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

Detailed Description

Definition at line 1 of file debugprint.c.

Member Function Documentation

◆ AdjustDebugLog()

string AdjustDebugLog ( string msg)
inlinestaticprivate

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

Parameters
msgstring Message for adjust
Returns
string Adjusted Message
string msg = DebugPrint.AdjustDebugLog("s = 'Hello World, this is error log'");
>> Hello World, this is error log
static string AdjustDebugLog(string msg)
Function adjust received message for debug console (Do not use).
Definition debugprint.c:141
static void Log(string msg)
Prints debug message with normal prio.
Definition debugprint.c:37
Definition world.c:2

Definition at line 141 of file debugprint.c.

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

◆ EnableTracingLogs()

void EnableTracingLogs ( bool enable)
inlinestaticprivate

Definition at line 156 of file debugprint.c.

References s_TraceAllLogs.

◆ IsDebugLog()

bool IsDebugLog ( string msg)
inlinestaticprivate

Definition at line 161 of file debugprint.c.

References string::IndexOf(), MSG_COUNT, and s_MsgPrefix.

Referenced by AdjustDebugLog().

◆ IsStackTrace()

bool IsStackTrace ( string msg)
inlinestaticprivate

Definition at line 187 of file debugprint.c.

References string::IndexOf(), s_MsgStackMarked, s_MsgStackMarkEnd, and s_MsgStackMarkStart.

Referenced by AdjustDebugLog().

◆ Log()

void Log ( string msg)
inlinestaticprivate

Prints debug message with normal prio.

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

Definition at line 37 of file debugprint.c.

References LogMessage(), MSG_LOG, and s_TraceAllLogs.

◆ LogAndTrace()

void LogAndTrace ( string msg)
inlinestaticprivate

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

Parameters
msgstring 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
>> -----------------
static void LogAndTrace(string msg)
Prints debug message as normal message and prints stack trace of calls.
Definition debugprint.c:56
Mission mission

Definition at line 56 of file debugprint.c.

References LogMessage(), and MSG_LOG.

◆ LogError()

void LogError ( string msg)
inlinestaticprivate

Prints debug message as error message.

Parameters
msgstring Debug message for error print
Returns
void None
DebugPrint.LogError("Hello World, this is error log");
>> [Error]: Hello World, this is error log
static void LogError(string msg)
Prints debug message as error message.
Definition debugprint.c:105
void Error(string err)
Messagebox with error message.
Definition endebug.c:90

Definition at line 105 of file debugprint.c.

References LogMessage(), MSG_ERROR, and s_TraceAllLogs.

◆ LogErrorAndTrace()

void LogErrorAndTrace ( string msg)
inlinestaticprivate

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

Parameters
msgstring 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
>> -----------------
static void LogErrorAndTrace(string msg)
Prints debug message as error message and prints stack trace of calls.
Definition debugprint.c:124

Definition at line 124 of file debugprint.c.

References LogMessage(), and MSG_ERROR.

Referenced by OnlineServices::ErrorCaught(), OnlineServices::LoadFriends(), OnlineServices::LoadMPPrivilege(), OnlineServices::LoadPermissions(), OnlineServices::LoadServers(), OnlineServices::LoadVoicePrivilege(), OnlineServices::SetServerFavorited(), OnlineServices::ShowInviteScreen(), and OnlineServices::ShowUserProfile().

◆ LogMessage()

void LogMessage ( string msg,
int msg_type,
bool trace = false )
inlinestaticprivate

Definition at line 218 of file debugprint.c.

References DumpStack(), Print(), and s_MsgPrefix.

Referenced by Log(), LogAndTrace(), LogError(), LogErrorAndTrace(), LogWarning(), and LogWarningAndTrace().

◆ LogWarning()

void LogWarning ( string msg)
inlinestaticprivate

Prints debug message as warning message.

Parameters
msgstring Debug message for warning print
Returns
void None
DebugPrint.LogWarning("Hello World, this is warning log");
>> [Warning]: Hello World, this is warning log
static void LogWarning(string msg)
Prints debug message as warning message.
Definition debugprint.c:71

Definition at line 71 of file debugprint.c.

References LogMessage(), MSG_WARNING, and s_TraceAllLogs.

◆ LogWarningAndTrace()

void LogWarningAndTrace ( string msg)
inlinestaticprivate

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

Parameters
msgstring 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
>> -----------------
static void LogWarningAndTrace(string msg)
Prints debug message as warning message and prints stack trace of calls.
Definition debugprint.c:90

Definition at line 90 of file debugprint.c.

References LogMessage(), and MSG_WARNING.

◆ OnInit()

void OnInit ( )
inlinestaticprivate

◆ TrimDebugLog()

string TrimDebugLog ( string msg)
inlinestaticprivate

Definition at line 173 of file debugprint.c.

References string::IndexOf(), string::Length(), and string::Substring().

Referenced by AdjustDebugLog().

◆ TrimStackTrace()

string TrimStackTrace ( string msg)
inlinestaticprivate

Definition at line 208 of file debugprint.c.

References string::IndexOf().

Referenced by AdjustDebugLog().

Field Documentation

◆ MSG_COUNT

const int MSG_COUNT = 3
staticprivate

Definition at line 6 of file debugprint.c.

Referenced by IsDebugLog().

◆ MSG_ERROR

const int MSG_ERROR = 2
staticprivate

Definition at line 5 of file debugprint.c.

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

◆ MSG_LOG

const int MSG_LOG = 0
staticprivate

Definition at line 3 of file debugprint.c.

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

◆ MSG_WARNING

const int MSG_WARNING = 1
staticprivate

Definition at line 4 of file debugprint.c.

Referenced by LogWarning(), LogWarningAndTrace(), and OnInit().

◆ s_MsgPrefix

string s_MsgPrefix[MSG_COUNT]
staticprivate

Definition at line 8 of file debugprint.c.

Referenced by IsDebugLog(), LogMessage(), and OnInit().

◆ s_MsgStackMarked

bool s_MsgStackMarked
staticprivate

Definition at line 11 of file debugprint.c.

Referenced by IsStackTrace(), and OnInit().

◆ s_MsgStackMarkEnd

string s_MsgStackMarkEnd
staticprivate

Definition at line 10 of file debugprint.c.

Referenced by IsStackTrace(), and OnInit().

◆ s_MsgStackMarkStart

string s_MsgStackMarkStart
staticprivate

Definition at line 9 of file debugprint.c.

Referenced by IsStackTrace(), and OnInit().

◆ s_TraceAllLogs

bool s_TraceAllLogs
staticprivate

Definition at line 12 of file debugprint.c.

Referenced by EnableTracingLogs(), Log(), LogError(), LogWarning(), and OnInit().


The documentation for this class was generated from the following file: