All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Jani Nikula <jani.nikula@intel.com>,
	linux-doc@vger.kernel.org
Subject: Re: [PATCH 5/8] doc: kerneldoc.py: convert to sphinx.util.logging
Date: Tue, 6 Feb 2024 05:43:22 +0100	[thread overview]
Message-ID: <20240206054322.45cde082@coco.lan> (raw)
In-Reply-To: <20240205175133.774271-6-vegard.nossum@oracle.com>

Em Mon,  5 Feb 2024 18:51:30 +0100
Vegard Nossum <vegard.nossum@oracle.com> escreveu:

> As of commit 3e893e16af55 ("docs: Raise the minimum Sphinx requirement
> to 2.4.4"), we can use Sphinx's built-in logging facilities.
> 
> Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>

LGTM.

Reviewed-by: Mauro Carvalho Chehab <mchehab@kernel.org>

> ---
>  Documentation/sphinx/kerneldoc.py | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/Documentation/sphinx/kerneldoc.py b/Documentation/sphinx/kerneldoc.py
> index 7acf09963daa..c74a3e417cea 100644
> --- a/Documentation/sphinx/kerneldoc.py
> +++ b/Documentation/sphinx/kerneldoc.py
> @@ -38,11 +38,13 @@ from docutils import nodes, statemachine
>  from docutils.statemachine import ViewList
>  from docutils.parsers.rst import directives, Directive
>  import sphinx
> +from sphinx.util import logging
>  from sphinx.util.docutils import switch_source_input
> -import kernellog
>  
>  __version__  = '1.0'
>  
> +logger = logging.getLogger(__name__)
> +
>  class KernelDocDirective(Directive):
>      """Extract kernel-doc comments from the specified file"""
>      required_argument = 1
> @@ -109,8 +111,7 @@ class KernelDocDirective(Directive):
>          cmd += [filename]
>  
>          try:
> -            kernellog.verbose(env.app,
> -                              'calling kernel-doc \'%s\'' % (" ".join(cmd)))
> +            logger.verbose('calling kernel-doc \'%s\'', " ".join(cmd))
>  
>              p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
>              out, err = p.communicate()
> @@ -120,8 +121,7 @@ class KernelDocDirective(Directive):
>              if p.returncode != 0:
>                  sys.stderr.write(err)
>  
> -                kernellog.warn(env.app,
> -                               'kernel-doc \'%s\' failed with return code %d' % (" ".join(cmd), p.returncode))
> +                logger.warning('kernel-doc \'%s\' failed with return code %d', " ".join(cmd), p.returncode)
>                  return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
>              elif env.config.kerneldoc_verbosity > 0:
>                  sys.stderr.write(err)
> @@ -148,8 +148,8 @@ class KernelDocDirective(Directive):
>              return node.children
>  
>          except Exception as e:  # pylint: disable=W0703
> -            kernellog.warn(env.app, 'kernel-doc \'%s\' processing failed with: %s' %
> -                           (" ".join(cmd), str(e)))
> +            logger.warning('kernel-doc \'%s\' processing failed with: %s',
> +                           " ".join(cmd), str(e))
>              return [nodes.error(None, nodes.paragraph(text = "kernel-doc missing"))]
>  
>      def do_parse(self, result, node):



Thanks,
Mauro

  reply	other threads:[~2024-02-06  4:43 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 17:51 [PATCH 0/8] Sphinx extension fix + logging/warning cleanups Vegard Nossum
2024-02-05 17:51 ` [PATCH 1/8] docs: kernel_feat.py: fix build error for missing files Vegard Nossum
2024-02-06  4:30   ` Mauro Carvalho Chehab
2024-02-06  6:03   ` Salvatore Bonaccorso
2024-02-06 22:53   ` Jonathan Corbet
2024-02-07  2:57     ` Vegard Nossum
2024-02-07 14:42       ` Jonathan Corbet
2024-02-07 15:02         ` Vegard Nossum
2024-02-08 18:06           ` Jonathan Corbet
2024-02-05 17:51 ` [PATCH 2/8] docs: kernel_{abi,feat}.py: use doc.current_source Vegard Nossum
2024-02-06  8:49   ` Jani Nikula
2024-02-06 13:04     ` Vegard Nossum
2024-02-05 17:51 ` [PATCH 3/8] doc: kernel_abi.py: convert to sphinx.util.logging Vegard Nossum
2024-02-06  4:36   ` Mauro Carvalho Chehab
2024-02-05 17:51 ` [PATCH 4/8] doc: kernel_feat.py: " Vegard Nossum
2024-02-06  4:42   ` Mauro Carvalho Chehab
2024-02-06 12:38     ` Vegard Nossum
2024-02-05 17:51 ` [PATCH 5/8] doc: kerneldoc.py: " Vegard Nossum
2024-02-06  4:43   ` Mauro Carvalho Chehab [this message]
2024-02-05 17:51 ` [PATCH 6/8] doc: kfigure.py: " Vegard Nossum
2024-02-06  3:04   ` Akira Yokosawa
2024-02-06 12:40     ` Vegard Nossum
2024-02-06  4:49   ` Mauro Carvalho Chehab
2024-02-06  8:57   ` Jani Nikula
2024-02-06 13:12     ` Vegard Nossum
2024-02-06 14:00     ` Vegard Nossum
2024-02-06 16:08     ` Mauro Carvalho Chehab
2024-02-06 18:27       ` Jani Nikula
2024-02-05 17:51 ` [PATCH 7/8] doc: remove kernellog.py Vegard Nossum
2024-02-06  4:50   ` Mauro Carvalho Chehab
2024-02-05 17:51 ` [PATCH 8/8] doc: kernel_{abi,feat}.py: warn about missing directory Vegard Nossum
2024-02-06  4:53   ` Mauro Carvalho Chehab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240206054322.45cde082@coco.lan \
    --to=mchehab@kernel.org \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=vegard.nossum@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.