diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-11-18 13:34:22 -0800 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2023-05-31 17:19:45 -0400 |
commit | 73c054ced60a0a510a990a8f0c3377657cf9fd28 (patch) | |
tree | c7babb547efc884dafbe939fba2f108e92688bf7 | |
parent | d17e3ce6ba0a22f449c9bcb82d67281048c776e9 (diff) | |
download | meson-73c054ced60a0a510a990a8f0c3377657cf9fd28.zip meson-73c054ced60a0a510a990a8f0c3377657cf9fd28.tar.gz meson-73c054ced60a0a510a990a8f0c3377657cf9fd28.tar.bz2 |
mlog: remove direct calls to log_once
This was never meant to be public API, log(once=True) is for that.
-rw-r--r-- | mesonbuild/compilers/c.py | 6 | ||||
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 2 | ||||
-rw-r--r-- | mesonbuild/mlog.py | 8 |
3 files changed, 8 insertions, 8 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index cba10a6..c1dafd0 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -484,10 +484,10 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi args = [] std = options[OptionKey('std', machine=self.for_machine, lang=self.language)] if std.value.startswith('gnu'): - mlog.log_once( + mlog.log( 'cl.exe does not actually support gnu standards, and meson ' 'will instead demote to the nearest ISO C standard. This ' - 'may cause compilation to fail.') + 'may cause compilation to fail.', once=True) # As of MVSC 16.8, /std:c11 and /std:c17 are the only valid C standard options. if std.value in {'c11', 'gnu1x', 'gnu11'}: args.append('/std:c11') @@ -540,7 +540,7 @@ class IntelClCCompiler(IntelVisualStudioLikeCompiler, VisualStudioLikeCCompilerM key = OptionKey('std', machine=self.for_machine, lang=self.language) std = options[key] if std.value == 'c89': - mlog.log_once("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.") + mlog.log("ICL doesn't explicitly implement c89, setting the standard to 'none', which is close.", once=True) elif std.value != 'none': args.append('/Qstd:' + std.value) return args diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 7a3ffb1..66d604f 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1497,7 +1497,7 @@ class Interpreter(InterpreterBase, HoldableObject): try: skip_sanity_check = self.should_skip_sanity_check(for_machine) if skip_sanity_check: - mlog.log_once('Cross compiler sanity tests disabled via the cross file.') + mlog.log('Cross compiler sanity tests disabled via the cross file.', once=True) comp = compilers.detect_compiler_for(self.environment, lang, for_machine, skip_sanity_check) if comp is None: raise InvalidArguments(f'Tried to use unknown language "{lang}".') diff --git a/mesonbuild/mlog.py b/mesonbuild/mlog.py index 471934f..bbfc8de 100644 --- a/mesonbuild/mlog.py +++ b/mesonbuild/mlog.py @@ -268,7 +268,7 @@ def log(*args: TV_Loggable, is_error: bool = False, sep: T.Optional[str] = None, end: T.Optional[str] = None) -> None: if once: - log_once(*args, is_error=is_error, nested=nested, sep=sep, end=end) + _log_once(*args, is_error=is_error, nested=nested, sep=sep, end=end) else: _log(*args, is_error=is_error, nested=nested, sep=sep, end=end) @@ -285,9 +285,9 @@ def _log(*args: TV_Loggable, is_error: bool = False, if not log_errors_only or is_error: force_print(*arr, nested=nested, sep=sep, end=end) -def log_once(*args: TV_Loggable, is_error: bool = False, - nested: bool = True, sep: T.Optional[str] = None, - end: T.Optional[str] = None) -> None: +def _log_once(*args: TV_Loggable, is_error: bool = False, + nested: bool = True, sep: T.Optional[str] = None, + end: T.Optional[str] = None) -> None: """Log variant that only prints a given message one time per meson invocation. This considers ansi decorated values by the values they wrap without |