#
# Copyright (C) 2005 by Yasushi Saito (yasushi.saito@gmail.com)
# 
# Cxxchecker is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2, or (at your option) any
# later version.
#
# Cxxchecker is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
# for more details.
#

def message(obj, *args):
    name = ""
    if getattr(obj, "name"):
        name = obj.name

    p = obj
    while p and not getattr(p, "file", False):
        p = getattr(p, "context", None)
    if p:
        print "%s:%d: " % (p.file, p.line),
        
    print "%s%s: %s" % (obj.enclosingNamespace(), name, " ".join(args))
    
