M
Hi all,
Here is a first rough draft of a logging policy. Somebody had to do it. I await your comments...
Level 0 - No logging info whatsoever.
Level 1 - Default logging level. To be used by any part of the program to log messages that one would like to see by default.
Level 2..5 - To be used only by module specific code.
Level 6..9 - To be used by the LPLC libraries (smm, synch, conffile, ...)
Level 9 - Maximum logging level.
Trace - Log successful execution of a specific action.
Warning - Something has gone wrong, or unexpected result received, but an alternative/default/fallback action is available and will (note: in the future) be tried. If all alternatives fail, only then log an error
message.
Error - Something is seriously wrong, for which no corrective action is known, and the only solution is to give up on that specific action. Note that the PLC or the module that experienced the error does not necessarily have to stop executing (or crash), but may continue with other actions (e.g. modbus_tcp module cannot connect to a remote host 1 to read point A, but continues to connect to host 2 to get point B).
I don't really like the policy for level 1. Please do come up with alternatives.
Mario.
----------------------------------------------------------------------------
Mario J. R. de Sousa [email protected]
----------------------------------------------------------------------------
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
Here is a first rough draft of a logging policy. Somebody had to do it. I await your comments...
Level 0 - No logging info whatsoever.
Level 1 - Default logging level. To be used by any part of the program to log messages that one would like to see by default.
Level 2..5 - To be used only by module specific code.
Level 6..9 - To be used by the LPLC libraries (smm, synch, conffile, ...)
Level 9 - Maximum logging level.
Trace - Log successful execution of a specific action.
Warning - Something has gone wrong, or unexpected result received, but an alternative/default/fallback action is available and will (note: in the future) be tried. If all alternatives fail, only then log an error
message.
Error - Something is seriously wrong, for which no corrective action is known, and the only solution is to give up on that specific action. Note that the PLC or the module that experienced the error does not necessarily have to stop executing (or crash), but may continue with other actions (e.g. modbus_tcp module cannot connect to a remote host 1 to read point A, but continues to connect to host 2 to get point B).
I don't really like the policy for level 1. Please do come up with alternatives.
Mario.
----------------------------------------------------------------------------
Mario J. R. de Sousa [email protected]
----------------------------------------------------------------------------
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc