Skip to content

Commit 2893c9a

Browse files
author
n3hrox
committed
move footer to better place and change logging to stderr
1 parent 89502be commit 2893c9a

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

dvc/logger.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,17 @@
1111
import colorama
1212

1313

14+
FOOTER = (
15+
"\n{yellow}Having any troubles?{nc}"
16+
" Hit us up at {blue}https://dvc.org/support{nc},"
17+
" we are always happy to help!"
18+
).format(
19+
blue=colorama.Fore.BLUE,
20+
nc=colorama.Fore.RESET,
21+
yellow=colorama.Fore.YELLOW,
22+
)
23+
24+
1425
class LoggingException(Exception):
1526
def __init__(self, record):
1627
msg = "failed to log {}".format(str(record))

dvc/main.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
from __future__ import unicode_literals
44

55
import logging
6-
import colorama
6+
import sys
77

88
from dvc.cli import parse_args
99
from dvc.lock import LockError
10+
from dvc.logger import FOOTER
1011
from dvc.config import ConfigError
1112
from dvc.analytics import Analytics
1213
from dvc.exceptions import NotDvcRepoError, DvcParserError
@@ -17,16 +18,6 @@
1718

1819
logger = logging.getLogger("dvc")
1920

20-
footer = (
21-
"\n{yellow}Having any troubles?{nc}"
22-
" Hit us up at {blue}https://dvc.org/support{nc},"
23-
" we are always happy to help!"
24-
).format(
25-
blue=colorama.Fore.BLUE,
26-
nc=colorama.Fore.RESET,
27-
yellow=colorama.Fore.YELLOW,
28-
)
29-
3021

3122
def main(argv=None):
3223
"""Run dvc CLI command.
@@ -87,7 +78,7 @@ def main(argv=None):
8778
clean_repos()
8879

8980
if ret != 0:
90-
logger.info(footer)
81+
print(FOOTER, file=sys.stderr)
9182

9283
Analytics().send_cmd(cmd, args, ret)
9384

0 commit comments

Comments
 (0)