Dayz 1.25
Dayz Code Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс DebugPrint

Закрытые статические члены

static void OnInit ()
 
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 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 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.
 
static string AdjustDebugLog (string msg)
 Function adjust received message for debug console (Do not use)
 
static void EnableTracingLogs (bool enable)
 
bool IsDebugLog (string msg)
 
string TrimDebugLog (string msg)
 
bool IsStackTrace (string msg)
 
string TrimStackTrace (string msg)
 
void LogMessage (string msg, int msg_type, bool trace=false)
 

Закрытые статические данные

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

Подробное описание

Методы

◆ AdjustDebugLog()

static string AdjustDebugLog ( string msg)
inlinestaticprivate

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

Аргументы
msgstring Message for adjust
Возвращает
string Adjusted Message
string msg = DebugPrint.AdjustDebugLog("s = 'Hello World, this is error log'");
Definition DebugPrint.c:2
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 EntityAI.c:95
Definition World.c:2
142 {
143 if ( IsStackTrace(msg) )
144 {
145 return TrimStackTrace(msg);
146 }
147
148 if ( IsDebugLog(msg) )
149 {
150 return TrimDebugLog(msg);
151 }
152
153 return msg;
154 }
bool IsStackTrace(string msg)
Definition DebugPrint.c:187
bool IsDebugLog(string msg)
Definition DebugPrint.c:161
string TrimDebugLog(string msg)
Definition DebugPrint.c:173
string TrimStackTrace(string msg)
Definition DebugPrint.c:208

Перекрестные ссылки IsDebugLog(), IsStackTrace(), TrimDebugLog() и TrimStackTrace().

◆ EnableTracingLogs()

static void EnableTracingLogs ( bool enable)
inlinestaticprivate
157 {
159 }
bool s_TraceAllLogs
Definition DebugPrint.c:12

Перекрестные ссылки s_TraceAllLogs.

◆ IsDebugLog()

bool IsDebugLog ( string msg)
inlinestaticprivate
162 {
163 for ( int i = 0; i < MSG_COUNT; ++i )
164 {
165 if ( msg.IndexOf(s_MsgPrefix[i]) != -1 )
166 {
167 return true;
168 }
169 }
170
171 return false;
172 }
string s_MsgPrefix[MSG_COUNT]
Definition DebugPrint.c:8
const int MSG_COUNT
Definition DebugPrint.c:6

Перекрестные ссылки MSG_COUNT и s_MsgPrefix.

Используется в AdjustDebugLog().

◆ IsStackTrace()

bool IsStackTrace ( string msg)
inlinestaticprivate
188 {
189 if ( s_MsgStackMarked && msg.IndexOf(s_MsgStackMarkEnd) != -1 )
190 {
191 s_MsgStackMarked = false;
192 return false;
193 }
194
195 if ( s_MsgStackMarked )
196 {
197 return true;
198 }
199
200 if ( msg.IndexOf(s_MsgStackMarkStart) != -1 )
201 {
202 s_MsgStackMarked = true;
203 return true;
204 }
205
206 return false;
207 }
bool s_MsgStackMarked
Definition DebugPrint.c:11
string s_MsgStackMarkEnd
Definition DebugPrint.c:10
string s_MsgStackMarkStart
Definition DebugPrint.c:9

Перекрестные ссылки s_MsgStackMarked, s_MsgStackMarkEnd и s_MsgStackMarkStart.

Используется в AdjustDebugLog().

◆ Log()

static void Log ( string msg)
inlinestaticprivate

Prints debug message with normal prio.

Аргументы
msgstring Debug message for print
Возвращает
void None
DebugPrint.Log("Hello World");
>> [Log]: Hello World;
38 {
40 }
void LogMessage(string msg, int msg_type, bool trace=false)
Definition DebugPrint.c:218
const int MSG_LOG
Definition DebugPrint.c:3

Перекрестные ссылки LogMessage(), MSG_LOG и s_TraceAllLogs.

◆ LogAndTrace()

static void LogAndTrace ( string msg)
inlinestaticprivate

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

Аргументы
msgstring Debug message for print
Возвращает
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
>> -----------------
Mission mission
Definition DisplayStatus.c:28
static void LogAndTrace(string msg)
Prints debug message as normal message and prints stack trace of calls.
Definition DebugPrint.c:56
57 {
58 LogMessage(msg, MSG_LOG, true);
59 }

Перекрестные ссылки LogMessage() и MSG_LOG.

◆ LogError()

static void LogError ( string msg)
inlinestaticprivate

Prints debug message as error message.

Аргументы
msgstring Debug message for error print
Возвращает
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
106 {
108 }
const int MSG_ERROR
Definition DebugPrint.c:5

Перекрестные ссылки LogMessage(), MSG_ERROR и s_TraceAllLogs.

◆ LogErrorAndTrace()

static void LogErrorAndTrace ( string msg)
inlinestaticprivate

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

