From 9770cf778efa929255c40ec4a547aea3097b1edc Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Thu, 6 Nov 2008 20:38:04 +0000 Subject: [PATCH] * minor: Make some 'startup config failed to load' log messages more consistent --- .../Modules/World/WorldMap/MapImageModule.cs | 4 ++-- OpenSim/Region/Environment/Scenes/Scene.cs | 9 +++++---- .../Environment/Scenes/Tests/SceneTests.cs | 19 ++++++++++++++++++- .../Physics/Manager/PhysicsPluginManager.cs | 2 +- 4 files changed, 26 insertions(+), 8 deletions(-) diff --git a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs index 556b84335b..b2f697cd14 100644 --- a/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/Environment/Modules/World/WorldMap/MapImageModule.cs @@ -85,9 +85,9 @@ namespace OpenSim.Region.Environment.Modules.World.WorldMap drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", drawPrimVolume); textureTerrain = startupConfig.GetBoolean("TextureOnMapTile", textureTerrain); } - catch (Exception) + catch { - m_log.Warn("Failed to load StartupConfig"); + m_log.Warn("[MAPTILE]: Failed to load StartupConfig"); } if (textureTerrain) diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 647682ea21..4621422755 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -334,9 +334,9 @@ namespace OpenSim.Region.Environment.Scenes m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "DotNetEngine"); } - catch (Exception) + catch { - m_log.Warn("Failed to load StartupConfig"); + m_log.Warn("[SCENE]: Failed to load StartupConfig"); } } @@ -1307,6 +1307,7 @@ namespace OpenSim.Region.Environment.Scenes //tc = System.Environment.TickCount - tc; //m_log.Info("[MAPTILE]: Completed One row in " + tc + " ms"); } + m_log.Info("[MAPTILE]: Generating Maptile Step 1: Done in " + (System.Environment.TickCount - tc) + " ms"); bool drawPrimVolume = true; @@ -1316,9 +1317,9 @@ namespace OpenSim.Region.Environment.Scenes IConfig startupConfig = m_config.Configs["Startup"]; drawPrimVolume = startupConfig.GetBoolean("DrawPrimOnMapTile", true); } - catch (Exception) + catch { - m_log.Warn("Failed to load StartupConfig"); + m_log.Warn("[MAPTILE]: Failed to load StartupConfig"); } if (drawPrimVolume) diff --git a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs index 0ec4a8bef7..dd0ca8c971 100644 --- a/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs +++ b/OpenSim/Region/Environment/Scenes/Tests/SceneTests.cs @@ -40,6 +40,19 @@ namespace OpenSim.Region.Environment.Scenes.Tests [TestFixture] public class SceneTests { + [SetUp] + public void Init() + { + try + { + log4net.Config.XmlConfigurator.Configure(); + } + catch + { + // I don't care, just leave log4net off + } + } + /// /// Test adding an object to a scene. Doesn't yet do what it says on the tin. /// @@ -56,7 +69,11 @@ namespace OpenSim.Region.Environment.Scenes.Tests StorageManager sm = new OpenSim.Region.Environment.StorageManager("OpenSim.Data.Null.dll", "", ""); IConfigSource configSource = new IniConfigSource(); - new Scene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); + Scene scene + = new Scene(regInfo, acm, cm, scs, null, sm, null, null, false, false, false, configSource, null); + + SceneObjectGroup sceneObject = new SceneObjectGroup(); + scene.AddNewSceneObject(sceneObject, false); } } } \ No newline at end of file diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs index db412513c9..fc8f0628af 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs @@ -124,7 +124,7 @@ namespace OpenSim.Region.Physics.Manager } catch (Exception ex) { - m_log.Error("Failed to load plugin from " + FileName, ex); + m_log.Error("[PHYSICS]: Failed to load plugin from " + FileName, ex); } if (pluginAssembly != null)