diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2017-04-02 13:01:34 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2017-04-02 13:01:34 +0200 |
commit | fe535d25e58d75397ddefeb796bf60e897360f35 (patch) | |
tree | cca4c3473ce265003c4147b98d0c48a9b95c8385 | |
parent | c4cc5e613ccfbf573a7ed66d17702581ef00e376 (diff) | |
download | vdr-fe535d25e58d75397ddefeb796bf60e897360f35.tar.gz vdr-fe535d25e58d75397ddefeb796bf60e897360f35.tar.bz2 |
Added some guidelines and recommendations to the 'Logging' section of PLUGINS.html
-rw-r--r-- | HISTORY | 4 | ||||
-rw-r--r-- | PLUGINS.html | 24 |
2 files changed, 28 insertions, 0 deletions
@@ -8944,3 +8944,7 @@ Video Disk Recorder Revision History store auxiliary information with an event (thanks to Jörg Wendel). This string has no meaning whatsoever to VDR itself, and it will not be written into the info file of a recording that is made for such an event. +- Added some guidelines and recommendations to the 'Logging' section of PLUGINS.html. + The most important being: implement a command line option to control the level + of logging (in particular allow turning off logging completely!) and never print + anything to stdout or stderr (unless one of the listed exceptions applies). diff --git a/PLUGINS.html b/PLUGINS.html index dd7a154f..92a4d313 100644 --- a/PLUGINS.html +++ b/PLUGINS.html @@ -583,6 +583,30 @@ esyslog("pluginname: error #%d has occurred", ErrorNumber); Note that the log messages will be given as provided, the plugin's name will not automatically be added, so make sure your log messages are obvious enough. +<p> +<modified> +Only use the above logging functions for occasional log messages. Do not use +them unconditionally for frequent messages that produce long sequences of lines +in the log file every few seconds. That might make it hard to work on other plugins +or the core VDR code, watching their log entries while they are permanently +interspersed with unrelated stuff.<br> +<br> +The recommended behavior for a plugin that does logging is to implement a command +line option that controls the level of log messages, preferably '-l N, --log=N', +where 'N' is in the range 0...3, with 0 meaning no logging whatsoever, 1 log only +errors, 2 log errors and informational messages, and 3 also log debug information.<br> +<br> +If a plugin can output extensive data for special debugging purposes (either to +the log file or stdout/stderr), this should be enabled by setting proper switches +in one of its source files (see for example how the communication between VDR and +CAMs can be monitored in VDR/ci.c).<br> +<br> +Under no circumstances must a plugin print anything to stdout or stderr during +normal operation! The only exceptions being special debug information as described +above, fatal error messages that will cause VDR to abort, or if it is the sole +purpose of the plugin to display something on stdout, like for instance the +<i>skincurses</i> plugin, which displays the OSD at the console. +</modified> <hr><h2><a name="Main menu entry">Main menu entry</a></h2> |