Skip to content

Commit

Permalink
🎨 Refactor the logging module monolith (#3319)
Browse files Browse the repository at this point in the history
* 🚚 move logging config files to logging module

Signed-off-by: ff137 <ff137@proton.me>

* 🚚 move base constants for logging to own module

Signed-off-by: ff137 <ff137@proton.me>

* 🚚 move ContextFilter to own module

Signed-off-by: ff137 <ff137@proton.me>

* 🚚 move LoggingConfigurator to own module

Signed-off-by: ff137 <ff137@proton.me>

* 🚚 move TimedRotatingFileMultiProcessHandler to own module

Signed-off-by: ff137 <ff137@proton.me>

* ✨ init for config/logging module

Signed-off-by: ff137 <ff137@proton.me>

* ✅ fix TestLoggingConfigurator

Signed-off-by: ff137 <ff137@proton.me>

---------

Signed-off-by: ff137 <ff137@proton.me>
  • Loading branch information
ff137 authored Oct 31, 2024
1 parent f499871 commit 506089c
Show file tree
Hide file tree
Showing 9 changed files with 409 additions and 370 deletions.
22 changes: 22 additions & 0 deletions acapy_agent/config/logging/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from .base import (
DEFAULT_LOGGING_CONFIG_PATH_INI,
DEFAULT_MULTITENANT_LOGGING_CONFIG_PATH_INI,
LOG_FORMAT_FILE_ALIAS_PATTERN,
)
from .configurator import LoggingConfigurator, load_resource, fileConfig
from .filters import ContextFilter, context_wallet_id
from .timed_rotating_file_multi_process_handler import (
TimedRotatingFileMultiProcessHandler,
)

__all__ = [
"DEFAULT_LOGGING_CONFIG_PATH_INI",
"DEFAULT_MULTITENANT_LOGGING_CONFIG_PATH_INI",
"LOG_FORMAT_FILE_ALIAS_PATTERN",
"LoggingConfigurator",
"load_resource",
"fileConfig",
"ContextFilter",
"context_wallet_id",
"TimedRotatingFileMultiProcessHandler",
]
9 changes: 9 additions & 0 deletions acapy_agent/config/logging/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
"""Base configurations and constants for logging."""

DEFAULT_LOGGING_CONFIG_PATH_INI = "acapy_agent.config.logging:default_logging_config.ini"
DEFAULT_MULTITENANT_LOGGING_CONFIG_PATH_INI = (
"acapy_agent.config.logging:default_multitenant_logging_config.ini"
)
LOG_FORMAT_FILE_ALIAS_PATTERN = (
"%(asctime)s %(wallet_id)s %(levelname)s %(pathname)s:%(lineno)d %(message)s"
)
Loading

0 comments on commit 506089c

Please sign in to comment.