write_to_logs
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
write_to_logs [2021/07/23 14:51] – [Writing to communication log] emozolyak | write_to_logs [2021/07/23 15:06] (current) – [Writing to message log] emozolyak | ||
---|---|---|---|
Line 9: | Line 9: | ||
<code lua> | <code lua> | ||
local result = getResult() | local result = getResult() | ||
- | DEBUG(" | + | |
+ | if (not result) then | ||
+ | | ||
+ | else | ||
+ | if (result > 100) then | ||
+ | DEBUG(" | ||
+ | end | ||
+ | end | ||
</ | </ | ||
- | ==== DEBUG(message) ==== | ||
- | The function adds the **message** with the DEBUG level to communication log (**Maintenance -> WebHMI Log**). Function returns 1 if any error occurred and 0 on success. | ||
- | ==== TRACE(message) ==== | ||
- | The function adds the **message** with the TRACE level to communication log (**Maintenance -> WebHMI Log**). Function returns 1 if any error occurred and 0 on success. | ||
==== Customize log output ==== | ==== Customize log output ==== | ||
Line 25: | Line 28: | ||
===== Writing to message log ===== | ===== Writing to message log ===== | ||
- | ==== AddInfoMessage(message, | + | **AddInfoMessage |
- | The AddInfoMessage function adds the message **message** with the Info level to the Messages log. **userId** is the user ID on whose behalf the message should be added. Returns 1 if an error occurred and 0 if successful. | + | |
- | **AddWarningMessage** and **AddAlertMessage** - are full analogs of AddInfoMessage, | + | The functions add the text //message// with their respective level to the messages log. //userId// is the user ID on whose behalf the message |
write_to_logs.txt · Last modified: 2021/07/23 15:06 by emozolyak