mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): centralize logging initialization
With this change, we provide a wrapper to `logging.getLogger` in the `aurweb.logging` module. Modules wishing to log using logging.conf should get their module-local loggers by calling `aurweb.logging.getLogger(__name__)`, similar to `logging.getLogger`, this way initialization with logging.conf is guaranteed. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
5ae9d09e98
commit
a06f4ec19c
10 changed files with 46 additions and 23 deletions
|
@ -1,6 +1,5 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import logging
|
||||
import sys
|
||||
|
||||
import bleach
|
||||
|
@ -10,7 +9,9 @@ import pygit2
|
|||
import aurweb.config
|
||||
import aurweb.db
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
from aurweb import logging
|
||||
|
||||
logger = logging.get_logger(__name__)
|
||||
repo_path = aurweb.config.get('serve', 'repo-path')
|
||||
commit_uri = aurweb.config.get('options', 'commit_uri')
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue