suppress logs for dashboards (#3522)

Co-authored-by: Chavithra <chavithra@gmail.com>
This commit is contained in:
Henrique Joaquim
2022-11-22 12:33:25 +00:00
committed by GitHub
parent eb0c305107
commit d565f7d0a7

View File

@@ -7,6 +7,7 @@ import os
import subprocess # nosec
from typing import List
import openbb_terminal.config_terminal as cfg
from openbb_terminal import feature_flags as obbff
from openbb_terminal.custom_prompt_toolkit import NestedCompleter
from openbb_terminal.decorators import log_start_end
@@ -159,12 +160,14 @@ def create_call_voila(other_args: List[str], name: str, filename: str = None) ->
if ns_parser.dark and not ns_parser.jupyter:
args += "--theme=dark"
if ns_parser.input or response.lower() == "y":
cfg.LOGGING_SUPPRESS = True
subprocess.Popen(
f"{cmd} {file} {args}",
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
shell=True, # nosec
)
cfg.LOGGING_SUPPRESS = False
else:
console.print(f"Type: {cmd} voila/{file}\ninto a terminal to run.")