Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Stucked with python logging module

Reply
Thread Tools

Stucked with python logging module

 
 
sword
Guest
Posts: n/a
 
      11-16-2011
I just scaned through the beginer's guide of logging module, but I
can't get anything from console. The demo just like this:

import logging
logging.debug("This is a demo")

Maybe I should do sth to put the log to stdout in basicConfig first?
Thanks in advance
 
Reply With Quote
 
 
 
 
Kushal Kumaran
Guest
Posts: n/a
 
      11-16-2011
On Wed, Nov 16, 2011 at 8:58 AM, sword <(E-Mail Removed)> wrote:
> I just scaned through the beginer's guide of logging module, but I
> can't get anything from console. The demo just like this:
>
> import logging
> logging.debug("This is a demo")
>
> Maybe I should do sth to put the log to stdout in basicConfig first?


Actually, the problem is not of the output location, but of the
logging level. In the default configuration, logs at DEBUG level are
suppressed. logging.basicConfig will be a simple way to change this.
Are you following the logging documentation at
http://docs.python.org/py3k/howto/lo...asic-tutorial?
This page is part of the documentation of the logging module, and is
suitable for first-time logging module users.

In your case, you can do this:

import logging
logging.basicConfig(level=logging.DEBUG)
logging.debug("This is a demo")

--
regards,
kushal
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
i m stucked... aki C++ 0 04-10-2007 05:47 AM
Why malloc get stucked? Subha C++ 5 12-08-2006 07:42 PM
Atlas Update Panel stucked omer.mush@gmail.com ASP .Net 4 10-10-2006 08:36 AM
!!!! I got stucked with this !!!!! Question part dreamcatcher C Programming 2 09-14-2003 03:31 PM
!!!! I got stucked with this !!!! dreamcatcher C Programming 0 09-14-2003 01:36 AM



Advertisments