# IupLog

Definition: | include pGUI.e IupLog(string logtype, fmt, dword_seq args={})
Description: | Writes a message to the system log. logtype: type of the log. Can be DEBUG, INFO, ERROR and WARNING. fmt, args: uses the same format specification as the sprintf() function. In Windows, writes to the "Application" event log. Except if logtype is DEBUG, in this case uses OutputDebugString to write to the current debugger. If the application has no debugger and the system debugger is not active, it does nothing. When running from Visual Studio the message is displayed in the Output panel only when when debugging the application. To view the other messages run the Event Viewer management console in Administrative Tools. In Linux, write to the Syslog. When logtype is DEBUG, it will also write to the calling process’ Standard Error stream. If fails to submit a message to Syslog writes the message instead to system console. To view the messages in Ubuntu use the File Log Viewer application, or you can directly read the content of the /var/log/syslog file. It is common to grab the last lines of the file using "tail -n 10 /var/log/syslog". You can also filter messages using grep and the filename of the application.
pwa/p2js: | Not supported.
Technicalia | Uses a trick I learnt from the IUP C sources, namely IupLog(typ,"%s",str), which avoids any confusion over Phix vs. C printf formats, as noted on the technicalia dropdown on that page (when translating C code to Phix you should replace any C-style specifiers with Phix-style ones), and also (mostly) avoids any need to double-up % signs as in "%%d" to end up with "%d", at least, that is, nine times out of ten.