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


Groups > comp.lang.python > #109478

Re: Is there any way to use the logging module adding nothing to a message

From cl@isbd.net
Newsgroups comp.lang.python
Subject Re: Is there any way to use the logging module adding nothing to a message
Date 2016-06-04 13:14 +0100
Message-ID <9ata2d-cb.ln1@esprimo.zbmc.eu> (permalink)
References <lara2d-s4v.ln1@esprimo.zbmc.eu> <85inxp418c.fsf@benfinney.id.au> <mailman.149.1465041358.1839.python-list@python.org>

Show all headers | View raw


Ben Finney <ben+python@benfinney.id.au> wrote:
> cl@isbd.net writes:
> 
> > If I do:-
> >
> >     f = logging.handlers.RotatingFileHandler("/home/chris/tmp/mail.log", 'a', 1000000, 4)
> >     f.setLevel(logging.DEBUG)
> >     formatter = logging.Formatter('%(message)s')
> >     f.setFormatter(formatter)
> >     log.addHandler(f)
> >
> > Will I get just the message with no extras added by the logging module?
> 
> Yuo have the code, and presumably the system on which to test it. What's
> the answer?
> 
Very true, I thought the code was going to be much longer than that.
:-)

... and the answer is, yes, with the above I just get the message text
which is what I want.

-- 
Chris Green
ยท

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Is there any way to use the logging module adding nothing to a message cl@isbd.net - 2016-06-04 12:40 +0100
  Re: Is there any way to use the logging module adding nothing to a message Ben Finney <ben+python@benfinney.id.au> - 2016-06-04 21:55 +1000
    Re: Is there any way to use the logging module adding nothing to a message cl@isbd.net - 2016-06-04 13:14 +0100

csiph-web