diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2017-09-14 09:53:11 +0530 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-09-14 18:29:30 +0300 |
commit | f04d1410880d96fecc362db8bd183a7e1ed7c41f (patch) | |
tree | 2d06b8e28c5e7eb5d31e6714db183e367d264739 /mesonbuild/mesonmain.py | |
parent | c46c1e74ad930e5c0a8800e336dde4ca117c5187 (diff) | |
download | meson-f04d1410880d96fecc362db8bd183a7e1ed7c41f.zip meson-f04d1410880d96fecc362db8bd183a7e1ed7c41f.tar.gz meson-f04d1410880d96fecc362db8bd183a7e1ed7c41f.tar.bz2 |
logging: Print location of log file on error
Similar to configure
Closes https://github.com/mesonbuild/meson/issues/2316
Diffstat (limited to 'mesonbuild/mesonmain.py')
-rw-r--r-- | mesonbuild/mesonmain.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py index 6acc8d7..1657ddd 100644 --- a/mesonbuild/mesonmain.py +++ b/mesonbuild/mesonmain.py @@ -340,7 +340,7 @@ def run(args, mainfile=None): dir2 = '.' try: if mainfile is None: - sys.exit('I iz broken. Sorry.') + raise AssertionError('I iz broken. Sorry.') app = MesonApp(dir1, dir2, mainfile, handshake, options, sys.argv) except Exception as e: # Log directory does not exist, so just print @@ -356,7 +356,11 @@ def run(args, mainfile=None): mlog.log(mlog.red('\nMeson encountered an error in file %s, line %d, column %d:' % (e.file, e.lineno, e.colno))) else: mlog.log(mlog.red('\nMeson encountered an error:')) + # Error message mlog.log(e) + # Path to log file + logfile = os.path.join(app.build_dir, environment.Environment.log_dir, mlog.log_fname) + mlog.log("\nA full log can be found at", mlog.bold(logfile)) if os.environ.get('MESON_FORCE_BACKTRACE'): raise else: |