From 38d3fab4ea429e72b38be125065f6fb366ccd46c Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 28 Jul 2014 14:24:00 -0700 Subject: [PATCH] Do logging on install-hooks during install command. --- pre_commit/commands/install_uninstall.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pre_commit/commands/install_uninstall.py b/pre_commit/commands/install_uninstall.py index b31db5f1..6b75321a 100644 --- a/pre_commit/commands/install_uninstall.py +++ b/pre_commit/commands/install_uninstall.py @@ -2,13 +2,18 @@ from __future__ import print_function from __future__ import unicode_literals import io +import logging import os import os.path import stat +from pre_commit.logging_handler import LoggingHandler from pre_commit.util import resource_filename +logger = logging.getLogger('pre_commit') + + # This is used to identify the hook file we install PREVIOUS_IDENTIFYING_HASHES = [ 'd8ee923c46731b42cd95cc869add4062', @@ -66,6 +71,9 @@ def install(runner, overwrite=False, hooks=False): # If they requested we install all of the hooks, do so. if hooks: + # Set up our logging handler + logger.addHandler(LoggingHandler(False)) + logger.setLevel(logging.INFO) for repository in runner.repositories: repository.require_installed()