DayZ 1.24
Loading...
Searching...
No Matches
LogTemplates.c
Go to the documentation of this file.
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)
15
16 if (m_LogTemplates.Contains(template_id))
17 Debug.Log("Template ID: " + string.ToString(template_id) + " is alredy exist!", "LogTemplate.h -> OnInit()", "System", "Template Registration", "None");
18 else
19 {
22 }
23 }
24
25 // Steps to register of new log template:
26 // 1.) Crete new LogTemplateID in below of this comment.
27 // 2.) Set Template Name in format TEMPLATE_[CUSTOM NAME] => TEMPLATE_MY_LOG
28 // 3.) Set Template ID which is your id + your custom id => + CustomID(0) = 50190
30 // Template Name Template ID
35
36 static void Init()
37 {
40 // | Template Name | author | plugin | label ////
41 RegisterLogTamplate(TEMPLATE_UNKNOWN, "Unknown", "Unknown", "Unknown"); //
42 RegisterLogTamplate(TEMPLATE_JANOSIK, "Janosik", "GUI", "None"); //
43 RegisterLogTamplate(TEMPLATE_PLAYER_WEIGHT, "Unknown", "PlayerBase", "Weight"); //
44 RegisterLogTamplate(TEMPLATE_BROADCAST, "Unknown", "PluginMessageManager", "Broadcast"); //
45
46 }
47
49 {
51 return m_LogTemplates.Get(template_id);
52
53 Debug.Log("Template ID: " + string.ToString(template_id) + " does not exist!", "LogTemplate.h -> GetTemplate()", "System", "Get Log Template", "None");
54 return NULL;
55 }
56}
57
69void Log(string message, LogTemplateID template_id = 0)
73 Debug.Log(message, log_template.param2, log_template.param1, log_template.param3);
74}
75
proto string ToString()
void LogInfo(string message, LogTemplateID template_id=0)
Creates info log (optional) from LogTemplate which are registred.
Param3< string, string, string > LogTemplate
Definition LogTemplates.c:1
void LogWarning(string message, LogTemplateID template_id=0)
Creates warning log (optional) from LogTemplate which are registred.
int LogTemplateID
Definition LogTemplates.c:2
void SQFPrint(string sqf_msg)
void SQFLog(string sqf_msg)
class LogTemplates Log(string message, LogTemplateID template_id=0)
Creates debug log (optional) from LogTemplate which are registred.
void LogError(string message, LogTemplateID template_id=0)
Creates error log (optional) from LogTemplate which are registred.
Definition Debug.c:14
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.
Definition Debug.c:321
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.
Definition Debug.c:301
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.
Definition Debug.c:341
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.
Definition Debug.c:133
static LogTemplateID TEMPLATE_BROADCAST
static LogTemplateID TEMPLATE_UNKNOWN
static LogTemplateID TEMPLATE_JANOSIK
static void Init()
static LogTemplate GetTemplate(LogTemplateID template_id)
static LogTemplateID TEMPLATE_PLAYER_WEIGHT
void RegisterLogTamplate(LogTemplateID template_id, string author, string plugin, string label)
ref map< LogTemplateID, ref LogTemplate > m_LogTemplates
Definition LogTemplates.c:9
proto void Print(void var)
Prints content of variable to console/log.