Re: How to use logging

2014-02-17 Thread John Gordon
In <5a53c1ca-1104-40f2-9401-a6d3b3673...@googlegroups.com> kumar writes: > Hi folks, > i'm new to python i understood the logging mechanism but unable to > understand how these are applied in real time examples can any body help > me out Here are some very simple examples: import logging

Re: How to use logging

2014-02-17 Thread Mark Lawrence
On 17/02/2014 07:37, kumar wrote: Hi folks, i'm new to python i understood the logging mechanism but unable to understand how these are applied in real time examples can any body help me out Start here http://docs.python.org/3/howto/logging.html, if that's not good enough please co

How to use logging

2014-02-16 Thread kumar
Hi folks, i'm new to python i understood the logging mechanism but unable to understand how these are applied in real time examples can any body help me out -- https://mail.python.org/mailman/listinfo/python-list

Re: how to use logging module to log an object like print()

2008-10-31 Thread Vinay Sajip
On Oct 30, 4:34 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > Vinay, please tell me whether I was right or wrong ... > What Tim Roberts has already said is right ... my post was highlighting how to mitigate any overhead which is typically (or at least in general terms) higher than the cost of fo

Re: how to use logging module to log an object like print()

2008-10-31 Thread Tim Roberts
Steve Holden <[EMAIL PROTECTED]> wrote: >Diez B. Roggisch wrote: >> Steve Holden schrieb: >>> Diez B. Roggisch wrote: davy zhang schrieb: > logger.debug("debug message",d)#can not do this logger.debug("yes you can: %r", d) >>> One deficiency of this approach, however, is tha

Re: how to use logging module to log an object like print()

2008-10-29 Thread Steve Holden
Diez B. Roggisch wrote: > Steve Holden schrieb: >> Diez B. Roggisch wrote: >>> davy zhang schrieb: mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create console handler and set level t

Re: how to use logging module to log an object like print()

2008-10-29 Thread Steve Holden
[EMAIL PROTECTED] wrote: > On 29 Ott, 12:24, Steve Holden <[EMAIL PROTECTED]> wrote: >> Diez B. Roggisch wrote: >>> davy zhang schrieb: mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create cons

Re: how to use logging module to log an object like print()

2008-10-29 Thread Diez B. Roggisch
Steve Holden schrieb: Diez B. Roggisch wrote: davy zhang schrieb: mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # c

Re: how to use logging module to log an object like print()

2008-10-29 Thread bieffe62
On 29 Ott, 12:24, Steve Holden <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > > davy zhang schrieb: > >> mport logging > >> import pickle > > >> # create logger > >> logger = logging.getLogger("simple_example") > >> logger.setLevel(logging.DEBUG) > >> # create console handler and set level

Re: how to use logging module to log an object like print()

2008-10-29 Thread Vinay Sajip
On Oct 29, 11:24 am, Steve Holden <[EMAIL PROTECTED]> wrote: > > One deficiency of this approach, however, is that the string formatting > is performed even when nologgingis required, thereby wasting a certain > amount of effort on unnecessary formatting. > Though you can mitigate this using the

Re: how to use logging module to log an object like print()

2008-10-29 Thread Steve Holden
Diez B. Roggisch wrote: > davy zhang schrieb: >> mport logging >> import pickle >> >> >> # create logger >> logger = logging.getLogger("simple_example") >> logger.setLevel(logging.DEBUG) >> # create console handler and set level to debug >> ch = logging.StreamHandler() >> ch.setLevel(logging.DEBUG)

Re: how to use logging module to log an object like print()

2008-10-29 Thread davy zhang
thanks so much , I ganna check the formatter str for more info:) On Wed, Oct 29, 2008 at 5:10 PM, Diez B. Roggisch <[EMAIL PROTECTED]> wrote: > davy zhang schrieb: >> >> mport logging >> import pickle >> >> >> # create logger >> logger = logging.getLogger("simple_example") >> logger.setLevel(loggi

Re: how to use logging module to log an object like print()

2008-10-29 Thread Diez B. Roggisch
davy zhang schrieb: mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # create formatter formatter = logging.Formatter("%

how to use logging module to log an object like print()

2008-10-29 Thread davy zhang
mport logging import pickle # create logger logger = logging.getLogger("simple_example") logger.setLevel(logging.DEBUG) # create console handler and set level to debug ch = logging.StreamHandler() ch.setLevel(logging.DEBUG) # create formatter formatter = logging.Formatter("%(asctime)s - %(name)s