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

SourceForge.net noreply at sourceforge.net
Tue Oct 12 16:33:01 CEST 2004


Patches item #1001864, was opened at 2004-08-02 08:35
Message generated for change (Comment added) made by vsajip
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: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Miki Tebeka (tebeka)
Assigned to: Vinay Sajip (vsajip)
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()


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

>Comment By: Vinay Sajip (vsajip)
Date: 2004-10-12 14:33

Message:
Logged In: YES 
user_id=308438

Decided not to add to logging module, following feedback
from python-dev.

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

Comment By: Miki Tebeka (tebeka)
Date: 2004-08-16 07:02

Message:
Logged In: YES 
user_id=358087

I guess "isatty" is not needed :-)

I wasn't sure about black lines, what if the user want to
add some black lines to make it easiter to read?

I just see log line as regula lines with a prefix so that
empty lines are only with a prefix.

Your call.

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

Comment By: Vinay Sajip (vsajip)
Date: 2004-08-10 16:12

Message:
Logged In: YES 
user_id=308438

It's also untidy that the blank line is printed. I can
change it so that if the message text is = "\n", it's not
printed.

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

Comment By: Vinay Sajip (vsajip)
Date: 2004-08-10 15:49

Message:
Logged In: YES 
user_id=308438

Nice, but I have a question about isatty. Is it needed?
According to the docs for file-like objects, it should not
be implemented unless associated with a real file or device.

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

Comment By: Miki Tebeka (tebeka)
Date: 2004-08-09 12:47

Message:
Logged In: YES 
user_id=358087

Hope it works now...

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

Comment By: Anthony Baxter (anthonybaxter)
Date: 2004-08-09 10:03

Message:
Logged In: YES 
user_id=29957




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

Comment By: Anthony Baxter (anthonybaxter)
Date: 2004-08-09 10:03

Message:
Logged In: YES 
user_id=29957

There's no uploaded file!  You have to check the
checkbox labeled "Check to Upload & Attach File"
when you upload a file. In addition, even if you
*did* check this checkbox, a bug in SourceForge
prevents attaching a file when *creating* an issue.

Please try again.

(This is a SourceForge annoyance that we can do
nothing about. :-( )

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

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