Improve: log important module versions on startup

This commit is contained in:
Peter Bieringer 2024-12-14 08:22:22 +01:00
parent 3983b5c887
commit 119cefce34
3 changed files with 8 additions and 1 deletions

View file

@ -10,6 +10,7 @@
* Add: option [storage] folder_umask for configuration of umask (overwrite system-default) * Add: option [storage] folder_umask for configuration of umask (overwrite system-default)
* Fix: also remove 'item' from cache on delete * Fix: also remove 'item' from cache on delete
* Improve: avoid automatically invalid cache on upgrade in case no change on cache structure * Improve: avoid automatically invalid cache on upgrade in case no change on cache structure
* Improve: log important module versions on startup
## 3.3.1 ## 3.3.1

View file

@ -301,7 +301,7 @@ def serve(configuration: config.Configuration,
""" """
logger.info("Starting Radicale") logger.info("Starting Radicale (%s)", utils.packages_version())
# Copy configuration before modifying # Copy configuration before modifying
configuration = configuration.copy() configuration = configuration.copy()
configuration.update({"server": {"_internal_server": "True"}}, "server", configuration.update({"server": {"_internal_server": "True"}}, "server",

View file

@ -26,6 +26,7 @@ from radicale.log import logger
_T_co = TypeVar("_T_co", covariant=True) _T_co = TypeVar("_T_co", covariant=True)
RADICALE_MODULES: Sequence[str] = ("radicale", "vobject", "passlib", "defusedxml")
def load_plugin(internal_types: Sequence[str], module_name: str, def load_plugin(internal_types: Sequence[str], module_name: str,
class_name: str, base_class: Type[_T_co], class_name: str, base_class: Type[_T_co],
@ -50,6 +51,11 @@ def load_plugin(internal_types: Sequence[str], module_name: str,
def package_version(name): def package_version(name):
return metadata.version(name) return metadata.version(name)
def packages_version():
versions = []
for pkg in RADICALE_MODULES:
versions.append("%s=%s" % (pkg, package_version(pkg)))
return " ".join(versions)
def ssl_context_options_by_protocol(protocol: str, ssl_context_options): def ssl_context_options_by_protocol(protocol: str, ssl_context_options):
logger.debug("SSL protocol string: '%s' and current SSL context options: '0x%x'", protocol, ssl_context_options) logger.debug("SSL protocol string: '%s' and current SSL context options: '0x%x'", protocol, ssl_context_options)