Built on already existing but broken support in ecmwfapi.ECMWFDataServer and ecmwfapi.ECMWFService for passing a logging function to be used instead of the default logging function that's using print. The functionality was broken in the sense that it didn't apply to all the produced logging messages, and some of the logging messages still used print, no matter what.
That means that in order to switch to using Python's logging module one could now do something like the following:
import logging
from ecmwfapi import ECMWFDataServer
logging.basicConfig(level=logging.INFO)
def my_logging_function(msg):
logging.info(msg)
server = ECMWFDataServer(log=my_logging_function)
Still investigating switching the API to natively use the logging module, but that's for another time. I did not want to make any breaking changes, for the time being.
Built on already existing but broken support in
ecmwfapi.ECMWFDataServer
andecmwfapi.ECMWFService
for passing a logging function to be used instead of the default logging function that's usingprint
. The functionality was broken in the sense that it didn't apply to all the produced logging messages, and some of the logging messages still usedprint
, no matter what.That means that in order to switch to using Python's
logging
module one could now do something like the following:Still investigating switching the API to natively use the
logging
module, but that's for another time. I did not want to make any breaking changes, for the time being.