mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Move logging_config to game.
This isn't unique to the UI, the UI is just the current caller.
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
"""Logging APIs."""
|
||||
import logging
|
||||
import logging.config
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
import yaml
|
||||
|
||||
|
||||
def init_logging(version: str) -> None:
|
||||
"""Initializes the logging configuration."""
|
||||
if not os.path.isdir("./logs"):
|
||||
os.mkdir("logs")
|
||||
|
||||
resources = Path("resources")
|
||||
log_config = resources / "default_logging.yaml"
|
||||
if (custom_log_config := resources / "logging.yaml").exists():
|
||||
log_config = custom_log_config
|
||||
with log_config.open() as log_file:
|
||||
logging.config.dictConfig(yaml.safe_load(log_file))
|
||||
|
||||
logging.info(f"DCS Liberation {version}")
|
||||
@@ -2,7 +2,6 @@ import argparse
|
||||
import logging
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
from typing import Optional
|
||||
@@ -13,7 +12,7 @@ from PySide2.QtGui import QPixmap
|
||||
from PySide2.QtWidgets import QApplication, QCheckBox, QSplashScreen
|
||||
from dcs.payloads import PayloadDirectories
|
||||
|
||||
from game import Game, VERSION, persistency
|
||||
from game import Game, VERSION, logging_config, persistency
|
||||
from game.campaignloader.campaign import Campaign, DEFAULT_BUDGET
|
||||
from game.data.weapons import Pylon, Weapon, WeaponGroup
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
@@ -27,7 +26,6 @@ from pydcs_extensions import load_mods
|
||||
from qt_ui import (
|
||||
liberation_install,
|
||||
liberation_theme,
|
||||
logging_config,
|
||||
uiconstants,
|
||||
)
|
||||
from qt_ui.windows.GameUpdateSignal import GameUpdateSignal
|
||||
|
||||
Reference in New Issue
Block a user