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
305 stars 57 forks source link

Feature request: Set logging level for gokart.build #211

Closed TaylerUva closed 3 years ago

TaylerUva commented 3 years ago

Allow setting of logging level in gokart.build. I would like to be able to see info logs I've created in my tasks without having to see gokart debug messages. This is useful for Juptyer Notebooks.

https://github.com/m3dev/gokart/blob/575207f5d348b8c1afbb6d1af3777c67230e15ed/gokart/build.py#L41-L51

vaaaaanquish commented 3 years ago

@TaylerUva [ASK] There is a way to make a config, what do you think of it? example: https://gist.github.com/vaaaaanquish/8719a3470aa83c7985c5416ece0299c0

Or do you think gokart.build argument would be better?

TaylerUva commented 3 years ago

For my use case a config would be better. As long as that will work with logging from other classes.

i.e. I'm a log! will get logged when do_thing() is called in TaskOnKart.run

from logging import getLogger

class MyClass:
    logger = getLogger(__name__)
    def do_thing():
        self.logger.info("I'm a log!")

Doing it through a config will also make your existing documentation more true. (I had to look at source code to realize the logging config was ignored by build)

vaaaaanquish commented 3 years ago

Doing it through a config will also make your existing documentation more true. (I had to look at source code to realize the logging config was ignored by build)

That's right. I think so too, that's very confusing.

vaaaaanquish commented 3 years ago

I was reading luigi. It looks like putting the logger configuration to luigi.build args.