From 765ff13f22ce062066e461b73f0aa6881b4fea29 Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 20 Jul 2007 01:32:27 +0000 Subject: * Assortment of Console changes - console messages are now grouped into modules (eg "client", "grid", "terrain", "storage", etc) --- OpenSim/Framework/Console/LogBase.cs | 5 +++++ .../General/Configuration/ConfigurationMember.cs | 2 +- OpenSim/Framework/UserManager/LoginResponse.cs | 2 -- OpenSim/Grid/AssetServer/Main.cs | 6 +++--- OpenSim/Grid/GridServer/GridManager.cs | 24 +++++++++++----------- OpenSim/Region/ClientStack/ClientView.API.cs | 4 ++-- OpenSim/Region/ClientStack/ClientViewBase.cs | 2 +- OpenSim/Region/ClientStack/UDPServer.cs | 2 +- .../Environment/Scenes/Scene.PacketHandlers.cs | 2 +- OpenSim/Region/Environment/Scenes/Scene.cs | 12 +++++------ .../Scenes/scripting/ScriptInterpretedAPI.cs | 4 ++-- 11 files changed, 34 insertions(+), 31 deletions(-) diff --git a/OpenSim/Framework/Console/LogBase.cs b/OpenSim/Framework/Console/LogBase.cs index db76861..7d38c3a 100644 --- a/OpenSim/Framework/Console/LogBase.cs +++ b/OpenSim/Framework/Console/LogBase.cs @@ -73,14 +73,18 @@ namespace OpenSim.Framework.Console Log.Close(); } + [Obsolete("Log.WriteLine is obsolete, use Warn / Error / Verbose instead.")] public void Write(string format, params object[] args) { + // HOUSEKEEPING : Will remove once use is removed. Notice(format, args); return; } + [Obsolete("Log.WriteLine is obsolete, use Warn / Error / Verbose instead.")] public void WriteLine(LogPriority importance, string format, params object[] args) { + // HOUSEKEEPING : Will remove once use is removed. Log.WriteLine(format, args); Log.Flush(); if (!m_silent) @@ -249,6 +253,7 @@ namespace OpenSim.Framework.Console private void WritePrefixLine(ConsoleColor color, string sender) { + sender = sender.ToUpper(); Log.WriteLine("[" + sender + "] "); Log.Flush(); diff --git a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs index 4546683..a0d019c 100644 --- a/OpenSim/Framework/General/Configuration/ConfigurationMember.cs +++ b/OpenSim/Framework/General/Configuration/ConfigurationMember.cs @@ -329,7 +329,7 @@ namespace OpenSim.Framework.Configuration } else { - MainLog.Instance.Warn("Incorrect result given, the configuration option must be " + errorMessage + ". Prompting for same option..."); + MainLog.Instance.Warn("configuration","Incorrect result given, the configuration option must be " + errorMessage + ". Prompting for same option..."); ignoreNextFromConfig = true; } } diff --git a/OpenSim/Framework/UserManager/LoginResponse.cs b/OpenSim/Framework/UserManager/LoginResponse.cs index d3dfd5b..326b943 100644 --- a/OpenSim/Framework/UserManager/LoginResponse.cs +++ b/OpenSim/Framework/UserManager/LoginResponse.cs @@ -223,8 +223,6 @@ namespace OpenSim.Framework.UserManagement responseData["sim_port"] =(Int32) this.SimPort; responseData["sim_ip"] = this.SimAddress; - MainLog.Instance.Warn("SIM IP: " + responseData["sim_ip"] + "; SIM PORT: " + responseData["sim_port"]); - responseData["agent_id"] = this.AgentID.ToStringHyphenated(); responseData["session_id"] = this.SessionID.ToStringHyphenated(); responseData["secure_session_id"] = this.SecureSessionID.ToStringHyphenated(); diff --git a/OpenSim/Grid/AssetServer/Main.cs b/OpenSim/Grid/AssetServer/Main.cs index 5a8368c..bd6341b 100644 --- a/OpenSim/Grid/AssetServer/Main.cs +++ b/OpenSim/Grid/AssetServer/Main.cs @@ -158,13 +158,13 @@ namespace OpenSim.Grid.AssetServer try { db = Db4oFactory.OpenFile("gridassets.yap"); - MainLog.Instance.Verbose("Main.cs:setupDB() - creation"); + MainLog.Instance.Verbose("storage", "Main.cs:setupDB() - creation"); } catch (Exception e) { db.Close(); - MainLog.Instance.Warn("Main.cs:setupDB() - Exception occured"); - MainLog.Instance.Warn(e.ToString()); + MainLog.Instance.Warn("storage", "Main.cs:setupDB() - Exception occured"); + MainLog.Instance.Warn("storage", e.ToString()); } if (!yapfile) { diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 3ee7aef..f4a8475 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -112,7 +112,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception) { - MainLog.Instance.Warn("Storage: unable to write log via " + kvp.Key); + MainLog.Instance.Warn("storage", "Unable to write log via " + kvp.Key); } } } @@ -131,7 +131,7 @@ namespace OpenSim.Grid.GridServer } catch (Exception e) { - MainLog.Instance.Warn("Message from Storage: " + e.Message); + MainLog.Instance.Warn("storage", "getRegion - " + e.Message); } } return null; @@ -152,7 +152,7 @@ namespace OpenSim.Grid.GridServer } catch { - MainLog.Instance.Warn("Storage: Unable to find region " + handle.ToString() + " via " + kvp.Key); + MainLog.Instance.Warn("storage", "Unable to find region " + handle.ToString() + " via " + kvp.Key); } } return null; @@ -176,7 +176,7 @@ namespace OpenSim.Grid.GridServer } catch { - MainLog.Instance.Warn("Storage: Unable to query regionblock via " + kvp.Key); + MainLog.Instance.Warn("storage", "Unable to query regionblock via " + kvp.Key); } } @@ -288,24 +288,24 @@ namespace OpenSim.Grid.GridServer switch(insertResponse) { case DataResponse.RESPONSE_OK: - OpenSim.Framework.Console.MainLog.Instance.Verbose("New sim creation successful: " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Verbose("grid", "New sim creation successful: " + TheSim.regionName); break; case DataResponse.RESPONSE_ERROR: - OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Error): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Error): " + TheSim.regionName); break; case DataResponse.RESPONSE_INVALIDCREDENTIALS: - OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Invalid Credentials): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Invalid Credentials): " + TheSim.regionName); break; case DataResponse.RESPONSE_AUTHREQUIRED: - OpenSim.Framework.Console.MainLog.Instance.Warn("New sim creation failed (Authentication Required): " + TheSim.regionName); + OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "New sim creation failed (Authentication Required): " + TheSim.regionName); break; } } catch (Exception e) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Storage: Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); - OpenSim.Framework.Console.MainLog.Instance.Warn(e.ToString()); + OpenSim.Framework.Console.MainLog.Instance.Warn("storage", "Unable to add region " + TheSim.UUID.ToStringHyphenated() + " via " + kvp.Key); + OpenSim.Framework.Console.MainLog.Instance.Warn("storage", e.ToString()); } } @@ -687,12 +687,12 @@ namespace OpenSim.Grid.GridServer if ((reserveData != null && reserveData.gridRecvKey == TheSim.regionRecvKey) || (reserveData == null && authkeynode.InnerText != TheSim.regionRecvKey)) { kvp.Value.AddProfile(TheSim); - MainLog.Instance.Verbose("New sim added to grid (" + TheSim.regionName + ")"); + MainLog.Instance.Verbose("grid", "New sim added to grid (" + TheSim.regionName + ")"); logToDB(TheSim.UUID.ToStringHyphenated(), "RestSetSimMethod", "", 5, "Region successfully updated and connected to grid."); } else { - MainLog.Instance.Warn("Unable to update region (RestSetSimMethod): Incorrect reservation auth key.");// Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); + MainLog.Instance.Warn("grid", "Unable to update region (RestSetSimMethod): Incorrect reservation auth key.");// Wanted: " + reserveData.gridRecvKey + ", Got: " + TheSim.regionRecvKey + "."); return "Unable to update region (RestSetSimMethod): Incorrect auth key."; } } diff --git a/OpenSim/Region/ClientStack/ClientView.API.cs b/OpenSim/Region/ClientStack/ClientView.API.cs index 084f7e0..c99c365 100644 --- a/OpenSim/Region/ClientStack/ClientView.API.cs +++ b/OpenSim/Region/ClientStack/ClientView.API.cs @@ -305,7 +305,7 @@ namespace OpenSim.Region.ClientStack } catch (Exception e) { - MainLog.Instance.Warn("ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("client", "ClientView API.cs: SendLayerData() - Failed with exception " + e.ToString()); } } @@ -331,7 +331,7 @@ namespace OpenSim.Region.ClientStack } catch (Exception e) { - MainLog.Instance.Warn("ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("client", "ClientView API .cs: SendLayerData() - Failed with exception " + e.ToString()); } } diff --git a/OpenSim/Region/ClientStack/ClientViewBase.cs b/OpenSim/Region/ClientStack/ClientViewBase.cs index 597cd7d..2cd730b 100644 --- a/OpenSim/Region/ClientStack/ClientViewBase.cs +++ b/OpenSim/Region/ClientStack/ClientViewBase.cs @@ -158,7 +158,7 @@ namespace OpenSim.Region.ClientStack } catch (Exception) { - MainLog.Instance.Warn("OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); + MainLog.Instance.Warn("client", "OpenSimClient.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " + userEP.ToString() + " - killing thread"); this.KillThread(); } diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs index f90a213..2c10df9 100644 --- a/OpenSim/Region/ClientStack/UDPServer.cs +++ b/OpenSim/Region/ClientStack/UDPServer.cs @@ -122,7 +122,7 @@ namespace OpenSim.Region.ClientStack } else { // invalid client - m_log.Warn("UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString()); + m_log.Warn("client", "UDPServer.cs:OnReceivedData() - WARNING: Got a packet from an invalid client - " + epSender.ToString()); } Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null); diff --git a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs index 5bfdccb..9a81a5f 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.PacketHandlers.cs @@ -256,7 +256,7 @@ namespace OpenSim.Region.Environment.Scenes } else { - OpenSim.Framework.Console.MainLog.Instance.Warn("Attempted to duplicate nonexistant prim"); + OpenSim.Framework.Console.MainLog.Instance.Warn("client", "Attempted to duplicate nonexistant prim"); } } diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 3e7b820..a660d82 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -248,7 +248,7 @@ namespace OpenSim.Region.Environment.Scenes } catch (Exception e) { - MainLog.Instance.Warn("World.cs: Update() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("scene", "World.cs: Update() - Failed with exception " + e.ToString()); } updateLock.ReleaseMutex(); } @@ -295,7 +295,7 @@ namespace OpenSim.Region.Environment.Scenes } catch (Exception e) { - MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("terrain", "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); } } @@ -326,7 +326,7 @@ namespace OpenSim.Region.Environment.Scenes } catch (Exception e) { - MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("terrain", "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); } } @@ -352,7 +352,7 @@ namespace OpenSim.Region.Environment.Scenes } catch (Exception e) { - MainLog.Instance.Warn("World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("terrain", "World.cs: RegenerateTerrain() - Failed with exception " + e.ToString()); } } @@ -402,7 +402,7 @@ namespace OpenSim.Region.Environment.Scenes } catch (Exception e) { - MainLog.Instance.Warn("World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); + MainLog.Instance.Warn("terrain", "World.cs: LoadWorldMap() - Failed with exception " + e.ToString()); } } @@ -784,7 +784,7 @@ namespace OpenSim.Region.Environment.Scenes cap.RegisterHandlers(); if (capsHandlers.ContainsKey(agent.AgentID)) { - MainLog.Instance.Warn("Adding duplicate CAPS entry for user " + + MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " + agent.AgentID.ToStringHyphenated()); capsHandlers[agent.AgentID] = cap; } diff --git a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs index 831c165..f52e9e2 100644 --- a/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs +++ b/OpenSim/Region/Environment/Scenes/scripting/ScriptInterpretedAPI.cs @@ -76,14 +76,14 @@ namespace OpenSim.Region.Scripting Vector myPosition = Task.Pos; Land myParcel = World.LandManager.getLandObject(myPosition.X, myPosition.Y); - OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); + OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)"); return; } [Obsolete("Unimplemented")] public void osAdjustSoundVolume(float volume) { - OpenSim.Framework.Console.MainLog.Instance.Warn("Unimplemented function called by script: osAdjustSoundVolume(float volume)"); + OpenSim.Framework.Console.MainLog.Instance.Warn("script", "Unimplemented function called by script: osAdjustSoundVolume(float volume)"); return; } -- cgit v1.1