diff options
author | Jürg Billeter <j@bitron.ch> | 2011-01-28 23:50:29 +0100 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2011-01-28 23:50:29 +0100 |
commit | b6021a22cd131139aeab89fe1389fe5d7dde02ee (patch) | |
tree | 9bfcceacb52aff13e9b11e899d323b33703cc6a9 /vala/valareport.vala | |
parent | fe751a8b7a42cdc42e01c279ce373df72b5d18ad (diff) | |
download | vala-b6021a22cd131139aeab89fe1389fe5d7dde02ee.tar.gz |
Do not use verbose error reporting for deprecation warnings
Diffstat (limited to 'vala/valareport.vala')
-rw-r--r-- | vala/valareport.vala | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vala/valareport.vala b/vala/valareport.vala index 14e358376..81b3aa737 100644 --- a/vala/valareport.vala +++ b/vala/valareport.vala @@ -114,6 +114,25 @@ public class Vala.Report : Object { } /** + * Reports the specified message as deprecation warning. + * + * @param source reference to source code + * @param message warning message + */ + public virtual void depr (SourceReference? source, string message) { + if (!enable_warnings) { + return; + } + + warnings++; + if (source == null) { + stderr.printf ("warning: %s\n", message); + } else { + stderr.printf ("%s: warning: %s\n", source.to_string (), message); + } + } + + /** * Reports the specified message as warning. * * @param source reference to source code @@ -157,6 +176,9 @@ public class Vala.Report : Object { public static void notice (SourceReference? source, string message) { CodeContext.get ().report.note (source, message); } + public static void deprecated (SourceReference? source, string message) { + CodeContext.get ().report.depr (source, message); + } public static void warning (SourceReference? source, string message) { CodeContext.get ().report.warn (source, message); } |