Skip to content

Standardize logging #193

Open
Open

Description

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

Activity

  1. jakirkham commented on Jun 6, 2018

    @jakirkham
    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. 😉

  2. mrocklin commented on Jun 6, 2018

    @mrocklin
    Member
  3. TomAugspurger commented on Jun 7, 2018

    @TomAugspurger
    MemberAuthor
  4. jakirkham commented on Jun 7, 2018

    @jakirkham
    Member

    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.

  5. TomAugspurger commented on Jun 29, 2018

    @TomAugspurger
    MemberAuthor

    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

  6. gglanzani commented on Jul 7, 2018

    @gglanzani
    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions