aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-01-09 15:36:30 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2018-01-30 06:48:22 +1100
commit6a1a56ab57ed29d31c9550d9725e60e2fb67ac6c (patch)
tree1f60320fc3fb39d05c2a5872b928984b23f97d58 /mesonbuild/mesonmain.py
parent26b16e74a904d882d2505ee8bab42a3fafd17ac2 (diff)
downloadmeson-6a1a56ab57ed29d31c9550d9725e60e2fb67ac6c.zip
meson-6a1a56ab57ed29d31c9550d9725e60e2fb67ac6c.tar.gz
meson-6a1a56ab57ed29d31c9550d9725e60e2fb67ac6c.tar.bz2
Report warning/error locations in a format IDEs may already know how to parse
Examples: meson.build:2:0: ERROR: Dependency is both required and not-found meson.build:4: WARNING: Keyword argument "link_with" defined multiple times. These are already matched by the default compilation-error-regexp-alist in emacs. Also: Don't start 'red' markup until after the \n before an error Unabsorb full-stop at end of warning with location from mlog.warning() Update warning_location test
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index 11a631a..619aa39 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -366,10 +366,11 @@ def run(original_args, mainfile=None):
app.generate()
except Exception as e:
if isinstance(e, MesonException):
+ mlog.log()
if hasattr(e, 'file') and hasattr(e, 'lineno') and hasattr(e, 'colno'):
- mlog.log(mlog.red('\nMeson encountered an error in file %s, line %d, column %d:' % (e.file, e.lineno, e.colno)))
+ mlog.log('%s:%d:%d:' % (e.file, e.lineno, e.colno), mlog.red('ERROR: '), end='')
else:
- mlog.log(mlog.red('\nMeson encountered an error:'))
+ mlog.log(mlog.red('ERROR: '), end='')
# Error message
mlog.log(e)
# Path to log file