afshin-dini's picture
Modify the naming
3ee01ae
"""Run the main code for AI-Dashboard"""
import logging
import click
from ai_dashboard import __version__
from ai_dashboard.loggings import config_logger
from ai_dashboard.gui import DashboardApp
logger = logging.getLogger(__name__)
@click.command()
@click.version_option(version=__version__)
@click.option("-l", "--log_path", type=str, help="Path to save log file")
@click.option(
"-v",
"--verbose",
count=True,
help="Shorthand for info/debug/warning/error loglevel (-v/-vv/-vvv/-vvvv)",
)
def ai_dashboard_cli(log_path: str, verbose: int) -> None:
"""This is data dashboard with new AI technologies."""
if verbose == 1:
log_level = 10
elif verbose == 2:
log_level = 20
elif verbose == 3:
log_level = 30
else:
log_level = 40
config_logger(log_level, log_path)
dashboard = DashboardApp()
dashboard.run()