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

Better logging #190

Open
hadim opened this issue Mar 3, 2015 · 0 comments
Open

Better logging #190

hadim opened this issue Mar 3, 2015 · 0 comments

Comments

@hadim
Copy link

hadim commented Mar 3, 2015

I currently use this kind of monkey patch to allow proper logging :

def _print(self, msg, msg_args):
    """ Display the message on stout or stderr depending on verbosity
    """
    # XXX: Not using the logger framework: need to
    # learn to use logger better.
    if not self.verbose:
        return
    if self.verbose < 50:
        writer = sys.stderr.write
    else:
        writer = sys.stdout.write
    msg = msg % msg_args
    writer('[%s]: %s\n' % (self, msg))
    logging.info('[%s]: %s\n' % (self, msg))

jb.Parallel._print = _print

Any plan to make it more configurable in a near future ?

Congrat for this tiny but awesome lib by the way !

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

No branches or pull requests

1 participant