Comments (12)
import logging
dataset_log = logging.getLogger("dataset")
dataset_log.setLevel(logging.WARNING)
from dataset.
Is that documented anywhere?
And why's it the default? I don't think I've ever seen a Python library where logging was opt-out rather than opt-in.
from dataset.
Ok, should probably flip it.
from dataset.
requests has debug messages enabled by default, too.
from dataset.
@gka Not that I've ever noticed. Are you sure?
from dataset.
http://stackoverflow.com/questions/11029717/how-do-i-disable-log-messages-from-the-requests-library
from dataset.
I stand corrected. Although I've still never seen any such messages in my use of requests.
The difference, I think, is that I can write something like this in a python file…
import requests
requests.get('http://httpbin.org/ip')
requests.post('http://httpbin.org/post', data={"foo": "bar"})
…and when I run it, I don't see any debugging cruft from requests. But if I write an equally simple file using dataset…
import dataset
db = dataset.connect('sqlite:///:memory:')
db["test"].insert({"foo": "bar"})
…I get a load of debug output. :-(
DEBUG:dataset.persistence.database:Creating table: test on Engine(sqlite:///:memory:)
DEBUG:dataset.persistence.table:Creating column: foo (<class 'sqlalchemy.types.UnicodeText'>) on 'test'
from dataset.
I think that 'feature' was introduced in a more recent version of requests. Maybe you have to update the package, current version is 1.2.3.
from dataset.
Ahh. I'm on 1.2.0. And to be honest, there's not much incentive to upgrade, if it means I'm going to have to prepend three lines of log-suppressing boilerplate to all my code :-/
from dataset.
requests 1.2.3 does not log by default.
I believe the culprit is line 11 of freeze/app.py:
logging.basicConfig(level=logging.DEBUG)
This is enabling logging at debug level for the global root logger (from which all loggers inherit) - that's why you're seeing logging output from requests.
From the docs at http://docs.python.org/2/library/logging.html#logging.basicConfig : "Does basic configuration for the logging system by creating a StreamHandler with a default Formatter and adding it to the root logger. The functions debug(), info(), warning(), error() and critical() will call basicConfig() automatically if no handlers are defined for the root logger."
from dataset.
After upgrading to the git version of dataset
, this no longer seems to be a problem. Is there a way that you could push the new version to PyPI too?
from dataset.
Thanks for the poke, here we go: https://pypi.python.org/pypi?:action=display&name=dataset&version=0.3.9
from dataset.
Related Issues (20)
- Increase a value without reading last value
- create_table error when source data has ID field
- SQL Alchemy links in docs broken
- CompileError at `update_many` due to column in a dataset doesn't exist in a db HOT 2
- TypeError: MetaData.__init__() got an unexpected keyword argument 'bind' under sqlalchemy 2.0 HOT 1
- Looking for help: migrating dataset to sqla 2.0.0 HOT 6
- Remove duplicates from a table
- Dataset ignore my primary key HOT 3
- SQLAlchemy examples in the doc
- Parameter passing exception
- dataset wrapper for With statement HOT 3
- bug with alembic=1.11 HOT 1
- Warn if user accidentally uses set as advanced filter?
- Current use of Database.op.add_column() does not work with later versions of alembic HOT 1
- Why doesn't it automatically recycle connections in the connection pool? HOT 1
- Python 3.11 HOT 2
- where HOT 1
- add_column() takes 3 positional arguments but 4 were given HOT 1
- can add query log ? HOT 1
- Can we have a way to filter the select of * items on find and find_one
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dataset.