|
12 | 12 | enum logType_s {
|
13 | 13 | _Default,
|
14 | 14 | _LogToDir,
|
15 |
| - _LogToDirSilent |
| 15 | + _LogToDirSilent, |
| 16 | + _LogToAlertMessage, |
16 | 17 | }
|
17 | 18 |
|
18 | 19 | new logType_s: ca_log_type,
|
@@ -147,19 +148,26 @@ Create_CVars() {
|
147 | 148 |
|
148 | 149 | bind_pcvar_num(create_cvar("ca_log_type", "1",
|
149 | 150 | .description = fmt("Log file type^n \
|
150 |
| - 0 = log to common amxx log file (logs/L*.log)^n \ |
151 |
| - 1 = log to plugins folder (logs/%s/[plugin name]/L*.log)^n \ |
152 |
| - 2 = silent log to plugins folder (logs/%s/[plugin name]/L*.log)", LOG_FOLDER, LOG_FOLDER), |
| 151 | + 0 = log to common amxx log file (logs/L*.log)^n \ |
| 152 | + 1 = log to plugins folder (logs/%s/[plugin name]/L*.log)^n \ |
| 153 | + 2 = silent log to plugins folder (logs/%s/[plugin name]/L*.log)^n \ |
| 154 | + 3 = use elog_message) \ |
| 155 | + ", |
| 156 | + LOG_FOLDER, LOG_FOLDER), |
153 | 157 | .has_min = true, .min_val = 0.0,
|
154 |
| - .has_max = true, .max_val = float(_LogToDirSilent) |
| 158 | + .has_max = true, .max_val = float(logType_s) - 1.0 |
155 | 159 | ),
|
156 | 160 | ca_log_type
|
157 | 161 | )
|
158 | 162 |
|
159 | 163 | bind_pcvar_num(create_cvar("ca_log_level", "1",
|
160 |
| - .description = "Log level^n 0 = disable logs^n 1 = add info messages logs^n 2 = add warinigs info^n 3 = add debug messages", |
| 164 | + .description = "Log level^n \ |
| 165 | + 0 = disable logs^n \ |
| 166 | + 1 = add info messages logs^n \ |
| 167 | + 2 = add warinigs info^n \ |
| 168 | + 3 = add debug messages", |
161 | 169 | .has_min = true, .min_val = 0.0,
|
162 |
| - .has_max = true, .max_val = float(logLevel_Debug) |
| 170 | + .has_max = true, .max_val = float(logLevel_s) - 1.0 |
163 | 171 | ),
|
164 | 172 | ca_log_level
|
165 | 173 | )
|
@@ -294,7 +302,7 @@ public bool: native_CA_Log(const plugin_id, const argc) {
|
294 | 302 |
|
295 | 303 | new logsFile[PLATFORM_MAX_PATH]
|
296 | 304 |
|
297 |
| - if (ca_log_type > _Default) { |
| 305 | + if (ca_log_type == _LogToDir || ca_log_type == _LogToDirSilent) { |
298 | 306 | new logsPath[PLATFORM_MAX_PATH]
|
299 | 307 | get_localinfo("amxx_logs", logsPath, charsmax(logsPath))
|
300 | 308 |
|
@@ -322,6 +330,7 @@ public bool: native_CA_Log(const plugin_id, const argc) {
|
322 | 330 | case _Default: log_amx(msg)
|
323 | 331 | case _LogToDir: log_to_file(logsFile, msg)
|
324 | 332 | case _LogToDirSilent: log_to_file_ex(logsFile, msg)
|
| 333 | + case _LogToAlertMessage: elog_message(msg) |
325 | 334 | }
|
326 | 335 |
|
327 | 336 | return true
|
|
0 commit comments