From aa0ccead680443b07fd675f8b906758907bdb415 Mon Sep 17 00:00:00 2001 From: James Nowell Date: Thu, 25 Jun 2015 09:24:40 -0400 Subject: Added NullHandlers to all loggers to preven "No handler" messages When the code is run without setting up loggers, the loggers have no handlers for the emitted messages. The logging module displays: `No handlers could be found for logger "git.cmd"` on the console. By adding a NullHandler (a no-op) the message disappears, and doesn't affect logging when other handlers are configured. --- git/cmd.py | 1 + 1 file changed, 1 insertion(+) (limited to 'git/cmd.py') diff --git a/git/cmd.py b/git/cmd.py index 87e482d8..c0eeec0a 100644 --- a/git/cmd.py +++ b/git/cmd.py @@ -44,6 +44,7 @@ execute_kwargs = ('istream', 'with_keep_cwd', 'with_extended_output', 'output_stream') log = logging.getLogger('git.cmd') +log.addHandler(logging.NullHandler()) __all__ = ('Git', ) -- cgit v1.2.1