✨ Added debug info to the beginning of log files
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import logging
|
import logging
|
||||||
import logging.config as logging_dot_config
|
import logging.config as logging_dot_config
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
|
import subprocess
|
||||||
|
|
||||||
from src import shared
|
from src import shared
|
||||||
|
|
||||||
@@ -65,9 +67,26 @@ def setup_logging():
|
|||||||
}
|
}
|
||||||
logging_dot_config.dictConfig(config)
|
logging_dot_config.dictConfig(config)
|
||||||
|
|
||||||
# Inform of the logging behaviour
|
|
||||||
logging.info("Logging profile: %s", shared.PROFILE)
|
def log_system_info():
|
||||||
logging.info("Console logging level for application: %s", app_log_level)
|
"""Log system debug information"""
|
||||||
logging.info("Console logging level for libraries: %s", lib_log_level)
|
|
||||||
logging.info("Use env vars LOGLEVEL, LIBLOGLEVEL to override")
|
logging.debug("Starting %s v%s (%s)", shared.APP_ID, shared.VERSION, shared.PROFILE)
|
||||||
logging.info("All message levels are written to the log file")
|
logging.debug("System: %s", sys.platform)
|
||||||
|
logging.debug("Python version: %s", sys.version)
|
||||||
|
if os.getenv("FLATPAK_ID"):
|
||||||
|
process = subprocess.run(
|
||||||
|
("flatpak-spawn", "--host", "flatpak", "--version"),
|
||||||
|
capture_output=True,
|
||||||
|
encoding="utf-8",
|
||||||
|
check=False,
|
||||||
|
)
|
||||||
|
logging.debug("Flatpak version: %s", process.stdout.rstrip())
|
||||||
|
if os.name == "posix":
|
||||||
|
uname = os.uname()
|
||||||
|
logging.debug("Uname info:")
|
||||||
|
logging.debug("\tsysname: %s", uname.sysname)
|
||||||
|
logging.debug("\trelease: %s", uname.release)
|
||||||
|
logging.debug("\tversion: %s", uname.version)
|
||||||
|
logging.debug("\tmachine: %s", uname.machine)
|
||||||
|
logging.debug("-" * 80)
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ from src.importer.sources.itch_source import ItchSource
|
|||||||
from src.importer.sources.legendary_source import LegendarySource
|
from src.importer.sources.legendary_source import LegendarySource
|
||||||
from src.importer.sources.lutris_source import LutrisSource
|
from src.importer.sources.lutris_source import LutrisSource
|
||||||
from src.importer.sources.steam_source import SteamSource
|
from src.importer.sources.steam_source import SteamSource
|
||||||
from src.logging.setup import setup_logging
|
from src.logging.setup import setup_logging, log_system_info
|
||||||
from src.preferences import PreferencesWindow
|
from src.preferences import PreferencesWindow
|
||||||
from src.store.managers.display_manager import DisplayManager
|
from src.store.managers.display_manager import DisplayManager
|
||||||
from src.store.managers.file_manager import FileManager
|
from src.store.managers.file_manager import FileManager
|
||||||
@@ -254,6 +254,8 @@ class CartridgesApplication(Adw.Application):
|
|||||||
|
|
||||||
|
|
||||||
def main(_version):
|
def main(_version):
|
||||||
|
"""App entry point"""
|
||||||
setup_logging()
|
setup_logging()
|
||||||
|
log_system_info()
|
||||||
app = CartridgesApplication()
|
app = CartridgesApplication()
|
||||||
return app.run(sys.argv)
|
return app.run(sys.argv)
|
||||||
|
|||||||
Reference in New Issue
Block a user