Author: ankit Date: 2008-01-19 13:31:19 -0500 (Sat, 19 Jan 2008) New Revision: 93324
Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/ChangeLog trunk/monodevelop/main/src/addins/prj2make-sharp-lib/DefaultMSBuildProjectExtension.cs trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildFileFormat.cs trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildProjectServiceExtension.cs trunk/monodevelop/main/src/addins/prj2make-sharp-lib/SlnFileFormat.cs trunk/monodevelop/main/src/addins/prj2make-sharp-lib/Utils.cs trunk/monodevelop/main/src/addins/prj2make-sharp-lib/VS2003ProjectFileFormat.cs Log: * Change Console.WriteLines to LoggingService calls. Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/ChangeLog =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/ChangeLog 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/ChangeLog 2008-01-19 18:31:19 UTC (rev 93324) @@ -1,3 +1,7 @@ +2008-01-20 Ankit Jain <[EMAIL PROTECTED]> + + * Change Console.WriteLines to LoggingService calls. + 2008-01-19 Ankit Jain <[EMAIL PROTECTED]> * MSBuildProjectExtension.cs (IsLanguage): New. Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/DefaultMSBuildProjectExtension.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/DefaultMSBuildProjectExtension.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/DefaultMSBuildProjectExtension.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -118,8 +118,8 @@ continue; if (node.Attributes ["Include"] == null) { - Console.WriteLine ("Warning: Expected 'Include' attribute not found for ItemGroup '{0}'", - node.LocalName); + LoggingService.LogWarning (GettextCatalog.GetString ("Expected 'Include' attribute not found for ItemGroup '{0}'", + node.LocalName)); continue; } @@ -176,7 +176,7 @@ hintPath = Utils.Unescape (hintPath); path = Utils.MapAndResolvePath (basePath, hintPath); if (path == null) { - Console.WriteLine (GettextCatalog.GetString ( + LoggingService.LogWarning (GettextCatalog.GetString ( "HintPath ({0}) for Reference '{1}' is invalid. Ignoring.", hintPath, include)); monitor.ReportWarning (GettextCatalog.GetString ( @@ -203,7 +203,7 @@ if (String.IsNullOrEmpty (projName)) { //FIXME: Add support to load the project file from here - Console.WriteLine ("Expected element <Name> for ProjectReference '{0}'", include); + LoggingService.LogError (GettextCatalog.GetString ("Expected element <Name> for ProjectReference '{0}'", include)); return; } @@ -256,7 +256,8 @@ data.ProjectFileElements [pf] = (XmlElement) node; break; default: - LoggingService.LogWarning ("Unrecognised ItemGroup element '{0}', Include = '{1}' in project '{2}'. Ignoring.", node.LocalName, include, project.Name); + LoggingService.LogWarning (GettextCatalog.GetString ( + "Unrecognised ItemGroup element '{0}', Include = '{1}' in project '{2}'. Ignoring.", node.LocalName, include, project.Name)); break; } @@ -271,7 +272,8 @@ if (String.Compare (node.LocalName, "Content", true) != 0 && String.Compare (node.LocalName, "None", true) != 0 && Utils.ReadAsString (node, "CopyToOutputDirectory", ref str_tmp, false)) - Console.WriteLine ("Warning: CopyToOutputDirectory not supported for BuildAction '{0}', Include = '{1}'", node.LocalName, include); + LoggingService.LogDebug (GettextCatalog.GetString ( + "CopyToOutputDirectory not supported for BuildAction '{0}', Include = '{1}'", node.LocalName, include)); } } @@ -303,7 +305,7 @@ string name = MSBuildFileFormat.BuildActionToString (projectFile.BuildAction); if (name == null) { - LoggingService.LogWarning ("BuildAction.{0} not supported!", projectFile.BuildAction); + LoggingService.LogWarning (GettextCatalog.GetString ("BuildAction.{0} not supported!", projectFile.BuildAction)); return null; } Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildFileFormat.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildFileFormat.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildFileFormat.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -94,10 +94,10 @@ return true; } catch (FileNotFoundException) { - Console.WriteLine (GettextCatalog.GetString ("File not found {0} : ", file)); + LoggingService.LogError (GettextCatalog.GetString ("File not found {0} : ", file)); return false; } catch (XmlException xe) { - Console.WriteLine (GettextCatalog.GetString ("Error reading file {0} : ", xe.ToString ())); + LoggingService.LogError (GettextCatalog.GetString ("Error reading file {0} : ", xe.ToString ())); return false; } finally { if (xr != null) @@ -162,7 +162,7 @@ } } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Could not save project: {0}", file), ex); - Console.WriteLine ("Could not save project: {0}, {1}", file, ex); + LoggingService.LogError (GettextCatalog.GetString ("Could not save project: {0}, {1}", file), ex); if (!String.IsNullOrEmpty (tmpfilename)) File.Delete (tmpfilename); Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildProjectServiceExtension.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildProjectServiceExtension.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/MSBuildProjectServiceExtension.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -85,7 +85,7 @@ return null; using (StringWriter sw = new StringWriter ()) { - Console.WriteLine ("Generating partial classes for\n{0}$ {1} {2}", Path.GetDirectoryName (fname), "xamlg", fname); + LoggingService.LogDebug ("Generating partial classes for\n{0}$ {1} {2}", Path.GetDirectoryName (fname), "xamlg", fname); monitor.Log.WriteLine (GettextCatalog.GetString ( "Generating partial classes for {0} with {1}", fname, "xamlg")); ProcessWrapper pw = null; @@ -99,7 +99,7 @@ pw = Runtime.ProcessService.StartProcess (info, sw, sw, null); } catch (System.ComponentModel.Win32Exception ex) { - Console.WriteLine (GettextCatalog.GetString ( + LoggingService.LogError (GettextCatalog.GetString ( "Error while trying to invoke '{0}' to generate partial classes for '{1}' :\n {2}", "xamlg", fname, ex.ToString ())); monitor.Log.WriteLine (GettextCatalog.GetString ( "Error while trying to invoke '{0}' to generate partial classes for '{1}' :\n {2}", "xamlg", fname, ex.Message)); @@ -113,7 +113,7 @@ if (pw.ExitCode != 0) { //FIXME: Stop build on error? string output = sw.ToString (); - Console.WriteLine (GettextCatalog.GetString ( + LoggingService.LogError (GettextCatalog.GetString ( "Unable to generate partial classes ({0}) for {1}. \nReason: \n{2}\n", "xamlg", fname, output)); monitor.Log.WriteLine (GettextCatalog.GetString ( @@ -162,7 +162,7 @@ } else if (project.LanguageName == "VBNet") { rb = new VBNetResourceIdBuilder (); } else { - Console.WriteLine ("Language '{0}' not supported for building resource ids.", project.LanguageName); + LoggingService.LogError (GettextCatalog.GetString ("Language '{0}' not supported for building resource ids.", project.LanguageName)); return null; } Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/SlnFileFormat.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/SlnFileFormat.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/SlnFileFormat.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -113,7 +113,7 @@ } } catch (Exception ex) { monitor.ReportError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex); - Console.WriteLine ("Could not save solution: {0}, {1}", file, ex); + LoggingService.LogError (GettextCatalog.GetString ("Could not save solution: {0}", file), ex); if (!String.IsNullOrEmpty (tmpfilename)) File.Delete (tmpfilename); @@ -306,7 +306,7 @@ // 1. Invalid setting // 2. New imported project, which doesn't yet have // a config named rootConfigName - Console.WriteLine ("Known Problem: Invalid setting. Ignoring."); + LoggingService.LogDebug ("Known Problem: Invalid setting. Ignoring."); continue; } @@ -678,7 +678,7 @@ string [] parts = s.Split (new char [] {'='}, 2); if (parts.Length < 2) { - Console.WriteLine ("{0} ({1}) : Warning: Invalid format. Ignoring", sln.FileName, lineNum + 1); + LoggingService.LogDebug ("{0} ({1}) : Invalid format. Ignoring", sln.FileName, lineNum + 1); continue; } @@ -693,14 +693,14 @@ action = "Build.0"; left = left.Substring (0, left.Length - 8); } else { - Console.WriteLine ("{0} ({1}) : Warning: Unknown action. Only ActiveCfg & Build.0 supported.", - sln.FileName, lineNum + 1); + LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Unknown action. Only ActiveCfg & Build.0 supported.", + sln.FileName, lineNum + 1)); continue; } string [] t = left.Split (new char [] {'.'}, 2); if (t.Length < 2) { - Console.WriteLine ("{0} ({1}) : Warning: Invalid format of the left side. Ignoring", + LoggingService.LogDebug ("{0} ({1}) : Invalid format of the left side. Ignoring", sln.FileName, lineNum + 1); continue; } @@ -713,8 +713,8 @@ // already warned continue; - Console.WriteLine ("{0} ({1}) : Warning: Project with guid = '{2}' not found or not loaded. Ignoring", - sln.FileName, lineNum + 1, projGuid); + LoggingService.LogWarning (GettextCatalog.GetString ("{0} ({1}) : Project with guid = '{2}' not found or not loaded. Ignoring", + sln.FileName, lineNum + 1, projGuid)); ignoredProjects [projGuid] = projGuid; continue; } @@ -817,7 +817,7 @@ if (pair.Key.IndexOf ('|') < 0) { //Config must of the form ConfigName|Platform - Console.WriteLine ("{0} ({1}) : Invalid config name '{2}'", combine.FileName, lineNum + 1, pair.Key); + LoggingService.LogError (GettextCatalog.GetString ("{0} ({1}) : Invalid config name '{2}'", combine.FileName, lineNum + 1, pair.Key)); continue; } @@ -843,13 +843,13 @@ if (!entries.ContainsKey (pair.Value)) { //Container not found - LoggingService.LogDebug ("Project with guid '{0}' not found.", pair.Value); + LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Value)); continue; } if (!entries.ContainsKey (pair.Key)) { //Containee not found - LoggingService.LogDebug ("Project with guid '{0}' not found.", pair.Key); + LoggingService.LogWarning (GettextCatalog.GetString ("Project with guid '{0}' not found.", pair.Key)); continue; } Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/Utils.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/Utils.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/Utils.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -49,7 +49,7 @@ if (path != null) return path; - Console.WriteLine (GettextCatalog.GetString ("File name '{0}' is invalid. Ignoring.", relPath)); + LoggingService.LogWarning (GettextCatalog.GetString ("File name '{0}' is invalid. Ignoring.", relPath)); monitor.ReportWarning (GettextCatalog.GetString ("File name '{0}' is invalid. Ignoring.", relPath)); return null; } Modified: trunk/monodevelop/main/src/addins/prj2make-sharp-lib/VS2003ProjectFileFormat.cs =================================================================== --- trunk/monodevelop/main/src/addins/prj2make-sharp-lib/VS2003ProjectFileFormat.cs 2008-01-19 18:31:06 UTC (rev 93323) +++ trunk/monodevelop/main/src/addins/prj2make-sharp-lib/VS2003ProjectFileFormat.cs 2008-01-19 18:31:19 UTC (rev 93324) @@ -124,7 +124,7 @@ project = slnmaker.CreatePrjxFromCsproj (fileName, m, save); } } catch (Exception e) { - Console.WriteLine ("exception while converting : " + e.ToString ()); + LoggingService.LogError ("exception while converting : " + e.ToString ()); throw; } _______________________________________________ Mono-patches maillist - Mono-patches@lists.ximian.com http://lists.ximian.com/mailman/listinfo/mono-patches