Ñò c(@Ic@sPdZddkZddkZddkZdgZdeifd„ƒYZdS(suLogging related functionality This logging Handler logs to ``environ['wsgi.errors']`` as designated in :pep:`333`. iÿÿÿÿNtWSGIErrorsHandlercBs5eZdZed„Zd„Zd„Zd„ZRS(s®A handler class that writes logging records to `environ['wsgi.errors']`. This code is derived from CherryPy's :class:`cherrypy._cplogging.WSGIErrorHandler`. ``cache`` Whether the `wsgi.errors` stream is cached (instead of looked up via `pylons.request.environ` per every logged message). Enabling this option is not recommended (particularly for the use case of logging to `wsgi.errors` outside of a request) as the behavior of a cached `wsgi.errors` stream is not strictly defined. In particular, `mod_wsgi `_'s `wsgi.errors` will raise an exception when used outside of a request. cOs,tii|||Ž||_d|_dS(N(tloggingtHandlert__init__tcachetNonet cached_stream(tselfRtargstkwargs((s./usr/lib/python2.6/site-packages/pylons/log.pyR!s cCsO|iptiiidƒS|ip tiiidƒ|_|iS|iS(s‡Return the wsgi.errors stream Raises a TypeError when outside of a web request (pylons.request is not setup) s wsgi.errors(RtpylonstrequesttenvirontgetR(R((s./usr/lib/python2.6/site-packages/pylons/log.pytget_wsgierrors&s   cCs?y|iƒ}Wntj onX|o|iƒndS(sFlushes the streamN(Rt TypeErrortflush(Rtstream((s./usr/lib/python2.6/site-packages/pylons/log.pyR4s c Csõy|iƒ}Wntj onÍX|pdSy|i|ƒ}d}ttdƒp|i||ƒnFy|i||ƒWn-tj o!|i||idƒƒnX|iƒWn/t t fj o ‚n|i |ƒnXdS(s Emit a recordNs%s t UnicodeTypesUTF-8( RRtformatthasattrttypestwritet UnicodeErrortencodeRtKeyboardInterruptt SystemExitt handleError(RtrecordRtmsgtfs((s./usr/lib/python2.6/site-packages/pylons/log.pytemit>s((t__name__t __module__t__doc__tFalseRRRR(((s./usr/lib/python2.6/site-packages/pylons/log.pyRs    (R"RRR t__all__RR(((s./usr/lib/python2.6/site-packages/pylons/log.pyts