mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
Add pending deprecation warnings to the bb.msg functions
(Bitbake rev: 60293a42b5500b6139bcd912bf294f862ef9936b) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
committed by
Richard Purdie
parent
ecc68fa4fb
commit
55c0b36e36
+14
-2
@@ -26,6 +26,7 @@ import sys
|
|||||||
import logging
|
import logging
|
||||||
import collections
|
import collections
|
||||||
from itertools import groupby
|
from itertools import groupby
|
||||||
|
import warnings
|
||||||
import bb
|
import bb
|
||||||
import bb.event
|
import bb.event
|
||||||
|
|
||||||
@@ -109,6 +110,8 @@ def set_debug_domains(domainargs):
|
|||||||
#
|
#
|
||||||
|
|
||||||
def debug(level, msgdomain, msg, fn = None):
|
def debug(level, msgdomain, msg, fn = None):
|
||||||
|
warnings.warn("bb.msg.debug will soon be deprecated in favor of the python 'logging' module",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
level = logging.DEBUG - (level - 1)
|
level = logging.DEBUG - (level - 1)
|
||||||
if not msgdomain:
|
if not msgdomain:
|
||||||
logger.debug(level, msg)
|
logger.debug(level, msg)
|
||||||
@@ -116,10 +119,13 @@ def debug(level, msgdomain, msg, fn = None):
|
|||||||
loggers[msgdomain].debug(level, msg)
|
loggers[msgdomain].debug(level, msg)
|
||||||
|
|
||||||
def plain(msg, fn = None):
|
def plain(msg, fn = None):
|
||||||
logger.log(logging.INFO + 1, msg)
|
warnings.warn("bb.msg.plain will soon be deprecated in favor of the python 'logging' module",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
logger.plain(msg)
|
logger.plain(msg)
|
||||||
|
|
||||||
def note(level, msgdomain, msg, fn = None):
|
def note(level, msgdomain, msg, fn = None):
|
||||||
|
warnings.warn("bb.msg.note will soon be deprecated in favor of the python 'logging' module",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
if level > 1:
|
if level > 1:
|
||||||
if msgdomain:
|
if msgdomain:
|
||||||
logger.verbose(msg)
|
logger.verbose(msg)
|
||||||
@@ -132,18 +138,24 @@ def note(level, msgdomain, msg, fn = None):
|
|||||||
loggers[msgdomain].info(msg)
|
loggers[msgdomain].info(msg)
|
||||||
|
|
||||||
def warn(msgdomain, msg, fn = None):
|
def warn(msgdomain, msg, fn = None):
|
||||||
|
warnings.warn("bb.msg.warn will soon be deprecated in favor of the python 'logging' module",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
if not msgdomain:
|
if not msgdomain:
|
||||||
logger.warn(msg)
|
logger.warn(msg)
|
||||||
else:
|
else:
|
||||||
loggers[msgdomain].warn(msg)
|
loggers[msgdomain].warn(msg)
|
||||||
|
|
||||||
def error(msgdomain, msg, fn = None):
|
def error(msgdomain, msg, fn = None):
|
||||||
|
warnings.warn("bb.msg.error will soon be deprecated in favor of the python 'logging' module",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
if not msgdomain:
|
if not msgdomain:
|
||||||
logger.error(msg)
|
logger.error(msg)
|
||||||
else:
|
else:
|
||||||
loggers[msgdomain].error(msg)
|
loggers[msgdomain].error(msg)
|
||||||
|
|
||||||
def fatal(msgdomain, msg, fn = None):
|
def fatal(msgdomain, msg, fn = None):
|
||||||
|
warnings.warn("bb.msg.fatal will soon be deprecated in favor of raising appropriate exceptions",
|
||||||
|
PendingDeprecationWarning, stacklevel=2)
|
||||||
if not msgdomain:
|
if not msgdomain:
|
||||||
logger.critical(msg)
|
logger.critical(msg)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user