Skip to content

Commit badd005

Browse files
committed
Improve logging
1 parent 4c52fb6 commit badd005

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/sphinxcontrib/email/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Any, Dict
22

3-
import sphinx.util
43
from sphinx.application import Sphinx
4+
from sphinx.util import logging
55

66
from .handlers import html_page_context_handler
77
from .roles import EmailRole
@@ -16,7 +16,7 @@
1616
except metadata.PackageNotFoundError:
1717
pass
1818

19-
logger = sphinx.util.logging.getLogger(__name__)
19+
logger = logging.getLogger("sphinxcontrib-email")
2020

2121

2222
def setup(app: Sphinx) -> Dict[str, Any]:

src/sphinxcontrib/email/handlers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from typing import Dict
22

33
import lxml.html # nosec # noqa DUO107
4-
import sphinx.util
54
from sphinx.application import Sphinx
5+
from sphinx.util import logging
66

77
from .utils import Obfuscator
88

9-
logger = sphinx.util.logging.getLogger(__name__)
9+
logger = logging.getLogger(f"sphinxcontrib-email.{__name__}")
1010

1111

1212
def html_page_context_handler(

src/sphinxcontrib/email/roles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import re
22
from typing import List, Tuple
33

4-
import sphinx.util
54
from docutils import nodes
65
from docutils.nodes import Node, system_message
6+
from sphinx.util import logging
77
from sphinx.util.docutils import SphinxRole
88

99
from .utils import Obfuscator
1010

11-
logger = sphinx.util.logging.getLogger(__name__)
11+
logger = logging.getLogger(f"sphinxcontrib-email.{__name__}")
1212

1313

1414
class EmailRole(SphinxRole):

src/sphinxcontrib/email/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
import xml.sax.saxutils # nosec
44
from xml.etree import ElementTree as ET # nosec # noqa DUO107
55

6-
import sphinx.util
6+
from sphinx.util import logging
77

8-
logger = sphinx.util.logging.getLogger(__name__)
8+
logger = logging.getLogger(f"sphinxcontrib-email.{__name__}")
99

1010

1111
class Obfuscator:

0 commit comments

Comments
 (0)