Edgewall Software
Modify

Opened 20 years ago

Closed 7 years ago

#809 closed enhancement (wontfix)

Catch stderr and output to logger

Reported by: tonib Owned by:
Priority: low Milestone:
Component: general Version: 0.7.1
Severity: normal Keywords: helpwanted
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Christian Boos)

Hi,

I suggest that sys.stderr is catched and output to the logger like below

    class StderrFaker:
        def write(self, message):
            message = message.strip()
            env.log.error(message)
            
    sys.stderr = StderrFaker()

Attachments (0)

Change History (10)

comment:1 by daniel, 20 years ago

Milestone: 0.8

Not a bad idea.

comment:2 by anonymous, 20 years ago

I'm not sure this doesnt breaks the traceback in the webbrowser. Which is quite useful.

One would probably want both outputs.

comment:3 by anonymous, 20 years ago

Multiple levels of verbose debug info might be nice too.

comment:4 by Jonas Borgström, 20 years ago

Milestone: 0.80.9

I don't think this will work when using ModPython. The log-file is per project but sys.stderr is global.

I'm moving this into the future until we know if this is true.

comment:5 by Christopher Lenz, 19 years ago

Description: modified (diff)
Keywords: helpwanted added
Priority: normallow
Severity: normalenhancement

So maybe implement it only in the CGI frontend?

comment:6 by Christopher Lenz, 19 years ago

Milestone: 0.9

comment:8 by Christian Boos, 17 years ago

Description: modified (diff)
Milestone: 1.0

One possibility would be to have a dedicated logger for the stderr, and prefix each line by the thread id, which would eventually make it possible to relate lines from that files to lines from other logs, provided the thread id is also used there (as this is now possible).

See also #3062 and #4552.

comment:9 by Christian Boos, 14 years ago

Milestone: 1.0unscheduled

Milestone 1.0 deleted

comment:10 by Ryan J Ollos, 9 years ago

Owner: Jonas Borgström removed

comment:11 by Ryan J Ollos, 7 years ago

Milestone: unscheduled
Resolution: wontfix
Status: newclosed

It might be possible to implement comment:8 after #7820.

This ticket doesn't provide a strong motivation of use-case for the feature. If there is one, we can reconsider, but closing for now.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.