2 # ex:ts=4:sw=4:sts=4:et
3 # -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
5 BitBake 'msg' implementation
7 Message handling infrastructure for bitbake
9 # Copyright (C) 2006 Richard Purdie
11 This program is free software; you can redistribute it and/or modify it under
12 the terms of the GNU General Public License as published by the Free Software
13 Foundation; either version 2 of the License, or (at your option) any later
16 This program is distributed in the hope that it will be useful, but WITHOUT
17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License along with
21 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
22 Place, Suite 330, Boston, MA 02111-1307 USA.
26 import sys, os, re, bb
33 domain = bb.utils.Enum('Depends', 'Provider', 'Build', 'Parsing', 'Collection')
36 # Message control functions
39 def set_debug_level(level):
40 bb.msg.debug_level = level
42 def set_verbose(level):
43 bb.msg.verbose = level
46 # Message handling functions
49 def debug(level, domain, msg, fn = None):
52 def note(level, domain, msg, fn = None):
53 if level == 1 or verbose:
56 def warn(domain, msg, fn = None):
59 def error(domain, msg, fn = None):
62 def fatal(domain, msg, fn = None):
66 # Compatibility functions for the original message interface
68 def std_debug(lvl, msg):
69 if debug_level >= lvl:
76 print 'WARNING: ' + msg