mirror of
https://github.com/Pax1601/DCSOlympus.git
synced 2025-10-29 16:56:34 +00:00
Introduces async callback support for command execution in spawn methods, adds registration/unregistration for update and startup callbacks, and improves logging and signal handling. Adds a new Kronos module and main entry point for initializing and running the API with Kronos integration. Refactors example scripts and updates VSCode launch configurations for new entry points.
16 lines
447 B
Python
16 lines
447 B
Python
# Setup a logger for the module
|
|
import logging
|
|
logger = logging.getLogger("Kronos")
|
|
logger.setLevel(logging.INFO)
|
|
handler = logging.StreamHandler()
|
|
formatter = logging.Formatter('[%(asctime)s] %(name)s - %(levelname)s - %(message)s')
|
|
handler.setFormatter(formatter)
|
|
logger.addHandler(handler)
|
|
|
|
class Kronos():
|
|
def __init__(self, api):
|
|
self.api = api
|
|
|
|
def on_startup(self):
|
|
logger.info("Kronos API started")
|
|
|