diff --git a/OpenSim.Framework.Console/ConsoleBase.cs b/OpenSim.Framework.Console/ConsoleBase.cs index 4c92474029..c72af45bdc 100644 --- a/OpenSim.Framework.Console/ConsoleBase.cs +++ b/OpenSim.Framework.Console/ConsoleBase.cs @@ -3,19 +3,19 @@ using System.IO; namespace OpenSim.Framework.Console { + public enum LogPriority : int + { + CRITICAL, + HIGH, + MEDIUM, + NORMAL, + LOW, + VERBOSE, + EXTRAVERBOSE + } + public class ConsoleBase { - public enum LogPriority : int - { - CRITICAL, - HIGH, - MEDIUM, - NORMAL, - LOW, - VERBOSE, - EXTRAVERBOSE - } - StreamWriter Log; public conscmd_callback cmdparser; public string componentname; @@ -142,7 +142,7 @@ namespace OpenSim.Framework.Console } else { - this.WriteLine("Valid options are " + OptionA + " or " + OptionB); + this.WriteLine(LogPriority.MEDIUM,"Valid options are " + OptionA + " or " + OptionB); temp = CmdPrompt(prompt, defaultresponse); } } diff --git a/OpenSim.GridInterfaces/Local/LocalAssetServer.cs b/OpenSim.GridInterfaces/Local/LocalAssetServer.cs index 9162bd3408..962cd4016d 100644 --- a/OpenSim.GridInterfaces/Local/LocalAssetServer.cs +++ b/OpenSim.GridInterfaces/Local/LocalAssetServer.cs @@ -6,6 +6,7 @@ using System.IO; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; using libsecondlife; using Db4objects.Db4o; using Db4objects.Db4o.Query; @@ -38,16 +39,16 @@ namespace OpenSim.GridInterfaces.Local this._assetRequests = new BlockingQueue(); yapfile = System.IO.File.Exists("assets.yap"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Local Asset Server class created"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Asset Server class created"); try { db = Db4oFactory.OpenFile("assets.yap"); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4 Asset database creation"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Db4 Asset database creation"); } catch (Exception e) { db.Close(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Db4 Asset server :Constructor - Exception occured"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"Db4 Asset server :Constructor - Exception occured"); OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.ToString()); } if (!yapfile) @@ -96,7 +97,7 @@ namespace OpenSim.GridInterfaces.Local { if (db != null) { - Console.WriteLine("Closing local Asset server database"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Closing local asset server database"); db.Close(); } } @@ -140,7 +141,7 @@ namespace OpenSim.GridInterfaces.Local try { - Console.WriteLine("setting up Asset database"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "Setting up asset database"); AssetBase Image = new AssetBase(); Image.FullID = new LLUUID("00000000-0000-0000-9999-000000000001"); diff --git a/OpenSim.GridInterfaces/Local/LocalGridServer.cs b/OpenSim.GridInterfaces/Local/LocalGridServer.cs index e08d635095..622eb53dfc 100644 --- a/OpenSim.GridInterfaces/Local/LocalGridServer.cs +++ b/OpenSim.GridInterfaces/Local/LocalGridServer.cs @@ -30,6 +30,7 @@ using System.Threading; using System.IO; using OpenSim.Framework.Interfaces; using OpenSim.Framework.Types; +using OpenSim.Framework.Console; using libsecondlife; using Db4objects.Db4o; using Db4objects.Db4o.Query; @@ -60,7 +61,7 @@ namespace OpenSim.GridInterfaces.Local public LocalGridServer() { Sessions = new List(); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("Local Grid Server class created"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"Local Grid Server class created"); } public override bool RequestConnection(LLUUID SimUUID, string sim_ip, uint sim_port) diff --git a/OpenSim.Physics/Manager/PhysicsManager.cs b/OpenSim.Physics/Manager/PhysicsManager.cs index 616682b0da..291fc7e45b 100644 --- a/OpenSim.Physics/Manager/PhysicsManager.cs +++ b/OpenSim.Physics/Manager/PhysicsManager.cs @@ -30,6 +30,7 @@ using System.Collections; using System.IO; using System.Reflection; using Axiom.MathLib; +using OpenSim.Framework.Console; namespace OpenSim.Physics.Manager { @@ -54,14 +55,13 @@ namespace OpenSim.Physics.Manager if(_plugins.ContainsKey(engineName)) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("creating "+engineName); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"creating "+engineName); return _plugins[engineName].GetScene(); } else { - string error = String.Format("couldn't find physicsEngine: {0}", engineName); - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(error); - throw new ArgumentException(error); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,"couldn't find physicsEngine: {0}",engineName); + throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}",engineName)); } } diff --git a/OpenSim.Physics/Manager/PhysicsScene.cs b/OpenSim.Physics/Manager/PhysicsScene.cs index 0b3dfd2d7d..b79cc4618e 100644 --- a/OpenSim.Physics/Manager/PhysicsScene.cs +++ b/OpenSim.Physics/Manager/PhysicsScene.cs @@ -28,6 +28,7 @@ using System; using System.Collections.Generic; using System.Text; +using OpenSim.Framework.Console; namespace OpenSim.Physics.Manager { @@ -65,13 +66,13 @@ namespace OpenSim.Physics.Manager public override PhysicsActor AddAvatar(PhysicsVector position) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddAvatar({0})", position); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE,"NullPhysicsScene : AddAvatar({0})", position); return PhysicsActor.Null; } public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : AddPrim({0},{1})", position, size); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : AddPrim({0},{1})", position, size); return PhysicsActor.Null; } @@ -84,12 +85,12 @@ namespace OpenSim.Physics.Manager public override void GetResults() { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : GetResults()"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : GetResults()"); } public override void SetTerrain(float[] heightMap) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.VERBOSE, "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); } public override void DeleteTerrain() diff --git a/OpenSim.Servers/BaseHttpServer.cs b/OpenSim.Servers/BaseHttpServer.cs index bb8f0ad176..bd5eed4ec3 100644 --- a/OpenSim.Servers/BaseHttpServer.cs +++ b/OpenSim.Servers/BaseHttpServer.cs @@ -7,6 +7,7 @@ using System.Threading; //using OpenSim.CAPS; using Nwc.XmlRpc; using System.Collections; +using OpenSim.Framework.Console; namespace OpenSim.Servers { @@ -219,7 +220,7 @@ namespace OpenSim.Servers public void Start() { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("BaseHttpServer.cs: Starting up HTTP Server"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"BaseHttpServer.cs: Starting up HTTP Server"); m_workerThread = new Thread(new ThreadStart(StartHTTP)); m_workerThread.IsBackground = true; @@ -230,7 +231,7 @@ namespace OpenSim.Servers { try { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"BaseHttpServer.cs: StartHTTP() - Spawned main thread OK"); m_httpListener = new HttpListener(); m_httpListener.Prefixes.Add("http://+:" + m_port + "/"); @@ -245,7 +246,7 @@ namespace OpenSim.Servers } catch (Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.Message); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,e.Message); } } } diff --git a/OpenSim.Servers/OpenGridProtocol.cs b/OpenSim.Servers/OpenGridProtocol.cs index 55c47b4300..66ca497d5d 100644 --- a/OpenSim.Servers/OpenGridProtocol.cs +++ b/OpenSim.Servers/OpenGridProtocol.cs @@ -7,6 +7,7 @@ using System.Text.RegularExpressions; using System.Threading; using Nwc.XmlRpc; using System.Collections; +using OpenSim.Framework.Console; namespace OpenSim.Servers { @@ -35,8 +36,8 @@ namespace OpenSim.Servers private void DoWork() { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); - this.WriteLine("OpenSim 0.1, running OGS protocol 1.0"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"OpenGridProtocol.cs: ClientHandler.DoWork() - Got new client"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.NORMAL, "OpenSim 0.1, running OGS protocol 1.0"); } @@ -55,7 +56,7 @@ namespace OpenSim.Servers public void Start() { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: Start() - Opening server socket"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"OpenGridProtocol.cs: Start() - Opening server socket"); m_clients = new ArrayList(); m_workerThread = new Thread(new ThreadStart(StartServerSocket)); @@ -67,7 +68,7 @@ namespace OpenSim.Servers { try { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine("OpenGridProtocol.cs: StartServerSocket() - Spawned main thread OK"); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.LOW,"OpenGridProtocol.cs: StartServerSocket() - Spawned main thread OK"); m_IPendpoint = new IPEndPoint(IPAddress.Any, m_port); @@ -87,7 +88,7 @@ namespace OpenSim.Servers } catch (Exception e) { - OpenSim.Framework.Console.MainConsole.Instance.WriteLine(e.Message); + OpenSim.Framework.Console.MainConsole.Instance.WriteLine(LogPriority.MEDIUM,e.Message); } } }