Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnome.org>2009-08-09 20:01:18 +0400
committerMiguel de Icaza <miguel@gnome.org>2009-08-09 20:01:18 +0400
commit718f5f501469ba891a0959a9af91123a43e4b989 (patch)
tree94a1e9be880e323166eefb88f17b75023e013060 /mcs
parent15b93c62405f0828acb1f4236f0bbfb04ca2e84f (diff)
2009-08-09 Miguel de Icaza <miguel@novell.com>
* ConsoleLogger.cs: Change the format of the error and warnings strings to work when invoked inside Emacs by not rendering the column if available, by using lowercase "error"/"warning" strings instead of camelcased versions and to not have unnecessary padding. 2009-07-31 Ankit Jain <jankit@novell.com> svn path=/trunk/mcs/; revision=139618
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog7
-rw-r--r--mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs40
2 files changed, 38 insertions, 9 deletions
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
index 476085ab2b3..9900ef24808 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-09 Miguel de Icaza <miguel@novell.com>
+
+ * ConsoleLogger.cs: Change the format of the error and warnings
+ strings to work when invoked inside Emacs by not rendering the
+ column if available, by using lowercase "error"/"warning" strings
+ instead of camelcased versions and to not have unnecessary padding.
+
2009-07-31 Ankit Jain <jankit@novell.com>
* ConsoleLogger.cs: Keep track of all the errors and warnings
diff --git a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
index d1919c0c72e..52740db4423 100644
--- a/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
+++ b/mcs/class/Microsoft.Build.Engine/Microsoft.Build.BuildEngine/ConsoleLogger.cs
@@ -261,27 +261,49 @@ namespace Microsoft.Build.BuildEngine {
public virtual void Shutdown ()
{
}
+
+ static bool InEmacs = Environment.GetEnvironmentVariable ("EMACS") == "t";
private string FormatErrorEvent (BuildErrorEventArgs args)
{
- // FIXME: show more complicated args
- if (args.LineNumber != 0 && args.ColumnNumber != 0) {
- return String.Format ("{0}({1},{2}): {3} Error {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
- args.Subcategory, args.Code, args.Message);
+ // For some reason we get an 1-char empty string as Subcategory somtimes.
+ string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " ";
+ string subcat = subprefix == "" ? "" : args.Subcategory;
+
+ if (args.LineNumber != 0){
+ if (args.ColumnNumber != 0 && !InEmacs)
+ return String.Format ("{0}({1},{2}): {3}{4}error {5}: {6}",
+ args.File, args.LineNumber, args.ColumnNumber,
+ subprefix, subcat, args.Code, args.Message);
+
+ return String.Format ("{0}({1}): {2}{3}error {4}: {5}",
+ args.File, args.LineNumber,
+ subprefix, subcat, args.Code, args.Message);
} else {
- return String.Format ("{0}: {1} Error {2}: {3}", args.File, args.Subcategory, args.Code,
+ return String.Format ("{0}: {1}{2}error {3}: {4}", args.File, subprefix, subcat, args.Code,
args.Message);
}
}
private string FormatWarningEvent (BuildWarningEventArgs args)
{
+ // For some reason we get an 1-char empty string as Subcategory somtimes.
+ string subprefix = args.Subcategory == null || args.Subcategory == "" || args.Subcategory == " " ? "" : " ";
+ string subcat = subprefix == "" ? "" : args.Subcategory;
+
// FIXME: show more complicated args
- if (args.LineNumber != 0 && args.ColumnNumber != 0) {
- return String.Format ("{0}({1},{2}): {3} Warning {4}: {5}", args.File, args.LineNumber, args.ColumnNumber,
- args.Subcategory, args.Code, args.Message);
+ if (args.LineNumber != 0){
+
+ if (args.ColumnNumber != 0 && !InEmacs) {
+ return String.Format ("{0}({1},{2}): {3}{4}warning {5}: {6}",
+ args.File, args.LineNumber, args.ColumnNumber,
+ subprefix, subcat, args.Code, args.Message);
+ }
+ return String.Format ("{0}({1}): {2}{3}warning {4}: {5}",
+ args.File, args.LineNumber,
+ subprefix, subcat, args.Code, args.Message);
} else {
- return String.Format ("{0}: {1} Warning {2}: {3}", args.File, args.Subcategory, args.Code,
+ return String.Format ("{0}: {1} warning {2}: {3}", args.File, args.Subcategory, args.Code,
args.Message);
}
}