mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-10 23:10:42 +01:00
move footer to better place and change logging to stderr
This commit is contained in:
@@ -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
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user