aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mlog.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-01-03 22:32:40 +0200
committerGitHub <noreply@github.com>2018-01-03 22:32:40 +0200
commit65f78a722ad0f8ab260e7cf24636ef38e8bd957f (patch)
tree76024acbc0c7d90e8edd69ad07c79124de622a46 /mesonbuild/mlog.py
parentc814f1145bc521efd0a46b033751a6f844d24df5 (diff)
parentbcc95d7dd703779228ec81b92197e010d0e5a1ea (diff)
downloadmeson-65f78a722ad0f8ab260e7cf24636ef38e8bd957f.zip
meson-65f78a722ad0f8ab260e7cf24636ef38e8bd957f.tar.gz
meson-65f78a722ad0f8ab260e7cf24636ef38e8bd957f.tar.bz2
Merge pull request #2856 from jon-turney/warning-location
Consolidate warning location formatting
Diffstat (limited to 'mesonbuild/mlog.py')
-rw-r--r--mesonbuild/mlog.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py
index a0d07ec..aa2ac20 100644
--- a/mesonbuild/mlog.py
+++ b/mesonbuild/mlog.py
@@ -103,6 +103,13 @@ def log(*args, **kwargs):
force_print(*arr, **kwargs)
def warning(*args, **kwargs):
+ from . import environment
+
+ if kwargs.get('location'):
+ location = kwargs['location']
+ del kwargs['location']
+ args += ('in file {}, line {}.'.format(os.path.join(location.subdir, environment.build_filename), location.lineno),)
+
log(yellow('WARNING:'), *args, **kwargs)
# Format a list for logging purposes as a string. It separates