aboutsummaryrefslogtreecommitdiffstats
path: root/utils/llvm-build/llvmbuild/util.py
blob: ca021c4d574ed9e3c4b2ddaa12d506d574c1099f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import os
import sys

def _write_message(kind, message):
    program = os.path.basename(sys.argv[0])
    sys.stderr.write('%s: %s: %s\n' % (program, kind, message))

note = lambda message: _write_message('note', message)
warning = lambda message: _write_message('warning', message)
error = lambda message: _write_message('error', message)
fatal = lambda message: (_write_message('fatal error', message), sys.exit(1))

__all__ = ['note', 'warning', 'error', 'fatal']