[Patches] [ python-Patches-1001864 ] Logger file objects

SourceForge.net noreply at sourceforge.net
Mon Aug 2 10:35:34 CEST 2004


Patches item #1001864, was opened at 2004-08-02 11:35
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1001864&group_id=5470

Category: Library (Lib)
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Nobody/Anonymous (nobody)
Summary: Logger file objects

Initial Comment:
The logger can return a file like object for each error
level.
These file objects can be sent to any function
expecting a file object.

Example:
>> import logging
>> logging.basicConfig()
>> logger = logging.getLogger()
>> err = logger.getFileObject(logging.ERROR)
>> print >> err, "This is an error"
ERROR:root:This is an error
ERROR:root:

>> err.flush()
>> err.close()


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1001864&group_id=5470


More information about the Patches mailing list