mirror of
https://github.com/daylinmorgan/viv.git
synced 2024-11-13 20:47:53 -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.error import HTTPError
|
||||||
from urllib.request import urlopen
|
from urllib.request import urlopen
|
||||||
|
|
||||||
__version__ = "23.5a7-2-g7da6cc7-dev"
|
__version__ = "23.5a7-3-g6e6fb99-dev"
|
||||||
|
|
||||||
|
|
||||||
class Spinner:
|
class Spinner:
|
||||||
|
@ -692,6 +692,9 @@ def run(
|
||||||
verbose: If true, print subcommand output.
|
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:
|
if spinmsg and not verbose:
|
||||||
with Spinner(spinmsg):
|
with Spinner(spinmsg):
|
||||||
p = subprocess.run(
|
p = subprocess.run(
|
||||||
|
@ -708,6 +711,8 @@ def run(
|
||||||
universal_newlines=True,
|
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:
|
if p.returncode != 0 and not ignore_error:
|
||||||
a.subprocess(command, p.stdout)
|
a.subprocess(command, p.stdout)
|
||||||
|
|
||||||
|
@ -847,7 +852,7 @@ class ViVenv:
|
||||||
"use -b/--bin to specify an entrypoint"
|
"use -b/--bin to specify an entrypoint"
|
||||||
"\nOptions:\n"
|
"\nOptions:\n"
|
||||||
)
|
)
|
||||||
message += "\t" + " ".join(
|
message += " " + " ".join(
|
||||||
(
|
(
|
||||||
a.style(p.name, "bold")
|
a.style(p.name, "bold")
|
||||||
for p in (self.path / "bin").iterdir()
|
for p in (self.path / "bin").iterdir()
|
||||||
|
|
Loading…
Reference in a new issue