m3dev / gokart

Gokart solves reproducibility, task dependencies, constraints of good code, and ease of use for Machine Learning Pipeline.
https://gokart.readthedocs.io/en/latest/
MIT License
318 stars 57 forks source link

logging is unavaliable when using `gokart.build()` #230

Closed mski-iksm closed 3 years ago

mski-iksm commented 3 years ago

When using gokart.build(), logging is disabled by HideLogger.

import logging
logger = logging.getLogger(__name__)

class Example(gokart.TaskOnKart):
    def run(self):
        logger.debug("debug....")
        logger.warning("warning!!!!")
        logger.error("error")
        logger.critical("critical")
        self.dump("done")

task = Example(rerun=True)
output = gokart.build(task)

>>> # no log

I thought it would be nice to have an optional feature that would allow to change the log level as in following example.

gokart.build(task, verbose=False, loglevel=logging.WARNING)
>>> WARNING:__main__:warning!!!!
>>> ERROR:__main__:error
>>> CRITICAL:__main__:critical
vaaaaanquish commented 3 years ago

@mski-iksm I think it's already implemented. Is this a different request? https://github.com/m3dev/gokart/pull/212

mski-iksm commented 3 years ago

@vaaaaanquish This is just what I was looking for! Thank you!