which cleans up the verbose logic
afrisby
Sean Dague 2007-10-25 15:34:43 +00:00
parent 1d5ec16865
commit 32869aec47
9 changed files with 15 additions and 15 deletions

View File

@ -51,13 +51,13 @@ namespace OpenSim.Framework.Console
StreamWriter Log; StreamWriter Log;
public conscmd_callback cmdparser; public conscmd_callback cmdparser;
public string componentname; 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.componentname = componentname;
this.cmdparser = cmdparser; this.cmdparser = cmdparser;
this.m_silent = silent; this.m_verbose = verbose;
System.Console.WriteLine("Creating new local console"); System.Console.WriteLine("Creating new local console");
if (String.IsNullOrEmpty(LogFile)) if (String.IsNullOrEmpty(LogFile))
@ -170,7 +170,7 @@ namespace OpenSim.Framework.Console
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Verbose(string format, params object[] args) public void Verbose(string format, params object[] args)
{ {
if (!m_silent) if (m_verbose)
{ {
WriteNewLine(ConsoleColor.Gray, format, args); WriteNewLine(ConsoleColor.Gray, format, args);
return; return;
@ -185,7 +185,7 @@ namespace OpenSim.Framework.Console
/// <param name="args">WriteLine-style message arguments</param> /// <param name="args">WriteLine-style message arguments</param>
public void Verbose(string sender, string format, params object[] args) public void Verbose(string sender, string format, params object[] args)
{ {
if (!m_silent) if (m_verbose)
{ {
WritePrefixLine(DeriveColor(sender), sender); WritePrefixLine(DeriveColor(sender), sender);
WriteNewLine(ConsoleColor.Gray, format, args); WriteNewLine(ConsoleColor.Gray, format, args);

View File

@ -86,7 +86,7 @@ namespace OpenSim.Grid.AssetServer
{ {
Directory.CreateDirectory(Util.logDir()); 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; MainLog.Instance = m_console;
} }

View File

@ -90,7 +90,7 @@ namespace OpenSim.Grid.GridServer
{ {
Directory.CreateDirectory(Util.logDir()); 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; MainLog.Instance = m_console;

View File

@ -62,7 +62,7 @@ namespace OpenSim.Grid.ScriptServer
Directory.CreateDirectory(Util.logDir()); 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) public void RunCmd(string command, string[] cmdparams)

View File

@ -67,7 +67,7 @@ namespace OpenSim.Grid.UserServer
{ {
Directory.CreateDirectory(Util.logDir()); 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; MainLog.Instance = m_console;
} }

View File

@ -64,7 +64,7 @@ namespace OpenSim
configSource.AddSwitch("Startup", "inifile"); configSource.AddSwitch("Startup", "inifile");
configSource.AddSwitch("Startup", "gridmode"); configSource.AddSwitch("Startup", "gridmode");
configSource.AddSwitch("Startup", "physics"); configSource.AddSwitch("Startup", "physics");
configSource.AddSwitch("Startup", "noverbose"); configSource.AddSwitch("Startup", "verbose");
configSource.AddSwitch("Startup", "useexecutepath"); configSource.AddSwitch("Startup", "useexecutepath");
OpenSimMain sim = new OpenSimMain(configSource); OpenSimMain sim = new OpenSimMain(configSource);

View File

@ -74,7 +74,7 @@ namespace OpenSim
protected List<UDPServer> m_udpServers = new List<UDPServer>(); protected List<UDPServer> m_udpServers = new List<UDPServer>();
protected List<RegionInfo> m_regionData = new List<RegionInfo>(); protected List<RegionInfo> m_regionData = new List<RegionInfo>();
private bool m_silent; private bool m_verbose;
private readonly string m_logFilename = ("region-console.log"); private readonly string m_logFilename = ("region-console.log");
private bool m_permissions = false; private bool m_permissions = false;
@ -122,7 +122,7 @@ namespace OpenSim
m_networkServersInfo = new NetworkServersInfo(); m_networkServersInfo = new NetworkServersInfo();
m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false); m_sandbox = !m_config.Configs["Startup"].GetBoolean("gridmode", false);
m_physicsEngine = m_config.Configs["Startup"].GetString("physics", "basicphysics"); 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_permissions = m_config.Configs["Startup"].GetBoolean("serverside_object_permissions", false);
m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll"); m_storageDLL = m_config.Configs["Startup"].GetString("storage_plugin", "OpenSim.DataStore.NullStorage.dll");
@ -319,7 +319,7 @@ namespace OpenSim
Directory.CreateDirectory(Util.logDir()); 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 # region Setup methods

View File

@ -50,7 +50,7 @@ namespace SimpleApp
protected override LogBase CreateLog() protected override LogBase CreateLog()
{ {
return new LogBase(null, "SimpleApp", this, false); return new LogBase(null, "SimpleApp", this, true);
} }
protected override void Initialize() protected override void Initialize()

View File

@ -55,7 +55,7 @@ namespace OpenSim.Test.Inventory
_agent_1_id = LLUUID.Random(); _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 SQLiteInventoryStore();
_dbPlugin = new MySQLInventoryData(); _dbPlugin = new MySQLInventoryData();
_dbPlugin.Initialise(); _dbPlugin.Initialise();