From 01f933c273c4b0005d5b3709f48b9e79c92b38ed Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Sat, 31 May 2008 19:13:38 +0000 Subject: * Propogate OpenSimMain hack to stop mono-addins scanning warnings to the grid managing * This hack just temporarily sends console output to /dev/null when we make the relevant addins calls, restoring it afterwards --- OpenSim/Grid/GridServer/GridServerBase.cs | 7 +++++++ OpenSim/Region/Application/OpenSimMain.cs | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/OpenSim/Grid/GridServer/GridServerBase.cs b/OpenSim/Grid/GridServer/GridServerBase.cs index 263866a..a22f685 100644 --- a/OpenSim/Grid/GridServer/GridServerBase.cs +++ b/OpenSim/Grid/GridServer/GridServerBase.cs @@ -118,8 +118,15 @@ namespace OpenSim.Grid.GridServer protected void LoadGridPlugins() { + // Temporary hack to stop mono-addins scanning warnings from coming out on the console + TextWriter oldOutput = Console.Out; + Console.SetOut(new StreamWriter(Stream.Null)); + AddinManager.Initialize("."); AddinManager.Registry.Update(null); + + // Returns the console.writelines back to the console's stream + Console.SetOut(oldOutput); ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/GridServer"); foreach (TypeExtensionNode node in nodes) diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index bd18116..d790e41 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -157,14 +157,14 @@ namespace OpenSim if (Directory.Exists("addin-db-001")) Directory.Delete("addin-db-001", true); - //This blocks the scanning warnings from outputing to the console. + // This blocks the scanning warnings from outputing to the console. TextWriter oldOutput = Console.Out; Console.SetOut(new StreamWriter(Stream.Null)); AddinManager.Initialize("."); AddinManager.Registry.Update(null); - //Returns the console.writelines back to the console's stream + // Returns the console.writelines back to the console's stream Console.SetOut(oldOutput); Application.iniFilePath = startupConfig.GetString("inifile", "OpenSim.ini"); -- cgit v1.1