mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-12-22 02:30:44 -06:00
feat: additional logging
This commit is contained in:
parent
6e6fb99d1c
commit
7100243470
1 changed files with 7 additions and 2 deletions
|
@ -52,7 +52,7 @@ from typing import (
|
|||
from urllib.error import HTTPError
|
||||
from urllib.request import urlopen
|
||||
|
||||
__version__ = "23.5a7-2-g7da6cc7-dev"
|
||||
__version__ = "23.5a7-3-g6e6fb99-dev"
|
||||
|
||||
|
||||
class Spinner:
|
||||
|
@ -692,6 +692,9 @@ def run(
|
|||
verbose: If true, print subcommand output.
|
||||
"""
|
||||
|
||||
# TODO: remove 'verbose' and rely on log level?
|
||||
log.debug("executing subcmd\n\t" + " ".join(command))
|
||||
|
||||
if spinmsg and not verbose:
|
||||
with Spinner(spinmsg):
|
||||
p = subprocess.run(
|
||||
|
@ -708,6 +711,8 @@ def run(
|
|||
universal_newlines=True,
|
||||
)
|
||||
|
||||
log.debug("output:\n" + "\n".join(f"-> {line}" for line in p.stdout.splitlines()))
|
||||
|
||||
if p.returncode != 0 and not ignore_error:
|
||||
a.subprocess(command, p.stdout)
|
||||
|
||||
|
@ -847,7 +852,7 @@ class ViVenv:
|
|||
"use -b/--bin to specify an entrypoint"
|
||||
"\nOptions:\n"
|
||||
)
|
||||
message += "\t" + " ".join(
|
||||
message += " " + " ".join(
|
||||
(
|
||||
a.style(p.name, "bold")
|
||||
for p in (self.path / "bin").iterdir()
|
||||
|
|
Loading…
Reference in a new issue