# Path: dragonpy/core/configs.py
# class MachineDict(dict):
# class DummyMemInfo:
# class AddressAreas(dict):
# class BaseConfig:
#     DEFAULT = None
#     BURST_COUNT = 10000
#     DEFAULT_ROMS = {}
#     def register(self, name, cls, default=False):
#     def get_shortest(self, *args):
#     def __call__(self, *args):
#     def __init__(self, areas):
#     def add_area(self, start_addr, end_addr, txt):
#     def __init__(self, cfg_dict):
#     def _get_initial_Memory(self, size):
#     def get_initial_RAM(self):
#     def get_initial_ROM(self):
#     def print_debug_info(self):


import logging
from dragonlib.utils.logging_utils import setup_logging
from dragonpy.core.configs import machine_dict






log = logging.getLogger(__name__)


# DEFAULT_LOG_FORMATTER = "%(message)s"
# DEFAULT_LOG_FORMATTER = "%(processName)s/%(threadName)s %(message)s"
# DEFAULT_LOG_FORMATTER = "[%(processName)s %(threadName)s] %(message)s"
# DEFAULT_LOG_FORMATTER = "[%(levelname)s %(asctime)s %(module)s] %(message)s"
# DEFAULT_LOG_FORMATTER = "%(levelname)8s %(created)f %(module)-12s %(message)s"
DEFAULT_LOG_FORMATTER = "%(relativeCreated)-5d %(levelname)8s %(module)13s %(lineno)d %(message)s"


class CliConfig:
    def __init__(self, machine, log, verbosity, log_formatter):
        self.machine = machine
        self.log = log
        self.verbosity = int(verbosity)
        self.log_formatter = log_formatter

        self.setup_logging()

        self.cfg_dict = {
            "verbosity": self.verbosity,
            "trace": None,
        }

# Path: dragonpy/core/configs.py
# class MachineDict(dict):
# class DummyMemInfo:
# class AddressAreas(dict):
# class BaseConfig:
#     DEFAULT = None
#     BURST_COUNT = 10000
#     DEFAULT_ROMS = {}
#     def register(self, name, cls, default=False):
#     def get_shortest(self, *args):
#     def __call__(self, *args):
#     def __init__(self, areas):
#     def add_area(self, start_addr, end_addr, txt):
#     def __init__(self, cfg_dict):
#     def _get_initial_Memory(self, size):
#     def get_initial_RAM(self):
#     def get_initial_ROM(self):
#     def print_debug_info(self):


# Path: dragonpy/core/cli.py
import logging
from dragonlib.utils.logging_utils import setup_logging
from dragonpy.core.configs import machine_dict







log = logging.getLogger(__name__)


# DEFAULT_LOG_FORMATTER = "%(message)s"
# DEFAULT_LOG_FORMATTER = "%(processName)s/%(threadName)s %(message)s"
# DEFAULT_LOG_FORMATTER = "[%(processName)s %(threadName)s] %(message)s"
# DEFAULT_LOG_FORMATTER = "[%(levelname)s %(asctime)s %(module)s] %(message)s"
# DEFAULT_LOG_FORMATTER = "%(levelname)8s %(created)f %(module)-12s %(message)s"
DEFAULT_LOG_FORMATTER = "%(relativeCreated)-5d %(levelname)8s %(module)13s %(lineno)d %(message)s"


class CliConfig:
    def __init__(self, machine, log, verbosity, log_formatter):
        self.machine = machine
        self.log = log
        self.verbosity = int(verbosity)
        self.log_formatter = log_formatter

        self.setup_logging()

        self.cfg_dict = {
            "verbosity": self.verbosity,
            "trace": None,
        }

        self.machine_run_func, self.machine_cfg = machine_dict[machine]