summaryrefslogtreecommitdiff
path: root/vala/valareport.vala
diff options
context:
space:
mode:
authorRico Tzschichholz <ricotz@ubuntu.com>2020-10-26 16:10:37 +0100
committerRico Tzschichholz <ricotz@ubuntu.com>2020-10-26 16:10:37 +0100
commit64ad6bb8aa0b26a330c2a678b5cfbba2ad0a646f (patch)
treec552623f771c0435bd8d96b50bdf9c3e7f0686f2 /vala/valareport.vala
parentcfc13478b7c1b82dc796553d27a0e003389bbbcd (diff)
downloadvala-64ad6bb8aa0b26a330c2a678b5cfbba2ad0a646f.tar.gz
vala: Convert Report.*() to real printf-like functions
This simplifies code on the caller side.
Diffstat (limited to 'vala/valareport.vala')
-rw-r--r--vala/valareport.vala25
1 files changed, 15 insertions, 10 deletions
diff --git a/vala/valareport.vala b/vala/valareport.vala
index 5df85b32e..0aad89f15 100644
--- a/vala/valareport.vala
+++ b/vala/valareport.vala
@@ -373,20 +373,25 @@ public class Vala.Report {
}
/* Convenience methods calling warn and err on correct instance */
- public static void notice (SourceReference? source, string message) {
- CodeContext.get ().report.note (source, message);
+ [PrintfFormat]
+ public static void notice (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.note (source, msg_format.vprintf (va_list ()));
}
- public static void deprecated (SourceReference? source, string message) {
- CodeContext.get ().report.depr (source, message);
+ [PrintfFormat]
+ public static void deprecated (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.depr (source, msg_format.vprintf (va_list ()));
}
- public static void experimental (SourceReference? source, string message) {
- CodeContext.get ().report.depr (source, message);
+ [PrintfFormat]
+ public static void experimental (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.depr (source, msg_format.vprintf (va_list ()));
}
- public static void warning (SourceReference? source, string message) {
- CodeContext.get ().report.warn (source, message);
+ [PrintfFormat]
+ public static void warning (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.warn (source, msg_format.vprintf (va_list ()));
}
- public static void error (SourceReference? source, string message) {
- CodeContext.get ().report.err (source, message);
+ [PrintfFormat]
+ public static void error (SourceReference? source, string msg_format, ...) {
+ CodeContext.get ().report.err (source, msg_format.vprintf (va_list ()));
}