aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-08-11 09:47:31 -0700
committerChris Larson <chris_larson@mentor.com>2010-09-03 18:52:52 -0700
commit60293a42b5500b6139bcd912bf294f862ef9936b (patch)
tree241d029f71c01e47461c5eaceea6a7204da73dd7
parent3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d (diff)
downloadbitbake-60293a42b5500b6139bcd912bf294f862ef9936b.tar.gz
bitbake-60293a42b5500b6139bcd912bf294f862ef9936b.tar.bz2
bitbake-60293a42b5500b6139bcd912bf294f862ef9936b.zip
Add pending deprecation warnings to the bb.msg functions
Signed-off-by: Chris Larson <chris_larson@mentor.com>
-rw-r--r--TODO1
-rw-r--r--lib/bb/msg.py13
2 files changed, 13 insertions, 1 deletions
diff --git a/TODO b/TODO
index 26aecf789..e97842753 100644
--- a/TODO
+++ b/TODO
@@ -20,7 +20,6 @@
- Audit bb.fatal usage - these should all be able to be replaced with
exceptions
-- Add deprecation warnings to the bb.msg functions
- Figure out how to handle the ncurses UI. Should some of our logging
formatting stuff be made common to all of bitbake, or perhaps all UIs via
the UIHelper?
diff --git a/lib/bb/msg.py b/lib/bb/msg.py
index d0fe1f76c..79893dc18 100644
--- a/lib/bb/msg.py
+++ b/lib/bb/msg.py
@@ -26,6 +26,7 @@ import sys
import logging
import collections
from itertools import groupby
+import warnings
import bb
import bb.event
@@ -107,6 +108,8 @@ def set_debug_domains(domainargs):
#
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)
if not msgdomain:
logger.debug(level, msg)
@@ -114,9 +117,13 @@ def debug(level, msgdomain, msg, fn = None):
loggers[msgdomain].debug(level, msg)
def plain(msg, fn = None):
+ warnings.warn("bb.msg.plain will soon be deprecated in favor of the python 'logging' module",
+ PendingDeprecationWarning, stacklevel=2)
logger.plain(msg)
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 msgdomain:
logger.verbose(msg)
@@ -129,18 +136,24 @@ def note(level, msgdomain, msg, fn = None):
loggers[msgdomain].info(msg)
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:
logger.warn(msg)
else:
loggers[msgdomain].warn(msg)
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:
logger.error(msg)
else:
loggers[msgdomain].error(msg)
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:
logger.critical(msg)
else: