peterknife / boto

Automatically exported from code.google.com/p/boto
0 stars 0 forks source link

"[Boto] debug=0" does not affect logging output. #357

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Set "debug = 0" as described in
http://code.google.com/p/boto/wiki/BotoConfig
2. Do *anything* with the boto library.
3. Find yourself overwhelmed by boto's default of egregious verbosity.

What is the expected output? What do you see instead?

I would expect the debug flag to affect the logging module's verbosity.
Looking at the code, the debug flag only seems to be used in a few limited
cases, such as setting the HTTPConnection debug level.

What version of the product are you using? On what operating system?

boto-1.9b-py2.6.egg, on OSX 10.5.

Please provide any additional information below.

Providing a full logging module configuration in boto.cfg, as documented at
[http://docs.python.org/library/logging.html] *will* effect the desired
change in verbosity, but this seems unnecessarily complex. The simpler
debug=0 is more desirable.

Original issue reported on code.google.com by david....@gmail.com on 9 Apr 2010 at 1:27

GoogleCodeExporter commented 9 years ago
I'm surprised that you are getting "egregious verbosity" by default.  Is this 
getting dumped to stdout?  To a log 
file?  Are you actually seeing [DEBUG] level messages?  I didn't think the 
default behavior was that chatty.

Original comment by Mitch.Ga...@gmail.com on 10 Apr 2010 at 1:42

GoogleCodeExporter commented 9 years ago
I was surprised too. I believe it was dumped to stdout--I can confirm later 
when I'm
at my work machine. I was getting what appeared to be roughly 10 lines of 
output per
API operation.

Original comment by david....@gmail.com on 15 Apr 2010 at 12:05

GoogleCodeExporter commented 9 years ago
In case my original report might cause confusion, I was receiving the debug 
output
before any attempts to write a cfg file to change the `debug` flag. The 
addition of
the debug flag made no significant difference in the output.

Again, reviewing the code, the debug value seemed to only be used to affect the
verbosity of the HttpConnection.

Thanks, btw, for your timely response, and for providing such a comprehensive 
and
useful library.

Original comment by david....@gmail.com on 15 Apr 2010 at 12:09

GoogleCodeExporter commented 9 years ago
I've got the same problem (using versions 2.0b4 or 2.0b3). It looks like the 
settings from the /etc/boto.cfg not ~/.boto are not taken into account. I had 
to manually hardcode the boto/__init__.py file where I added:
log.setLevel(logging.WARN)
Python 2.5.2 / Ubuntu

I didn't see this issue before which makes me think (I am guessing) that 
perhaps it has something with the listing files in a bucket, e.g. when calling:

bucket = conn.lookup('bucketName')
    for key in bucket:
        ...

Original comment by radek.ma...@gmail.com on 21 Apr 2011 at 4:26

GoogleCodeExporter commented 9 years ago
One reason this problem may occur is that you set the root Python logger to 
DEBUG level somewhere in your code (like settings.py in a Django app):

logger = logging.getLogger('')
logger.setLevel(logging.DEBUG)

So, make sure you didn't do that. The default logging level is logging.WARNING, 
so if you want to get more than that but not a bunch of debug output, then go 
with logging.INFO. You'll still get more output than usual from some modules, 
but it's better than DEBUG.

Original comment by a.m.broo...@gmail.com on 15 Nov 2011 at 6:31