MonetDB / pymonetdb

The Python API for MonetDB
https://www.monetdb.org/
Mozilla Public License 2.0
28 stars 20 forks source link

Change logger.warn to logger.info #64

Closed kutsurak closed 4 years ago

kutsurak commented 4 years ago

Printing on stderr (or stdin) causes every test written in python in the MonetDB test suite to fail.

coveralls commented 4 years ago

Coverage Status

Coverage remained the same at 76.747% when pulling 95208cf0a1b6d43ed666e5f6d73c55891a29eb46 on kutsurak:logger_pr into 447f9f4868ab431f303131986084d88feee85e22 on gijzelaerr:master.

gijzelaerr commented 4 years ago

Why do the tests fail? Since these changes connect to a host not running monetdb first? Shouldn't this be info logging if this is not a warning?

How are the tests ran? You can configure your logging behaviour independent of what i log on the client side:

import logging
logging.basicConfig(level=logging.ERROR)
kutsurak commented 4 years ago

Hi Gijs,

The MonetDB test suite typically work as follows (this is a simplified description):

For each test

Some of the tests (about 160) are written in Python, and use pymonetdb to connect to the server and run the SQL. You understand that any extra output from pymonetdb itself will make those test fail.

There at least three ways to deal with this that I know of:

I believe that the last solution is the correct one. This will allow the developers of pymonetdb to use any logging facilities they need, and the application developers to choose if they want to see logging output from the library. In the case of the test suite, where we do not want any extra output, so we do not configure any handlers and logging messages do not appear anywhere.

Thoughts?

gijzelaerr commented 4 years ago

I think just changing the loglevel to info for this warning should solve the issue, since I think it is an actual info level log message and the default loger only logs warning or higher.

gijzelaerr commented 4 years ago

Ok going to change this to info on master, thanks for reporting the issue.

kutsurak commented 4 years ago

Thanks! Sorry for being silent, but offline life has been a bit hectic the past few days. I will try to finalize two other PRs (the one for blobs and one for the profiler), that I have been working on, today.

gijzelaerr commented 4 years ago

ok, i was working on the UDF stuff now also, lets move discussion about that to this issue: https://github.com/gijzelaerr/pymonetdb/issues/49