move footer to better place and change logging to stderr

This commit is contained in:
n3hrox
2019-11-03 22:07:27 +01:00
parent 89502bee88
commit 2893c9acad
2 changed files with 14 additions and 12 deletions
+11
View File
@@ -11,6 +11,17 @@ import logging.config
import colorama
FOOTER = (
"\n{yellow}Having any troubles?{nc}"
" Hit us up at {blue}https://dvc.org/support{nc},"
" we are always happy to help!"
).format(
blue=colorama.Fore.BLUE,
nc=colorama.Fore.RESET,
yellow=colorama.Fore.YELLOW,
)
class LoggingException(Exception):
def __init__(self, record):
msg = "failed to log {}".format(str(record))
+3 -12
View File
@@ -3,10 +3,11 @@
from __future__ import unicode_literals
import logging
import colorama
import sys
from dvc.cli import parse_args
from dvc.lock import LockError
from dvc.logger import FOOTER
from dvc.config import ConfigError
from dvc.analytics import Analytics
from dvc.exceptions import NotDvcRepoError, DvcParserError
@@ -17,16 +18,6 @@ from dvc.utils.compat import is_py2
logger = logging.getLogger("dvc")
footer = (
"\n{yellow}Having any troubles?{nc}"
" Hit us up at {blue}https://dvc.org/support{nc},"
" we are always happy to help!"
).format(
blue=colorama.Fore.BLUE,
nc=colorama.Fore.RESET,
yellow=colorama.Fore.YELLOW,
)
def main(argv=None):
"""Run dvc CLI command.
@@ -87,7 +78,7 @@ def main(argv=None):
clean_repos()
if ret != 0:
logger.info(footer)
print(FOOTER, file=sys.stderr)
Analytics().send_cmd(cmd, args, ret)