# -*- coding: utf-8 -*-
"""sb-fastapi CLI root."""
import logging

import click
from sb_backend.cli.commands.serve import serve


@click.group()
@click.option(
    "-v",
    "--verbose",
    help="Enable verbose logging.",
    is_flag=True,
    default=False,
)
def cli(**options):
    """sb-fastapi CLI root."""
    if options["verbose"]:
        level = logging.DEBUG
    else:
        level = logging.INFO

    logging.basicConfig(
        level=level,
        format="[%(asctime)s] [%(process)s] [%(levelname)s] %(message)s",
        datefmt="%Y-%m-%d %H:%M:%S %z",
    )


cli.add_command(serve)

[((9, 1, 9, 14), 'click.group', 'click.group', ({}, {}), '()', False, 'import click\n'), ((10, 1, 16, 1), 'click.option', 'click.option', (), '', False, 'import click\n'), ((24, 4, 28, 5), 'logging.basicConfig', 'logging.basicConfig', (), '', False, 'import logging\n')]