[CalendarServer-changes] [11384] CalendarServer/trunk/twext/python/log.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Jun 19 16:14:34 PDT 2013


Revision: 11384
          http://trac.calendarserver.org//changeset/11384
Author:   wsanchez at apple.com
Date:     2013-06-19 16:14:34 -0700 (Wed, 19 Jun 2013)
Log Message:
-----------
docs

Modified Paths:
--------------
    CalendarServer/trunk/twext/python/log.py

Modified: CalendarServer/trunk/twext/python/log.py
===================================================================
--- CalendarServer/trunk/twext/python/log.py	2013-06-19 20:50:39 UTC (rev 11383)
+++ CalendarServer/trunk/twext/python/log.py	2013-06-19 23:14:34 UTC (rev 11384)
@@ -18,15 +18,14 @@
 """
 Classes and functions to do granular logging.
 
-Example usage in a module::
+Example usage in a module C{some.module}::
 
     from twext.python.log import Logger
     log = Logger()
 
-    ...
+    def handleData(data):
+        log.debug("Got data: {data!r}.", data=data)
 
-    log.debug("Got data: {data!r}.", data=data)
-
 Or in a class::
 
     from twext.python.log import Logger
@@ -65,6 +64,8 @@
     #"StandardIOObserver",
 ]
 
+
+
 import sys
 from sys import stdout, stderr
 from string import Formatter
@@ -157,11 +158,12 @@
 def formatEvent(event):
     """
     Formats an event as a L{unicode}, using the format in
-    C{event["log_format"]}.  This implementation should never
-    raise an exception; if the formatting cannot be done, the
-    returned string will describe the event so that a useful
-    message is emitted regardless.
+    C{event["log_format"]}.
 
+    This implementation should never raise an exception; if the formatting
+    cannot be done, the returned string will describe the event generically so
+    that a useful message is emitted regardless.
+
     @param event: a logging event
 
     @return: a L{unicode}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130619/970ee5c1/attachment.html>


More information about the calendarserver-changes mailing list