Аргументы
msgstring Debug message for error print
Возвращает
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
125 {
126 LogMessage(msg, MSG_ERROR, true);
127 }

Перекрестные ссылки LogMessage() и MSG_ERROR.

Используется в OnlineServices::ErrorCaught(), OnlineServices::LoadFriends(), OnlineServices::LoadMPPrivilege(), OnlineServices::LoadPermissions(), OnlineServices::LoadServers(), OnlineServices::LoadVoicePrivilege(), OnlineServices::SetServerFavorited(), OnlineServices::ShowInviteScreen() и OnlineServices::ShowUserProfile().

◆ LogMessage()

void LogMessage ( string msg,
int msg_type,
bool trace = false )
inlinestaticprivate
219 {
220 string mesg = "["+s_MsgPrefix[msg_type]+"]: "+msg;
221
222 Print(mesg);
223
224 if ( trace )
225 {
226 DumpStack();
227 }
228 }
proto void DumpStack()
Prints current call stack (stack trace)
proto void Print(void var)
Prints content of variable to console/log.

Перекрестные ссылки DumpStack(), Print() и s_MsgPrefix.

Используется в Log(), LogAndTrace(), LogError(), LogErrorAndTrace(), LogWarning() и LogWarningAndTrace().

◆ LogWarning()

static void LogWarning ( string msg)
inlinestaticprivate

Prints debug message as warning message.

Аргументы
msgstring Debug message for warning print
Возвращает
void None
DebugPrint.LogWarning("Hello World, this is warning log");
static void LogWarning(string msg)
Prints debug message as warning message.
Definition DebugPrint.c:71
72 {
74 }
const int MSG_WARNING
Definition DebugPrint.c:4

Перекрестные ссылки LogMessage(), MSG_WARNING и s_TraceAllLogs.

◆ LogWarningAndTrace()

static void LogWarningAndTrace ( string msg)
inlinestaticprivate

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

Аргументы
msgstring Debug message for warning print
Возвращает
void None
DebugPrint.LogWarningAndTrace("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
91 {
93 }

Перекрестные ссылки LogMessage() и MSG_WARNING.

◆ OnInit()

static void OnInit ( )
inlinestaticprivate
15 {
16 s_MsgPrefix[MSG_LOG] = "Log";
17 s_MsgPrefix[MSG_WARNING] = "Warning";
18 s_MsgPrefix[MSG_ERROR] = "Error";
19
20 s_MsgStackMarkStart = "-- Stack trace --";
21 s_MsgStackMarked = false;
22 s_MsgStackMarkEnd = "-----------------";
23
24 s_TraceAllLogs = false;
25 }

Перекрестные ссылки MSG_ERROR, MSG_LOG, MSG_WARNING, s_MsgPrefix, s_MsgStackMarked, s_MsgStackMarkEnd, s_MsgStackMarkStart и s_TraceAllLogs.

◆ TrimDebugLog()

string TrimDebugLog ( string msg)
inlinestaticprivate
174 {
175 int msg_lenght = msg.Length();
176 int log_start = msg.IndexOf("'") + 1;
177
178 if ( log_start == -1 )
179 {
180 return msg;
181 }
182
183 int log_lenght = msg_lenght - log_start - 2;
184
185 return msg.Substring(log_start, log_lenght);
186 }

Используется в AdjustDebugLog().

◆ TrimStackTrace()

string TrimStackTrace ( string msg)
inlinestaticprivate
209 {
210 if ( msg.IndexOf("DebugPrint.c") != -1 )
211 {
212 return string.Empty;
213 }
214
215 return msg;
216 }

Перекрестные ссылки string::Empty.

Используется в AdjustDebugLog().

Поля

◆ MSG_COUNT

const int MSG_COUNT = 3
staticprivate

Используется в IsDebugLog().

◆ MSG_ERROR

const int MSG_ERROR = 2
staticprivate

Используется в LogError(), LogErrorAndTrace() и OnInit().

◆ MSG_LOG

const int MSG_LOG = 0
staticprivate

Используется в Log(), LogAndTrace() и OnInit().

◆ MSG_WARNING

const int MSG_WARNING = 1
staticprivate

Используется в LogWarning(), LogWarningAndTrace() и OnInit().

◆ s_MsgPrefix

string s_MsgPrefix[MSG_COUNT]
staticprivate

Используется в IsDebugLog(), LogMessage() и OnInit().

◆ s_MsgStackMarked

bool s_MsgStackMarked
staticprivate

Используется в IsStackTrace() и OnInit().

◆ s_MsgStackMarkEnd

string s_MsgStackMarkEnd
staticprivate

Используется в IsStackTrace() и OnInit().

◆ s_MsgStackMarkStart

string s_MsgStackMarkStart
staticprivate

Используется в IsStackTrace() и OnInit().

◆ s_TraceAllLogs

bool s_TraceAllLogs
staticprivate

Используется в EnableTracingLogs(), Log(), LogError(), LogWarning() и OnInit().


Объявления и описания членов класса находятся в файле: