Do some clean up Scene.cs log messages.

This prints out both exception message and stacktrace (Exception.ToString()) isn't enough on Windows.
This also uses m_log.*Format() which is more efficient than string concat.
0.7.2-post-fixes
Justin Clark-Casey (justincc) 2011-12-09 23:21:54 +00:00
parent c3d16955a7
commit 52b8518fc2
1 changed files with 38 additions and 24 deletions

View File

@ -778,7 +778,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
m_log.Info("[SCENE]: Using the " + m_priorityScheme + " prioritization scheme"); m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
#endregion Interest Management #endregion Interest Management
@ -909,9 +909,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
else else
{ {
m_log.Info("[INTERGRID]: Got notice about far away Region: " + otherRegion.RegionName.ToString() + m_log.InfoFormat(
" at (" + otherRegion.RegionLocX.ToString() + ", " + "[INTERGRID]: Got notice about far away Region: {0} at ({1}, {2})",
otherRegion.RegionLocY.ToString() + ")"); otherRegion.RegionName, otherRegion.RegionLocX, otherRegion.RegionLocY);
} }
} }
} }
@ -1347,7 +1347,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (AccessViolationException e) catch (AccessViolationException e)
{ {
m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.ErrorFormat(
"[REGION]: Failed on region {0} with exception {1}{2}",
RegionInfo.RegionName, e.Message, e.StackTrace);
} }
//catch (NullReferenceException e) //catch (NullReferenceException e)
//{ //{
@ -1355,11 +1357,15 @@ namespace OpenSim.Region.Framework.Scenes
//} //}
catch (InvalidOperationException e) catch (InvalidOperationException e)
{ {
m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.ErrorFormat(
"[REGION]: Failed on region {0} with exception {1}{2}",
RegionInfo.RegionName, e.Message, e.StackTrace);
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName); m_log.ErrorFormat(
"[REGION]: Failed on region {0} with exception {1}{2}",
RegionInfo.RegionName, e.Message, e.StackTrace);
} }
maintc = Util.EnvironmentTickCountSubtract(maintc); maintc = Util.EnvironmentTickCountSubtract(maintc);
@ -1583,7 +1589,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (IOException e) catch (IOException e)
{ {
m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString() + " Regenerating"); m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}",
e.Message, e.StackTrace);
// Non standard region size. If there's an old terrain in the database, it might read past the buffer // Non standard region size. If there's an old terrain in the database, it might read past the buffer
#pragma warning disable 0162 #pragma warning disable 0162
@ -1596,7 +1604,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString()); m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace);
} }
} }
@ -1670,7 +1679,7 @@ namespace OpenSim.Region.Framework.Scenes
List<SceneObjectGroup> PrimsFromDB = SimulationDataService.LoadObjects(regionID); List<SceneObjectGroup> PrimsFromDB = SimulationDataService.LoadObjects(regionID);
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count + " objects from the datastore"); m_log.InfoFormat("[SCENE]: Loaded {0} objects from the datastore", PrimsFromDB.Count);
foreach (SceneObjectGroup group in PrimsFromDB) foreach (SceneObjectGroup group in PrimsFromDB)
{ {
@ -1684,7 +1693,6 @@ namespace OpenSim.Region.Framework.Scenes
// group.CheckSculptAndLoad(); // group.CheckSculptAndLoad();
} }
m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
LoadingPrims = false; LoadingPrims = false;
EventManager.TriggerPrimsLoaded(this); EventManager.TriggerPrimsLoaded(this);
} }
@ -2307,7 +2315,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.WarnFormat("[SCENE]: Problem casting object: " + e.ToString()); m_log.WarnFormat("[SCENE]: Problem casting object, exception {0}{1}", e.Message, e.StackTrace);
return false; return false;
} }
@ -2383,8 +2391,7 @@ namespace OpenSim.Region.Framework.Scenes
// //
if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID)) if (m_regInfo.EstateSettings.IsBanned(sceneObject.OwnerID))
{ {
m_log.Info("[INTERREGION]: Denied prim crossing for " + m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", sceneObject.OwnerID);
"banned avatar");
return false; return false;
} }
@ -2441,8 +2448,7 @@ namespace OpenSim.Region.Framework.Scenes
{ {
// Deny non attachments based on parcel settings // Deny non attachments based on parcel settings
// //
m_log.Info("[INTERREGION]: Denied prim crossing " + m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings");
"because of parcel settings");
DeleteSceneObject(sceneObject, false); DeleteSceneObject(sceneObject, false);
@ -2486,7 +2492,8 @@ namespace OpenSim.Region.Framework.Scenes
// connected. // connected.
if (sp == null) if (sp == null)
{ {
m_log.Debug("[SCENE]: Adding new child scene presence " + client.Name + " to scene " + RegionInfo.RegionName); m_log.DebugFormat(
"[SCENE]: Adding new child scene presence {0} to scene {1}", client.Name, RegionInfo.RegionName);
m_clientManager.Add(client); m_clientManager.Add(client);
SubscribeToClientEvents(client); SubscribeToClientEvents(client);
@ -3119,7 +3126,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.Error("[SCENE] Scene.cs:RemoveClient exception: " + e.ToString()); m_log.ErrorFormat("[SCENE] Scene.cs:RemoveClient exception {0}{1}", e.Message, e.StackTrace);
} }
m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode); m_authenticateHandler.RemoveCircuit(avatar.ControllingClient.CircuitCode);
@ -3259,7 +3266,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[CONNECTION BEGIN]: Exception verifying presence " + e.ToString()); m_log.ErrorFormat(
"[CONNECTION BEGIN]: Exception verifying presence {0}{1}", e.Message, e.StackTrace);
return false; return false;
} }
} }
@ -3271,7 +3279,8 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[CONNECTION BEGIN]: Exception authorizing user " + e.ToString()); m_log.ErrorFormat(
"[CONNECTION BEGIN]: Exception authorizing user {0}{1}", e.Message, e.StackTrace);
return false; return false;
} }
@ -3482,7 +3491,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else else
{
m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!"); m_log.ErrorFormat("[CONNECTION BEGIN]: Estate Settings is null!");
}
IGroupsModule groupsModule = IGroupsModule groupsModule =
RequestModuleInterface<IGroupsModule>(); RequestModuleInterface<IGroupsModule>();
@ -3500,8 +3511,10 @@ namespace OpenSim.Region.Framework.Scenes
agentGroups.Add(GroupMembership[i].GroupID); agentGroups.Add(GroupMembership[i].GroupID);
} }
else else
{
m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!"); m_log.ErrorFormat("[CONNECTION BEGIN]: GroupMembership is null!");
} }
}
bool groupAccess = false; bool groupAccess = false;
UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups; UUID[] estateGroups = m_regInfo.EstateSettings.EstateGroups;
@ -3518,7 +3531,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
} }
else else
{
m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!"); m_log.ErrorFormat("[CONNECTION BEGIN]: EstateGroups is null!");
}
if (!m_regInfo.EstateSettings.PublicAccess && if (!m_regInfo.EstateSettings.PublicAccess &&
!m_regInfo.EstateSettings.HasAccess(agent.AgentID) && !m_regInfo.EstateSettings.HasAccess(agent.AgentID) &&
@ -3635,7 +3650,7 @@ namespace OpenSim.Region.Framework.Scenes
} }
catch (Exception e) catch (Exception e)
{ {
m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}", e); m_log.ErrorFormat("[SCENE]: Unable to do agent crossing, exception {0}{1}", e.Message, e.StackTrace);
} }
} }
else else
@ -3942,7 +3957,7 @@ namespace OpenSim.Region.Framework.Scenes
/// <param name="cmdparams"></param> /// <param name="cmdparams"></param>
public void HandleEditCommand(string[] cmdparams) public void HandleEditCommand(string[] cmdparams)
{ {
m_log.Debug("Searching for Primitive: '" + cmdparams[2] + "'"); m_log.DebugFormat("Searching for Primitive: '{0}'", cmdparams[2]);
EntityBase[] entityList = GetEntities(); EntityBase[] entityList = GetEntities();
foreach (EntityBase ent in entityList) foreach (EntityBase ent in entityList)
@ -3958,7 +3973,7 @@ namespace OpenSim.Region.Framework.Scenes
new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]), new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]),
Convert.ToSingle(cmdparams[5]))); Convert.ToSingle(cmdparams[5])));
m_log.Debug("Edited scale of Primitive: " + part.Name); m_log.DebugFormat("Edited scale of Primitive: {0}", part.Name);
} }
} }
} }
@ -4014,7 +4029,6 @@ namespace OpenSim.Region.Framework.Scenes
return LandChannel.GetLandObject((int)x, (int)y).LandData; return LandChannel.GetLandObject((int)x, (int)y).LandData;
} }
#endregion #endregion
#region Script Engine #region Script Engine