Wiki source for PyPVSLogging


Show raw source

======PyPVS Logging======

Logging with django can be done with basic stdout being picked up and logged by apache. So simple **print** statements should work just fine. This document describes simple standards to keep.

Error messages should be kept to a minimum. Just to where it may be useful.

=====Logging Within Views=====

Output should be set in a simple structure that describes where the error is coming from, and describe what the problem is.

[Type of Errror]: [View]: [Error Message]

====Type of Error====

Type of Error should be something like 'Error', 'Warning', or 'Debug'. Depending on the severity. An Error would cause a problem in the program. Warning would allow everything to function normally. And Debug would be for informational messages that may be of use.

====View====

The view the error was generated in(if applicable). It could also include any call parameters if you feel they would be useful.

====Error Message====

A detailed human readable message that you want to be logged.

=====Example=====

%%(python)
print "Error: api_registration_payment: User not logged in. This should not be possible. Referer: %s" % request.META.get('HTTP_REFERER')
%%

----
[[PyPVS]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki