diff --git a/.github/workflows/antsibull-docs.yml b/.github/workflows/antsibull-docs.yml index c2239054..aab563f2 100644 --- a/.github/workflows/antsibull-docs.yml +++ b/.github/workflows/antsibull-docs.yml @@ -58,9 +58,9 @@ jobs: - name: Check out dependent project antsibull-core uses: actions/checkout@v5 with: - repository: ansible-community/antsibull-core + repository: felixfontein/antsibull-core + ref: logging path: antsibull-core - ref: ${{ matrix.antsibull_core_ref }} persist-credentials: false - name: Check out dependent project antsibull-docs-parser @@ -196,7 +196,8 @@ jobs: - name: Check out dependent project antsibull-core uses: actions/checkout@v5 with: - repository: ansible-community/antsibull-core + repository: felixfontein/antsibull-core + ref: logging path: antsibull-core persist-credentials: false @@ -281,7 +282,8 @@ jobs: - name: Check out dependent project antsibull-core uses: actions/checkout@v5 with: - repository: ansible-community/antsibull-core + repository: felixfontein/antsibull-core + ref: logging path: antsibull-core persist-credentials: false diff --git a/.github/workflows/nox.yml b/.github/workflows/nox.yml index 1f59dcc7..deedaeb4 100644 --- a/.github/workflows/nox.yml +++ b/.github/workflows/nox.yml @@ -51,7 +51,8 @@ jobs: - name: Check out dependent project antsibull-core uses: actions/checkout@v5 with: - repository: ansible-community/antsibull-core + repository: felixfontein/antsibull-core + ref: logging path: antsibull-core persist-credentials: false - name: Check out dependent project antsibull-docs-parser diff --git a/src/antsibull_docs/ansible_output/load.py b/src/antsibull_docs/ansible_output/load.py index 45fd7131..601e911a 100644 --- a/src/antsibull_docs/ansible_output/load.py +++ b/src/antsibull_docs/ansible_output/load.py @@ -13,7 +13,7 @@ from pathlib import Path import pydantic -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.pydantic import get_formatted_error_messages from antsibull_docutils.rst_code_finder import ( CodeBlockInfo, @@ -40,7 +40,7 @@ from ..schemas.collection_config import AnsibleOutputConfig, CollectionConfig -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) @dataclass diff --git a/src/antsibull_docs/ansible_output/process.py b/src/antsibull_docs/ansible_output/process.py index 4efa69f8..873c5b44 100644 --- a/src/antsibull_docs/ansible_output/process.py +++ b/src/antsibull_docs/ansible_output/process.py @@ -13,7 +13,7 @@ from pathlib import Path import jinja2 -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_docutils.rst_code_finder import ( CodeBlockInfo, ) @@ -31,7 +31,7 @@ from .load import Block, Error -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def _get_variable_value( diff --git a/src/antsibull_docs/ansible_output/replace.py b/src/antsibull_docs/ansible_output/replace.py index 57989caf..3a41b3c4 100644 --- a/src/antsibull_docs/ansible_output/replace.py +++ b/src/antsibull_docs/ansible_output/replace.py @@ -12,7 +12,7 @@ import typing as t from pathlib import Path -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_docutils.rst_code_finder import ( CodeBlockInfo, ) @@ -20,7 +20,7 @@ from .load import Error from .process import Replacement -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) _COLORS = { diff --git a/src/antsibull_docs/cli/antsibull_docs.py b/src/antsibull_docs/cli/antsibull_docs.py index 874ac630..b3ae4941 100644 --- a/src/antsibull_docs/cli/antsibull_docs.py +++ b/src/antsibull_docs/cli/antsibull_docs.py @@ -27,8 +27,11 @@ except ImportError: HAS_ARGCOMPLETE = False -import twiggy # type: ignore[import] -from antsibull_core.logging import initialize_app_logging, log +from antsibull_core.logging import ( + configure_logger, + get_module_logger, + initialize_app_logging, +) initialize_app_logging() @@ -58,7 +61,7 @@ # pylint: enable=wrong-import-position -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def _create_loader(module: str, function: str) -> Callable[[], Callable[[], int]]: @@ -949,7 +952,7 @@ def run(args: list[str]) -> int: args=parsed_args, cfg=cfg, app_context_model=DocsAppContext ) with app_context.app_and_lib_context(context_data) as (app_ctx, dummy_): - twiggy.dict_config(app_ctx.logging_cfg.model_dump()) + configure_logger(app_ctx) flog.debug("Set logging config") flog.fields(command=parsed_args.command).info("Action") diff --git a/src/antsibull_docs/cli/doc_commands/_build.py b/src/antsibull_docs/cli/doc_commands/_build.py index c4e7384e..00a10463 100644 --- a/src/antsibull_docs/cli/doc_commands/_build.py +++ b/src/antsibull_docs/cli/doc_commands/_build.py @@ -14,7 +14,7 @@ import typing as t from collections.abc import Mapping, MutableMapping -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.schemas.collection_meta import ( CollectionMetadata, CollectionsMetadata, @@ -74,7 +74,7 @@ from ...write_docs.plugin_stubs import output_all_plugin_stub_rst from ...write_docs.plugins import output_all_plugin_rst -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def _remove_collections_from_mapping( diff --git a/src/antsibull_docs/cli/doc_commands/ansible_output.py b/src/antsibull_docs/cli/doc_commands/ansible_output.py index 83b47584..c6e578fb 100644 --- a/src/antsibull_docs/cli/doc_commands/ansible_output.py +++ b/src/antsibull_docs/cli/doc_commands/ansible_output.py @@ -13,7 +13,7 @@ from pathlib import Path import pydantic -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.pydantic import get_formatted_error_messages from antsibull_fileutils.yaml import load_yaml_file @@ -37,7 +37,7 @@ from ...schemas.collection_config import AnsibleOutputConfig from ...utils.collection_copier import CollectionCopier -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def find_blocks_in_file( diff --git a/src/antsibull_docs/cli/doc_commands/collection.py b/src/antsibull_docs/cli/doc_commands/collection.py index 3d638396..91e16c08 100644 --- a/src/antsibull_docs/cli/doc_commands/collection.py +++ b/src/antsibull_docs/cli/doc_commands/collection.py @@ -16,7 +16,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core.collections import install_together from antsibull_core.galaxy import CollectionDownloader, GalaxyContext -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.venv import FakeVenvRunner from antsibull_fileutils.tempfile import AnsibleTemporaryDirectory @@ -24,7 +24,7 @@ from ...jinja2.environment import OutputFormat from ._build import generate_docs_for_all_collections -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def generate_collection_docs( diff --git a/src/antsibull_docs/cli/doc_commands/collection_plugins.py b/src/antsibull_docs/cli/doc_commands/collection_plugins.py index aeeb66a7..7a1ebd3d 100644 --- a/src/antsibull_docs/cli/doc_commands/collection_plugins.py +++ b/src/antsibull_docs/cli/doc_commands/collection_plugins.py @@ -12,7 +12,7 @@ import os.path from antsibull_core.collections import install_together -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.venv import FakeVenvRunner from antsibull_fileutils.tempfile import AnsibleTemporaryDirectory @@ -21,7 +21,7 @@ from ._build import generate_docs_for_all_collections from .collection import retrieve -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def generate_collection_plugins_docs( diff --git a/src/antsibull_docs/cli/doc_commands/current.py b/src/antsibull_docs/cli/doc_commands/current.py index 82b6c819..61049d22 100644 --- a/src/antsibull_docs/cli/doc_commands/current.py +++ b/src/antsibull_docs/cli/doc_commands/current.py @@ -7,14 +7,14 @@ from __future__ import annotations -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.venv import FakeVenvRunner from ... import app_context from ...jinja2.environment import OutputFormat from ._build import generate_docs_for_all_collections -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def generate_docs() -> int: diff --git a/src/antsibull_docs/cli/doc_commands/devel.py b/src/antsibull_docs/cli/doc_commands/devel.py index 2f6ecf46..8694a5ab 100644 --- a/src/antsibull_docs/cli/doc_commands/devel.py +++ b/src/antsibull_docs/cli/doc_commands/devel.py @@ -17,7 +17,7 @@ from antsibull_core.collections import install_together from antsibull_core.dependency_files import parse_pieces_file from antsibull_core.galaxy import CollectionDownloader, DownloadResults, GalaxyContext -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.schemas.collection_meta import CollectionsMetadata from antsibull_core.venv import FakeVenvRunner, VenvRunner from antsibull_fileutils.tempfile import AnsibleTemporaryDirectory @@ -27,7 +27,7 @@ from ...jinja2.environment import OutputFormat from ._build import generate_docs_for_all_collections -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def retrieve( diff --git a/src/antsibull_docs/cli/doc_commands/lint_docs.py b/src/antsibull_docs/cli/doc_commands/lint_docs.py index 51a0f0ef..c38452c2 100644 --- a/src/antsibull_docs/cli/doc_commands/lint_docs.py +++ b/src/antsibull_docs/cli/doc_commands/lint_docs.py @@ -10,7 +10,7 @@ import os import textwrap -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from ... import app_context from ...collection_config import lint_collection_config @@ -33,7 +33,7 @@ collect_names, ) -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def lint_collection_docs() -> int: diff --git a/src/antsibull_docs/cli/doc_commands/plugin.py b/src/antsibull_docs/cli/doc_commands/plugin.py index afe1ba0a..8bb1e199 100644 --- a/src/antsibull_docs/cli/doc_commands/plugin.py +++ b/src/antsibull_docs/cli/doc_commands/plugin.py @@ -13,7 +13,7 @@ import sys import traceback -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.subprocess_util import CalledProcessError from antsibull_core.vendored.json_utils import _filter_non_json_lines from antsibull_core.venv import FakeVenvRunner @@ -34,7 +34,7 @@ from ...write_docs.io import Output from ...write_docs.plugins import write_plugin_rst -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def generate_plugin_docs( diff --git a/src/antsibull_docs/cli/doc_commands/sphinx_init.py b/src/antsibull_docs/cli/doc_commands/sphinx_init.py index d4f44777..40f7089d 100644 --- a/src/antsibull_docs/cli/doc_commands/sphinx_init.py +++ b/src/antsibull_docs/cli/doc_commands/sphinx_init.py @@ -12,7 +12,7 @@ import sys import typing as t -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger import antsibull_docs @@ -20,7 +20,7 @@ from ...jinja2.environment import doc_environment from ...utils.text import sanitize_whitespace -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) RST_INDEX_RST = "rst/index.rst" diff --git a/src/antsibull_docs/cli/doc_commands/stable.py b/src/antsibull_docs/cli/doc_commands/stable.py index 5bc00d53..fdf95fec 100644 --- a/src/antsibull_docs/cli/doc_commands/stable.py +++ b/src/antsibull_docs/cli/doc_commands/stable.py @@ -18,7 +18,7 @@ from antsibull_core.collections import install_together from antsibull_core.dependency_files import DepsFile from antsibull_core.galaxy import CollectionDownloader, GalaxyContext -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.schemas.collection_meta import CollectionsMetadata from antsibull_core.venv import FakeVenvRunner, VenvRunner from antsibull_fileutils.tempfile import AnsibleTemporaryDirectory @@ -28,7 +28,7 @@ from ...jinja2.environment import OutputFormat from ._build import generate_docs_for_all_collections -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def retrieve( diff --git a/src/antsibull_docs/collection_config.py b/src/antsibull_docs/collection_config.py index 8edbcd33..791cca64 100644 --- a/src/antsibull_docs/collection_config.py +++ b/src/antsibull_docs/collection_config.py @@ -14,13 +14,13 @@ import asyncio_pool # type: ignore[import] import pydantic as p from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.pydantic import forbid_extras, get_formatted_error_messages from antsibull_fileutils.yaml import load_yaml_file from .schemas.collection_config import CollectionConfig -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) _ANSIBLE_CORE_CONFIG: dict[str, t.Any] = {} diff --git a/src/antsibull_docs/collection_links.py b/src/antsibull_docs/collection_links.py index 4b4b2c6b..60ec5e8d 100644 --- a/src/antsibull_docs/collection_links.py +++ b/src/antsibull_docs/collection_links.py @@ -15,7 +15,7 @@ import asyncio_pool # type: ignore[import] import pydantic as p from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.pydantic import forbid_extras, get_formatted_error_messages from antsibull_fileutils.yaml import load_yaml_file @@ -29,7 +29,7 @@ MatrixRoom, ) -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) _ANSIBLE_CORE_METADATA = { diff --git a/src/antsibull_docs/docs_parsing/ansible_doc.py b/src/antsibull_docs/docs_parsing/ansible_doc.py index 796f5e85..49c1edc8 100644 --- a/src/antsibull_docs/docs_parsing/ansible_doc.py +++ b/src/antsibull_docs/docs_parsing/ansible_doc.py @@ -15,7 +15,7 @@ import typing as t from collections.abc import Mapping -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.subprocess_util import CalledProcessError from antsibull_core.vendored.json_utils import _filter_non_json_lines from packaging.version import Version as PypiVer @@ -27,7 +27,7 @@ from antsibull_core.venv import FakeVenvRunner, VenvRunner -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def _extract_ansible_builtin_metadata(stdout: str) -> AnsibleCollectionMetadata: diff --git a/src/antsibull_docs/docs_parsing/ansible_doc_core_213.py b/src/antsibull_docs/docs_parsing/ansible_doc_core_213.py index 57c6a09c..6ac3ed98 100644 --- a/src/antsibull_docs/docs_parsing/ansible_doc_core_213.py +++ b/src/antsibull_docs/docs_parsing/ansible_doc_core_213.py @@ -14,7 +14,7 @@ from collections.abc import Mapping, MutableMapping import semantic_version as semver -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.subprocess_util import CalledProcessError from antsibull_core.vendored.json_utils import _filter_non_json_lines from packaging.version import Version as PypiVer @@ -28,7 +28,7 @@ from antsibull_core.venv import FakeVenvRunner, VenvRunner -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def _call_ansible_doc( diff --git a/src/antsibull_docs/docs_parsing/parsing.py b/src/antsibull_docs/docs_parsing/parsing.py index c8fad19f..939c0f57 100644 --- a/src/antsibull_docs/docs_parsing/parsing.py +++ b/src/antsibull_docs/docs_parsing/parsing.py @@ -10,7 +10,7 @@ import typing as t from collections.abc import Mapping, MutableMapping -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from packaging.version import Version as PypiVer from .. import app_context @@ -24,7 +24,7 @@ from antsibull_core.venv import FakeVenvRunner, VenvRunner -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def get_ansible_plugin_info( diff --git a/src/antsibull_docs/extra_docs.py b/src/antsibull_docs/extra_docs.py index 107fc1e0..2519ed8b 100644 --- a/src/antsibull_docs/extra_docs.py +++ b/src/antsibull_docs/extra_docs.py @@ -16,11 +16,11 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_fileutils.io import read_file from antsibull_fileutils.yaml import load_yaml_file -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) _RST_LABEL_DEFINITION = re.compile(r"""^\.\. _([^:]+):""") diff --git a/src/antsibull_docs/jinja2/filters.py b/src/antsibull_docs/jinja2/filters.py index e66dd34a..407bbb3c 100644 --- a/src/antsibull_docs/jinja2/filters.py +++ b/src/antsibull_docs/jinja2/filters.py @@ -13,7 +13,7 @@ import typing as t from collections.abc import Mapping, Sequence -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from docutils.utils import column_width as _column_width from jinja2.runtime import Context, Undefined from jinja2.utils import pass_context @@ -24,7 +24,7 @@ from ..utils.text import sanitize_whitespace as _sanitize_whitespace from . import OutputFormat -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) _EMAIL_ADDRESS = re.compile( r"(?:<{mail}>|\({mail}\)|{mail})".format(mail=r"[\w.+-]+@[\w.-]+\.\w+") diff --git a/src/antsibull_docs/process_docs.py b/src/antsibull_docs/process_docs.py index 2cb98812..ccfc3b0a 100644 --- a/src/antsibull_docs/process_docs.py +++ b/src/antsibull_docs/process_docs.py @@ -16,7 +16,7 @@ import pydantic as p import pydantic_core -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.schemas.collection_meta import CollectionsMetadata from . import app_context @@ -25,7 +25,7 @@ from .schemas.docs.base import BaseModel from .write_docs import BasicPluginInfo -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) #: Mapping of plugins to nonfatal errors. This is the type to use when returning the mapping. PluginErrorsRT = defaultdict[str, defaultdict[str, list[str]]] diff --git a/src/antsibull_docs/write_docs/__init__.py b/src/antsibull_docs/write_docs/__init__.py index 652e22df..545dc226 100644 --- a/src/antsibull_docs/write_docs/__init__.py +++ b/src/antsibull_docs/write_docs/__init__.py @@ -11,7 +11,7 @@ from collections.abc import Mapping, Sequence from typing import Any -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from jinja2 import Template import antsibull_docs @@ -20,7 +20,7 @@ from ..utils.text import sanitize_whitespace as _sanitize_whitespace from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) class BasicPluginInfo: diff --git a/src/antsibull_docs/write_docs/changelog.py b/src/antsibull_docs/write_docs/changelog.py index b5117d56..adff74c2 100644 --- a/src/antsibull_docs/write_docs/changelog.py +++ b/src/antsibull_docs/write_docs/changelog.py @@ -19,7 +19,7 @@ create_document_renderer, ) from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from ..docs_parsing import AnsibleCollectionMetadata from ..jinja2 import OutputFormat @@ -27,7 +27,7 @@ from . import CollectionInfoT, _get_collection_dir from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def write_changelog( diff --git a/src/antsibull_docs/write_docs/collections.py b/src/antsibull_docs/write_docs/collections.py index 234d6169..dad8f951 100644 --- a/src/antsibull_docs/write_docs/collections.py +++ b/src/antsibull_docs/write_docs/collections.py @@ -13,7 +13,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_core.schemas.collection_meta import ( CollectionsMetadata, RemovedCollectionMetadata, @@ -30,7 +30,7 @@ from . import BasicPluginInfo, CollectionInfoT, _get_collection_dir, _render_template from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def _parse_required_ansible(requires_ansible: str) -> list[str]: diff --git a/src/antsibull_docs/write_docs/hierarchy.py b/src/antsibull_docs/write_docs/hierarchy.py index 1d62d747..d2005081 100644 --- a/src/antsibull_docs/write_docs/hierarchy.py +++ b/src/antsibull_docs/write_docs/hierarchy.py @@ -14,7 +14,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from jinja2 import Template from ..docs_parsing import AnsibleCollectionMetadata @@ -24,7 +24,7 @@ from . import CollectionInfoT, _render_template from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def write_collection_list( diff --git a/src/antsibull_docs/write_docs/indexes.py b/src/antsibull_docs/write_docs/indexes.py index ecb30b4c..cb70bc47 100644 --- a/src/antsibull_docs/write_docs/indexes.py +++ b/src/antsibull_docs/write_docs/indexes.py @@ -14,7 +14,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from jinja2 import Template from ..docs_parsing import AnsibleCollectionMetadata @@ -25,7 +25,7 @@ from . import BasicPluginInfo, PluginCollectionInfoT, _render_template from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def write_callback_type_index( diff --git a/src/antsibull_docs/write_docs/io.py b/src/antsibull_docs/write_docs/io.py index bfe144aa..936b5864 100644 --- a/src/antsibull_docs/write_docs/io.py +++ b/src/antsibull_docs/write_docs/io.py @@ -15,14 +15,14 @@ from threading import Lock from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from antsibull_fileutils.io import copy_file as _copy_file from antsibull_fileutils.io import write_file as _write_file if t.TYPE_CHECKING: from _typeshed import StrOrBytesPath -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) class Output: diff --git a/src/antsibull_docs/write_docs/plugin_stubs.py b/src/antsibull_docs/write_docs/plugin_stubs.py index 9574a63d..7ab3453d 100644 --- a/src/antsibull_docs/write_docs/plugin_stubs.py +++ b/src/antsibull_docs/write_docs/plugin_stubs.py @@ -15,7 +15,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from jinja2 import Template from ..collection_links import CollectionLinks @@ -26,7 +26,7 @@ from . import _get_collection_dir, _render_template from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) async def write_stub_rst( diff --git a/src/antsibull_docs/write_docs/plugins.py b/src/antsibull_docs/write_docs/plugins.py index b2aae8f1..ff41de91 100644 --- a/src/antsibull_docs/write_docs/plugins.py +++ b/src/antsibull_docs/write_docs/plugins.py @@ -15,7 +15,7 @@ import asyncio_pool # type: ignore[import] from antsibull_core import app_context -from antsibull_core.logging import log +from antsibull_core.logging import get_module_logger from jinja2 import Template from ..collection_links import CollectionLinks @@ -26,7 +26,7 @@ from . import CollectionInfoT, PluginErrorsT, _get_collection_dir, _render_template from .io import Output -mlog = log.fields(mod=__name__) +mlog = get_module_logger(__name__) def follow_relative_links(path: str) -> str: