Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28277 > unrolled thread

Re: Logging handler: No output

Started byVinay Sajip <vinay_sajip@yahoo.co.uk>
First post2012-09-02 17:02 +0000
Last post2012-09-02 17:02 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Logging handler: No output Vinay Sajip <vinay_sajip@yahoo.co.uk> - 2012-09-02 17:02 +0000

#28277 — Re: Logging handler: No output

FromVinay Sajip <vinay_sajip@yahoo.co.uk>
Date2012-09-02 17:02 +0000
SubjectRe: Logging handler: No output
Message-ID<mailman.92.1346605345.27098.python-list@python.org>
Florian Lindner <mailinglists <at> xgm.de> writes:

> But neither the FileHandler nor the StreamHandler produce any actual output. 
> The file is being created but stays empty. If I use a print output in the 
> while loop it works, so output is catched and the applications stdout in 
> working. But why the logger proclog catching nothing?
> 

Paul Rubin's answer looks correct. In addition, you should note that every call
to start_process will add a new handler to the logger (I can't tell if the
logger could be the same on multiple calls, but it seems likely) and that may
produce multiple messages. The rule of thumb is: most code should get loggers
and log to them, but adding handlers, setting levels etc. should be only done in
one place (typically invoked from a "if __name__ == '__main__'" clause.

Regards,

Vinay Sajip

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web