Skip to content

Add cads-common loggin function call #51

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions cads_broker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import logging
import os
import sys

import cads_common.logging
import pydantic
import structlog

from cads_broker import expressions

Expand Down Expand Up @@ -100,24 +98,5 @@ def configure_logger() -> None:

This function configures the logging module to log in rfc5424 format.
"""
logging.basicConfig(
level=logging.INFO,
format="%(message)s",
stream=sys.stdout,
)

structlog.configure(
processors=[
structlog.contextvars.merge_contextvars,
structlog.stdlib.filter_by_level,
structlog.stdlib.add_logger_name,
structlog.stdlib.add_log_level,
structlog.processors.TimeStamper(fmt="%Y-%m-%d %H:%M.%S"),
structlog.processors.StackInfoRenderer(),
structlog.processors.format_exc_info,
structlog.processors.JSONRenderer(),
],
wrapper_class=structlog.stdlib.BoundLogger,
logger_factory=structlog.stdlib.LoggerFactory(),
cache_logger_on_first_use=True,
)
cads_common.logging.structlog_configure()
cads_common.logging.logging_configure()
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ classifiers = [
dependencies = [
"attrs",
"cacholote",
"cads-common",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cettina-tosto will cads-common be a public repo? otherwise, we can't put it in the dependencies because we can't install it from PyPI with pip / conda

"distributed",
"minio",
"sqlalchemy",
Expand Down