Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardize logging #193

Open
TomAugspurger opened this issue Jun 4, 2018 · 6 comments
Open

Standardize logging #193

TomAugspurger opened this issue Jun 4, 2018 · 6 comments

Comments

@TomAugspurger
Copy link
Member

  1. Provide a contextmanager for "timed" log statements.
  2. Consistent naming
  3. Consistency in what is logged
@jakirkham
Copy link
Member

Would it be worth considering capturing and forwarding logging information from things like scikit-learn wrapped algorithms? Just thinking of our recent experience watching this information getting dropped. 😉

@mrocklin
Copy link
Member

mrocklin commented Jun 6, 2018 via email

@TomAugspurger
Copy link
Member Author

TomAugspurger commented Jun 7, 2018 via email

@jakirkham
Copy link
Member

jakirkham commented Jun 7, 2018

Interesting, thanks for the reference. Gave that PR a nudge.

On a different point, it's probably worthwhile for Distributed to start capturing printed info on workers and start logging it. Currently that info is just lost, which seems worse. Opened issue ( dask/distributed#2033 ) on this point.

@TomAugspurger
Copy link
Member Author

As an example of the kind of changes I had in mind, see https://github.com/dask/dask-ml/pull/228/files#diff-86d9909fd7ff2d87b6a68dba02a52da5R217

and their use in https://github.com/dask/dask-ml/pull/228/files#diff-b551222a46da15072e0a51ca86cdae11R166

For timing things, I think a context manager like

import contextlib
from timeit import default_timer

@contextlib.contextmanager
def _timed(name, *args, **kwargs):
    start = default_timer()
    logger.info("Starting %s", name)
    yield
    stop = defult_timer()
    logger.info("Finished %s in %s, name, stop - start)  # nicer formatting for time.

would be useful

@gglanzani
Copy link
Contributor

@TomAugspurger Were you thinking about something like this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants