blob: 8ac7d274f542b78d9e6061b4f6900e309d817613 [file] [log] [blame]
Jonathan Corbet61779ce2019-07-14 10:35:45 +02001# SPDX-License-Identifier: GPL-2.0
2#
3# Sphinx has deprecated its older logging interface, but the replacement
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.
6#
7import sphinx
8
9if sphinx.__version__[:3] >= '1.6':
10 UseLogging = True
11 from sphinx.util import logging
12 logger = logging.getLogger('kerneldoc')
13else:
14 UseLogging = False
15
16def warn(app, message):
17 if UseLogging:
18 logger.warning(message)
19 else:
20 app.warn(message)
21
22def verbose(app, message):
23 if UseLogging:
24 logger.verbose(message)
25 else:
26 app.verbose(message)
27
Heinrich Schuchardt98f01cf2020-12-31 23:16:46 +010028def info(app, message):
29 if UseLogging:
30 logger.info(message)
31 else:
32 app.info(message)