edelooff / sqlalchemy-json

Full-featured JSON type with mutation tracking for SQLAlchemy
http://variable-scope.com/posts/mutation-tracking-in-nested-json-structures-using-sqlalchemy
BSD 2-Clause "Simplified" License
189 stars 34 forks source link

Decrease log verbosity? #16

Closed hsharrison closed 5 years ago

hsharrison commented 5 years ago

This is a very useful utility, but it's polluting my debug logs. The changed debug message is useful but I'm less sure about the init message. If it only appeared on insert that would be one thing, but logging the object's repr every time you access an instance from the DB seems overkill. I have a relatively small application and the debug logs would otherwise be human-readable, so it's annoying. I realize it may be useful for other use cases, or for developing sqlalchemy-json, so maybe there could be an option to disable these messages?

edelooff commented 5 years ago

Looking at the amount of code that triggers logging, I agree that the current logging is excessive. It looks like all of it can be removed really, as it's just confirming that nothing is broken.

I'd be happy to accept a PR for that change, that or I'll do it myself when I find a bit of time.

hsharrison commented 5 years ago

Oops, didn't notice I was beaten. I'd be happy with either solution, most of my log messages are coming from __init__ and I can see the argument for keeping it in changed.

edelooff commented 5 years ago

I think for now removing the logging from init (and the full object representation) makes the most sense. Removing the existing debug logs might still be a thing to do eventually though. Thanks for the patch @coryvirok