DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
LogTemplates.c
См. документацию.
2typedef int LogTemplateID;
3
4/*
5 * OBSOLETE: kept for possible backward compatibility only
6 */
8{
10
11 static private void RegisterLogTamplate(LogTemplateID template_id, string author, string plugin, string label)
12 {
13 if ( m_LogTemplates == NULL )
14 {
16 }
17
18 if ( m_LogTemplates.Contains(template_id) )
19 {
20 Debug.Log("Template ID: "+string.ToString(template_id)+" is alredy exist!", "LogTemplate.h -> OnInit()", "System", "Template Registration", "None");
21 }
22 else
23 {
24 LogTemplate params = new LogTemplate(author, plugin, label);
25 m_LogTemplates.Set(template_id, params);
26 }
27 }
28
29 // Steps to register of new log template:
30 // 1.) Crete new LogTemplateID in below of this comment.
31 // 2.) Set Template Name in format TEMPLATE_[CUSTOM NAME] => TEMPLATE_MY_LOG
32 // 3.) Set Template ID which is your id + your custom id => + CustomID(0) = 50190
34 // Template Name Template ID
39
40 static void Init()
41 {
44 // | Template Name | author | plugin | label ////
45 RegisterLogTamplate( TEMPLATE_UNKNOWN ,"Unknown" ,"Unknown" ,"Unknown" );//
46 RegisterLogTamplate( TEMPLATE_JANOSIK ,"Janosik" ,"GUI" ,"None" );//
47 RegisterLogTamplate( TEMPLATE_PLAYER_WEIGHT ,"Unknown" ,"PlayerBase" ,"Weight" );//
48 RegisterLogTamplate( TEMPLATE_BROADCAST ,"Unknown" ,"PluginMessageManager" ,"Broadcast" );//
49
50 }
51
53 {
54 if ( m_LogTemplates && m_LogTemplates.Contains(template_id) )
55 {
56 return m_LogTemplates.Get(template_id);
57 }
58
59 Debug.Log("Template ID: "+string.ToString(template_id)+" does not exist!", "LogTemplate.h -> GetTemplate()", "System", "Get Log Template", "None");
60 return NULL;
61 }
62}
63
75void Log(string message, LogTemplateID template_id = 0)
77 LogTemplate log_template = LogTemplates.GetTemplate(template_id);
79 Debug.Log(message, log_template.param2, log_template.param1, log_template.param3);
80}
81
93void LogInfo(string message, LogTemplateID template_id = 0)
94{
95 LogTemplate log_template = LogTemplates.GetTemplate(template_id);
96
97 Debug.LogInfo(message, log_template.param2, log_template.param1, log_template.param3);
98}
99
108 >> output to scriptExt.log (for GamutLogViewer)
109 @endcode
110*/
111void LogWarning(string message, LogTemplateID template_id = 0)
112{
113 LogTemplate log_template = LogTemplates.GetTemplate(template_id);
114
115 Debug.LogWarning(message, log_template.param2, log_template.param1, log_template.param3);
116}
117
118
119\brief Creates error log (optional) from LogTemplate which are registred
120 \param template_id \p LogTemplateID ID of LogTemplate which was registred in proto/Logtemplate.h -> "class LogTemplates"
121 \param message \p string Error message for log
122 \return \p void
123 @code
124 LogT(TEMPLATE_JINDRICH, "This is some error log message");
125
126 >> output to scriptExt.log (for GamutLogViewer)
127 @endcode
128*/
129void LogError(string message, LogTemplateID template_id = 0)
130{
131 LogTemplate log_template = LogTemplates.GetTemplate(template_id);
132
133 Debug.LogError(message, log_template.param2, log_template.param1, log_template.param3);
134}
135
136void SQFPrint(string sqf_msg)
137{
138 Print(sqf_msg);
139}
140
141void SQFLog(string sqf_msg)
142{
143 Log(sqf_msg);
144}
map
Определения ControlsXboxNew.c:4
proto string ToString()
void LogInfo(string message, LogTemplateID template_id=0)
Creates info log (optional) from LogTemplate which are registred.
Определения LogTemplates.c:93
Param3< string, string, string > LogTemplate
Определения LogTemplates.c:1
void LogWarning(string message, LogTemplateID template_id=0)
Creates warning log (optional) from LogTemplate which are registred.
Определения LogTemplates.c:111
int LogTemplateID
Определения LogTemplates.c:2
void SQFPrint(string sqf_msg)
Определения LogTemplates.c:136
void SQFLog(string sqf_msg)
Определения LogTemplates.c:141
class LogTemplates Log(string message, LogTemplateID template_id=0)
Creates debug log (optional) from LogTemplate which are registred.
Определения LogTemplates.c:75
void LogError(string message, LogTemplateID template_id=0)
Creates error log (optional) from LogTemplate which are registred.
Определения LogTemplates.c:129
static void LogWarning(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as warning message.
Определения Debug.c:230
static void LogInfo(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения Debug.c:215
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Определения Debug.c:245
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения Debug.c:122
Определения Debug.c:2
static LogTemplateID TEMPLATE_BROADCAST
Определения LogTemplates.c:38
static LogTemplateID TEMPLATE_UNKNOWN
Определения LogTemplates.c:35
static LogTemplateID TEMPLATE_JANOSIK
Определения LogTemplates.c:36
static void Init()
Определения LogTemplates.c:40
static LogTemplate GetTemplate(LogTemplateID template_id)
Определения LogTemplates.c:52
static LogTemplateID TEMPLATE_PLAYER_WEIGHT
Определения LogTemplates.c:37
void RegisterLogTamplate(LogTemplateID template_id, string author, string plugin, string label)
Определения LogTemplates.c:11
ref map< LogTemplateID, ref LogTemplate > m_LogTemplates
Определения LogTemplates.c:9
Определения LogTemplates.c:8
Определения EntityAI.c:95
proto void Print(void var)
Prints content of variable to console/log.