From 32869aec47b9bc7f7046d24aabc3f3d957a929af Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 25 Oct 2007 15:34:43 +0000 Subject: [PATCH] apply http://bug.opensecondlife.org/view.php?id=512 from chillken which cleans up the verbose logic --- OpenSim/Framework/Console/LogBase.cs | 10 +++++----- OpenSim/Grid/AssetServer/Main.cs | 2 +- OpenSim/Grid/GridServer/Main.cs | 2 +- OpenSim/Grid/ScriptServer/ScriptServerMain.cs | 2 +- OpenSim/Grid/UserServer/Main.cs | 2 +- OpenSim/Region/Application/Application.cs | 2 +- OpenSim/Region/Application/OpenSimMain.cs | 6 +++--- OpenSim/Region/Examples/SimpleApp/Program.cs | 2 +- OpenSim/Tests/Inventory/TestInventory.cs | 2 +- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index 246afa185a..c976e2c646 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs @@ -51,13 +51,13 @@ namespace OpenSim.Framework.Console StreamWriter Log; public conscmd_callback cmdparser; public string componentname; - private bool m_silent; + private bool m_verbose; - public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool silent) + public LogBase(string LogFile, string componentname, conscmd_callback cmdparser, bool verbose) { this.componentname = componentname; this.cmdparser = cmdparser; - this.m_silent = silent; + this.m_verbose = verbose; System.Console.WriteLine("Creating new local console"); if (String.IsNullOrEmpty(LogFile)) @@ -170,7 +170,7 @@ namespace OpenSim.Framework.Console /// WriteLine-style message arguments public void Verbose(string format, params object[] args) { - if (!m_silent) + if (m_verbose) { WriteNewLine(ConsoleColor.Gray, format, args); return; @@ -185,7 +185,7 @@ namespace OpenSim.Framework.Console /// WriteLine-style message arguments public void Verbose(string sender, string format, params object[] args) { - if (!m_silent) + if (m_verbose) { WritePrefixLine(DeriveColor(sender), sender); WriteNewLine(ConsoleColor.Gray, format, args); diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 3061e5c934..9f1f9a25e8 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -86,7 +86,7 @@ namespace OpenSim.Grid.AssetServer { Directory.CreateDirectory(Util.logDir()); } - m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-AssetServer-console.log")), "OpenAsset", this, false); + m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-AssetServer-console.log")), "OpenAsset", this, true); MainLog.Instance = m_console; } diff --git a/OpenSim/Grid/GridServer/Main.cs b/OpenSim/Grid/GridServer/Main.cs index 89497d8b41..2015be5631 100644 --- a/OpenSim/Grid/GridServer/Main.cs +++ b/OpenSim/Grid/GridServer/Main.cs @@ -90,7 +90,7 @@ namespace OpenSim.Grid.GridServer { Directory.CreateDirectory(Util.logDir()); } - m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-gridserver-console.log")), "OpenGrid", this, false); + m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-gridserver-console.log")), "OpenGrid", this, true); MainLog.Instance = m_console; diff --git a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs index f22f2e65ec..478915b668 100644 --- a/OpenSim/Grid/ScriptServer/ScriptServerMain.cs +++ b/OpenSim/Grid/ScriptServer/ScriptServerMain.cs @@ -62,7 +62,7 @@ namespace OpenSim.Grid.ScriptServer Directory.CreateDirectory(Util.logDir()); } - return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, false); + return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, true); } public void RunCmd(string command, string[] cmdparams) diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index b27017100a..b8d9065141 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -67,7 +67,7 @@ namespace OpenSim.Grid.UserServer { Directory.CreateDirectory(Util.logDir()); } - m_console = new LogBase((Path.Combine(Util.logDir(),"opengrid-userserver-console.log")), "OpenUser", this , false); + m_console = new LogBase((Path.Combine(Util.logDir(), "opengrid-userserver-console.log")), "OpenUser", this, true); MainLog.Instance = m_console; } diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index 8e2793e3f5..8079ab8084 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -64,7 +64,7 @@ namespace OpenSim configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "gridmode"); configSource.AddSwitch("Startup", "physics"); - configSource.AddSwitch("Startup", "noverbose"); + configSource.AddSwitch("Startup", "verbose"); configSource.AddSwitch("Startup", "useexecutepath"); OpenSimMain sim = new OpenSimMain(configSource); diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index a34533422c..55913a833a 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -74,7 +74,7 @@ namespace OpenSim protected List m_udpServers = new List(); protected List m_regionData = new List(); - private bool m_silent; + private bool m_verbose; private readonly string m_logFilename = ("region-console.log"); private bool m_permissions = false; @@ -122,7 +122,7 @@ namespace OpenSim m_networkServersInfo = new NetworkServersInfo(); m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false); m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics"); - m_silent = m_config.Configs["Startup"].GetBoolean("noverbose", false); + m_verbose = m_config.Configs["Startup"].GetBoolean("verbose", true); m_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false); m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); @@ -319,7 +319,7 @@ namespace OpenSim Directory.CreateDirectory(Util.logDir()); } - return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, m_silent); + return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, m_verbose); } # region Setup methods diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs index 35f205196a..36be3e87f1 100644 --- a/OpenSim/Region/Examples/SimpleApp/Program.cs +++ b/OpenSim/Region/Examples/SimpleApp/Program.cs @@ -50,7 +50,7 @@ namespace SimpleApp protected override LogBase CreateLog() { - return new LogBase(null, "SimpleApp", this, false); + return new LogBase(null, "SimpleApp", this, true); } protected override void Initialize() diff --git a/OpenSim/Tests/Inventory/TestInventory.cs b/OpenSim/Tests/Inventory/TestInventory.cs index f9a791ff8f..697b335281 100644 --- a/OpenSim/Tests/Inventory/TestInventory.cs +++ b/OpenSim/Tests/Inventory/TestInventory.cs @@ -55,7 +55,7 @@ namespace OpenSim.Test.Inventory _agent_1_id = LLUUID.Random(); - MainLog.Instance = new LogBase("UnitTest.log", "TEST", null, true); + MainLog.Instance = new LogBase("UnitTest.log", "TEST", null, false); // _dbPlugin = new SQLiteInventoryStore(); _dbPlugin = new MySQLInventoryData(); _dbPlugin.Initialise();