[CalendarServer-changes] [11409] CalendarServer/branches/users/glyph/launchd-wrapper/twext/python/ log.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Jun 26 00:56:16 PDT 2013
Revision: 11409
http://trac.calendarserver.org//changeset/11409
Author: glyph at apple.com
Date: 2013-06-26 00:56:16 -0700 (Wed, 26 Jun 2013)
Log Message:
-----------
docs
Modified Paths:
--------------
CalendarServer/branches/users/glyph/launchd-wrapper/twext/python/log.py
Modified: CalendarServer/branches/users/glyph/launchd-wrapper/twext/python/log.py
===================================================================
--- CalendarServer/branches/users/glyph/launchd-wrapper/twext/python/log.py 2013-06-26 07:55:59 UTC (rev 11408)
+++ CalendarServer/branches/users/glyph/launchd-wrapper/twext/python/log.py 2013-06-26 07:56:16 UTC (rev 11409)
@@ -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/20130626/588cd891/attachment.html>
More information about the calendarserver-changes
mailing list