mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
Do logging on install-hooks during install command.
This commit is contained in:
parent
260a079ec2
commit
38d3fab4ea
1 changed files with 8 additions and 0 deletions
|
|
@ -2,13 +2,18 @@ from __future__ import print_function
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
import io
|
import io
|
||||||
|
import logging
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
import stat
|
import stat
|
||||||
|
|
||||||
|
from pre_commit.logging_handler import LoggingHandler
|
||||||
from pre_commit.util import resource_filename
|
from pre_commit.util import resource_filename
|
||||||
|
|
||||||
|
|
||||||
|
logger = logging.getLogger('pre_commit')
|
||||||
|
|
||||||
|
|
||||||
# This is used to identify the hook file we install
|
# This is used to identify the hook file we install
|
||||||
PREVIOUS_IDENTIFYING_HASHES = [
|
PREVIOUS_IDENTIFYING_HASHES = [
|
||||||
'd8ee923c46731b42cd95cc869add4062',
|
'd8ee923c46731b42cd95cc869add4062',
|
||||||
|
|
@ -66,6 +71,9 @@ def install(runner, overwrite=False, hooks=False):
|
||||||
|
|
||||||
# If they requested we install all of the hooks, do so.
|
# If they requested we install all of the hooks, do so.
|
||||||
if hooks:
|
if hooks:
|
||||||
|
# Set up our logging handler
|
||||||
|
logger.addHandler(LoggingHandler(False))
|
||||||
|
logger.setLevel(logging.INFO)
|
||||||
for repository in runner.repositories:
|
for repository in runner.repositories:
|
||||||
repository.require_installed()
|
repository.require_installed()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue