https://github.com/torvalds/linux
Raw File
Tip revision: 9e0babf2c06c73cda2c0cd37a1653d823adb40ec authored by Linus Torvalds on 16 June 2019, 18:49:45 UTC
Linux 5.2-rc5
Tip revision: 9e0babf
kernellog.py
# 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)


back to top