1 # SPDX-License-Identifier: GPL-2.0 1 # SPDX-License-Identifier: GPL-2.0 2 # 2 # 3 # Sphinx has deprecated its older logging inte 3 # Sphinx has deprecated its older logging interface, but the replacement 4 # only goes back to 1.6. So here's a wrapper 4 # only goes back to 1.6. So here's a wrapper layer to keep around for 5 # as long as we support 1.4. 5 # as long as we support 1.4. 6 # 6 # 7 # We don't support 1.4 anymore, but we'll keep << 8 # we change all the code to not use them anymo << 9 # << 10 import sphinx 7 import sphinx 11 from sphinx.util import logging << 12 8 13 logger = logging.getLogger('kerneldoc') !! 9 if sphinx.__version__[:3] >= '1.6': >> 10 UseLogging = True >> 11 from sphinx.util import logging >> 12 logger = logging.getLogger('kerneldoc') >> 13 else: >> 14 UseLogging = False 14 15 15 def warn(app, message): 16 def warn(app, message): 16 logger.warning(message) !! 17 if UseLogging: >> 18 logger.warning(message) >> 19 else: >> 20 app.warn(message) 17 21 18 def verbose(app, message): 22 def verbose(app, message): 19 logger.verbose(message) !! 23 if UseLogging: >> 24 logger.verbose(message) >> 25 else: >> 26 app.verbose(message) 20 27 21 def info(app, message): 28 def info(app, message): 22 logger.info(message) !! 29 if UseLogging: >> 30 logger.info(message) >> 31 else: >> 32 app.info(message)
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.