added just what opensim needs...yet another command line option: -noverbose . cut down on the system console output (should really be stopping it all but not all output is going through OpenSim.Framework.Console)

0.1-prestable
MW 2007-04-26 17:50:25 +00:00
parent a7c374ac51
commit 14a4ff3081
5 changed files with 22 additions and 10 deletions

View File

@ -80,7 +80,7 @@ namespace OpenGridServices.GridServer
private OpenGrid_Main() private OpenGrid_Main()
{ {
m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this); m_console = new ConsoleBase("opengrid-gridserver-console.log", "OpenGrid", this, false);
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
} }

View File

@ -68,7 +68,7 @@ namespace OpenGridServices.UserServer
private OpenUser_Main() private OpenUser_Main()
{ {
m_console = new ConsoleBase("opengrid-userserver-console.log", "OpenUser", this); m_console = new ConsoleBase("opengrid-userserver-console.log", "OpenUser", this , false);
MainConsole.Instance = m_console; MainConsole.Instance = m_console;
} }

View File

@ -8,6 +8,7 @@ namespace OpenSim.Framework.Console
StreamWriter Log; StreamWriter Log;
public conscmd_callback cmdparser; public conscmd_callback cmdparser;
public string componentname; public string componentname;
private bool disableOutput;
// STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!! // STUPID HACK ALERT!!!! STUPID HACK ALERT!!!!!
// constype - the type of console to use (see enum ConsoleType) // constype - the type of console to use (see enum ConsoleType)
@ -21,11 +22,11 @@ namespace OpenSim.Framework.Console
// componentname - which component of the OGS system? (user, asset etc) // componentname - which component of the OGS system? (user, asset etc)
// cmdparser - a reference to a conscmd_callback object // cmdparser - a reference to a conscmd_callback object
public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser) public ConsoleBase(string LogFile, string componentname, conscmd_callback cmdparser, bool disableSystemConsole )
{ {
this.componentname = componentname; this.componentname = componentname;
this.cmdparser = cmdparser; this.cmdparser = cmdparser;
this.disableOutput = disableSystemConsole;
System.Console.WriteLine("ServerConsole.cs - creating new local console"); System.Console.WriteLine("ServerConsole.cs - creating new local console");
System.Console.WriteLine("Logs will be saved to current directory in " + LogFile); System.Console.WriteLine("Logs will be saved to current directory in " + LogFile);
Log = File.AppendText(LogFile); Log = File.AppendText(LogFile);
@ -42,14 +43,20 @@ namespace OpenSim.Framework.Console
public void Write(string format, params object[] args) public void Write(string format, params object[] args)
{ {
Log.Write(format, args); Log.Write(format, args);
if(!disableOutput)
{
System.Console.Write(format, args); System.Console.Write(format, args);
}
return; return;
} }
public void WriteLine(string format, params object[] args) public void WriteLine(string format, params object[] args)
{ {
Log.WriteLine(format, args); Log.WriteLine(format, args);
if(!disableOutput)
{
System.Console.WriteLine(format, args); System.Console.WriteLine(format, args);
}
return; return;
} }

View File

@ -90,14 +90,14 @@ namespace OpenSim
protected ConsoleBase m_console; protected ConsoleBase m_console;
public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile) public OpenSimMain(bool sandBoxMode, bool startLoginServer, string physicsEngine, bool useConfigFile, bool verbose)
{ {
this.configFileSetup = useConfigFile; this.configFileSetup = useConfigFile;
m_sandbox = sandBoxMode; m_sandbox = sandBoxMode;
m_loginserver = startLoginServer; m_loginserver = startLoginServer;
m_physicsEngine = physicsEngine; m_physicsEngine = physicsEngine;
m_console = new ConsoleBase("region-console.log", "Region", this); m_console = new ConsoleBase("region-console.log", "Region", this, verbose);
OpenSim.Framework.Console.MainConsole.Instance = m_console; OpenSim.Framework.Console.MainConsole.Instance = m_console;
} }

View File

@ -21,6 +21,7 @@ namespace OpenSim
bool userAccounts = false; bool userAccounts = false;
bool gridLocalAsset = false; bool gridLocalAsset = false;
bool useConfigFile = false; bool useConfigFile = false;
bool noverbose = false;
for (int i = 0; i < args.Length; i++) for (int i = 0; i < args.Length; i++)
{ {
@ -55,9 +56,13 @@ namespace OpenSim
{ {
useConfigFile = true; useConfigFile = true;
} }
if (args[i] == "-noverbose")
{
noverbose = true;
}
} }
OpenSimMain sim = new OpenSimMain( sandBoxMode, startLoginServer, physicsEngine, useConfigFile); OpenSimMain sim = new OpenSimMain( sandBoxMode, startLoginServer, physicsEngine, useConfigFile, noverbose);
// OpenSimRoot.Instance.Application = sim; // OpenSimRoot.Instance.Application = sim;
sim.m_sandbox = sandBoxMode; sim.m_sandbox = sandBoxMode;
sim.user_accounts = userAccounts; sim.user_accounts = userAccounts;