This repository has been archived by the owner on Sep 24, 2020. It is now read-only.
forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc: Cope with Sphinx logging deprecations
commit 096ea52 upstream. Recent versions of sphinx will emit messages like: Documentation/sphinx/kerneldoc.py:103: RemovedInSphinx20Warning: app.warning() is now deprecated. Use sphinx.util.logging instead. Switch to sphinx.util.logging to make this unsightly message go away. Alas, that interface was only added in version 1.6, so we have to add a version check to keep things working with older sphinxes. Cc: [email protected] Signed-off-by: Jonathan Corbet <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information
Showing
3 changed files
with
59 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# SPDX-License-Identifier: GPL-2.0 | ||
# | ||
# Sphinx has deprecated its older logging interface, but the replacement | ||
# only goes back to 1.6. So here's a wrapper layer to keep around for | ||
# as long as we support 1.4. | ||
# | ||
import sphinx | ||
|
||
if sphinx.__version__[:3] >= '1.6': | ||
UseLogging = True | ||
from sphinx.util import logging | ||
logger = logging.getLogger('kerneldoc') | ||
else: | ||
UseLogging = False | ||
|
||
def warn(app, message): | ||
if UseLogging: | ||
logger.warning(message) | ||
else: | ||
app.warn(message) | ||
|
||
def verbose(app, message): | ||
if UseLogging: | ||
logger.verbose(message) | ||
else: | ||
app.verbose(message) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters