From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001
From: Jeff Ames
Date: Tue, 5 Feb 2008 19:44:27 +0000
Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase,
which handles console I/O. This is mostly an in-place conversion, so lots of
refactoring can still be done.
---
OpenSim/Region/Application/Application.cs | 11 +-
OpenSim/Region/Application/OpenSimMain.cs | 207 ++++++++++----------
OpenSim/Region/ClientStack/ClientView.cs | 86 ++++-----
OpenSim/Region/ClientStack/PacketQueue.cs | 10 +-
.../Region/ClientStack/RegionApplicationBase.cs | 19 +-
OpenSim/Region/ClientStack/UDPServer.cs | 30 ++-
.../Communications/Local/LocalBackEndServices.cs | 23 ++-
.../Communications/Local/LocalLoginService.cs | 12 +-
.../Region/Communications/OGS1/OGS1GridServices.cs | 208 +++++++++++----------
.../Communications/OGS1/OGS1InterSimComms.cs | 8 +-
.../Communications/OGS1/OGS1InventoryService.cs | 24 +--
.../Region/Communications/OGS1/OGS1UserServices.cs | 60 +++---
OpenSim/Region/Environment/EstateManager.cs | 20 +-
.../Environment/LandManagement/LandManager.cs | 11 +-
OpenSim/Region/Environment/ModuleLoader.cs | 28 +--
.../Environment/Modules/BetaGridLikeMoneyModule.cs | 10 +-
OpenSim/Region/Environment/Modules/ChatModule.cs | 103 +++++-----
.../Region/Environment/Modules/FriendsModule.cs | 35 ++--
.../Environment/Modules/InstantMessageModule.cs | 7 -
OpenSim/Region/Environment/Modules/SunModule.cs | 8 +-
.../Region/Environment/Modules/TextureSender.cs | 7 +-
OpenSim/Region/Environment/Modules/XMLRPCModule.cs | 14 +-
.../Region/Environment/Scenes/AvatarAnimations.cs | 8 +-
OpenSim/Region/Environment/Scenes/InnerScene.cs | 16 +-
.../Region/Environment/Scenes/Scene.Inventory.cs | 119 ++++++------
OpenSim/Region/Environment/Scenes/Scene.cs | 86 ++++-----
OpenSim/Region/Environment/Scenes/SceneBase.cs | 6 +-
.../Scenes/SceneCommunicationService.cs | 36 ++--
OpenSim/Region/Environment/Scenes/SceneManager.cs | 37 ++--
.../Scenes/SceneObjectGroup.Inventory.cs | 66 +++----
.../Region/Environment/Scenes/SceneObjectGroup.cs | 4 +-
.../Scenes/SceneObjectPart.Inventory.cs | 62 +++---
.../Region/Environment/Scenes/SceneObjectPart.cs | 15 +-
OpenSim/Region/Environment/Scenes/ScenePresence.cs | 14 +-
.../Scenes/Scripting/ScriptEngineInterface.cs | 2 +-
.../Scenes/Scripting/ScriptEngineLoader.cs | 15 +-
OpenSim/Region/Environment/StorageManager.cs | 6 +-
OpenSim/Region/Examples/SimpleApp/Program.cs | 20 +-
.../Engines/CSharp/CSharpScriptEngine.cs | 6 +-
.../Engines/JScript/JScriptEngine.cs | 6 +-
OpenSim/Region/ExtensionsScriptModule/Script.cs | 6 +-
.../Region/ExtensionsScriptModule/ScriptInfo.cs | 11 +-
.../ExtensionsScriptModule/ScriptInterpretedAPI.cs | 6 +-
.../Region/ExtensionsScriptModule/ScriptManager.cs | 12 +-
.../Physics/BasicPhysicsPlugin/AssemblyInfo.cs | 2 +-
.../Region/Physics/BulletXPlugin/BulletXPlugin.cs | 4 +-
.../Region/Physics/Manager/PhysicsPluginManager.cs | 22 ++-
OpenSim/Region/Physics/Manager/PhysicsScene.cs | 16 +-
OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 6 +-
OpenSim/Region/Physics/Meshing/SimpleHull.cs | 18 +-
OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 8 +-
OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 10 +-
OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 68 +++----
OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs | 2 +-
OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs | 2 +-
.../Region/ScriptEngine/Common/LSL_BaseClass.cs | 5 +-
.../ScriptEngine/Common/LSL_BuiltIn_Commands.cs | 5 +-
.../Common/ScriptEngineBase/AppDomainManager.cs | 18 +-
.../ScriptEngine/Common/ScriptEngineBase/Common.cs | 19 +-
.../Common/ScriptEngineBase/EventManager.cs | 4 +-
.../Common/ScriptEngineBase/EventQueueManager.cs | 23 +--
.../ScriptEngineBase/EventQueueThreadClass.cs | 32 ++--
.../Common/ScriptEngineBase/MaintenanceThread.cs | 10 +-
.../Common/ScriptEngineBase/ScriptEngine.cs | 34 ++--
.../Common/ScriptEngineBase/ScriptManager.cs | 6 +-
.../ScriptEngine/Common/ScriptServerInterfaces.cs | 4 +-
.../DotNetEngine/Compiler/LSL/Compiler.cs | 33 ++--
.../ScriptEngine/DotNetEngine/ScriptEngine.cs | 2 +-
.../ScriptEngine/DotNetEngine/ScriptManager.cs | 23 ++-
.../Region/ScriptEngine/LSOEngine/ScriptEngine.cs | 2 +-
.../Region/ScriptEngine/LSOEngine/ScriptManager.cs | 13 +-
OpenSim/Region/ScriptEngine/RemoteServer/Common.cs | 7 +-
.../ScriptEngine/RemoteServer/EventManager.cs | 22 +--
.../ScriptEngine/RemoteServer/ScriptEngine.cs | 18 +-
.../OpenSim.DataStore.DB4o/DB4oDataStore.cs | 13 +-
.../OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 48 ++---
.../Properties/AssemblyInfo.cs | 2 +-
77 files changed, 978 insertions(+), 1023 deletions(-)
(limited to 'OpenSim/Region')
diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs
index 4c4d315..f1db8d6 100644
--- a/OpenSim/Region/Application/Application.cs
+++ b/OpenSim/Region/Application/Application.cs
@@ -35,17 +35,20 @@ namespace OpenSim
{
public class Application
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public static string iniFilePath = "";
//could move our main function into OpenSimMain and kill this class
[STAThread]
public static void Main(string[] args)
{
+ log4net.Config.XmlConfigurator.Configure();
+
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
Console.WriteLine("OpenSim " + VersionInfo.Version + "\n");
-
Console.Write("Performing compatibility checks... ");
string supported = String.Empty;
if (Util.IsEnvironmentSupported(ref supported))
@@ -75,11 +78,10 @@ namespace OpenSim
OpenSimMain sim = new OpenSimMain(configSource);
sim.StartUp();
-
while (true)
{
- MainLog.Instance.MainLogPrompt();
+ MainConsole.Instance.Prompt();
}
}
@@ -112,7 +114,7 @@ namespace OpenSim
// Do we not always want to see exception messages?
// if (e.IsTerminating)
- MainLog.Instance.Error("APPLICATION", msg);
+ MainConsole.Instance.Error("[APPLICATION]: " + msg);
// Try to post errormessage to an URL
try
@@ -131,6 +133,5 @@ namespace OpenSim
_IsHandlingException=false;
}
-
}
}
diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs
index 36de410..074a7b5 100644
--- a/OpenSim/Region/Application/OpenSimMain.cs
+++ b/OpenSim/Region/Application/OpenSimMain.cs
@@ -55,6 +55,8 @@ namespace OpenSim
public class OpenSimMain : RegionApplicationBase, conscmd_callback
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private const string DEFAULT_PRIM_BACKUP_FILENAME = "prim-backup.xml";
public string m_physicsEngine;
@@ -77,7 +79,6 @@ namespace OpenSim
private bool m_verbose;
private bool m_physicalPrim;
- private readonly string m_logFilename = "region-console.log";
private bool m_permissions = false;
private bool m_standaloneAuthenticate = false;
@@ -146,9 +147,7 @@ namespace OpenSim
{
// no default config files, so set default values, and save it
m_config.Merge(DefaultConfig());
-
m_config.Merge(configSource);
-
m_config.Save(Application.iniFilePath);
}
}
@@ -233,6 +232,8 @@ namespace OpenSim
m_sandbox = !startupConfig.GetBoolean("gridmode", false);
m_physicsEngine = startupConfig.GetString("physics", "basicphysics");
m_meshEngineName = startupConfig.GetString("meshing", "ZeroMesher");
+
+ // TODO: since log4net changes, verbose flag doesn't do anything
m_verbose = startupConfig.GetBoolean("verbose", true);
m_physicalPrim = startupConfig.GetBoolean("physical_prim", true);
@@ -280,7 +281,6 @@ namespace OpenSim
//if (!m_sandbox)
//m_SendChildAgentTaskData = false;
-
m_networkServersInfo.loadFromConfiguration(m_config);
}
@@ -293,16 +293,8 @@ namespace OpenSim
// Called from app startup (OpenSim.Application)
//
-
- // Create log directory if it doesn't exist
- if (!Directory.Exists(Util.logDir()))
- {
- Directory.CreateDirectory(Util.logDir());
- }
-
- // Create a log instance
- m_log = CreateLog();
- MainLog.Instance = m_log;
+ m_console = CreateConsole();
+ MainConsole.Instance = m_console;
StatsManager.StartCollectingSimExtraStats();
@@ -311,7 +303,6 @@ namespace OpenSim
// This base will call abstract Initialize
base.StartUp();
-
// StandAlone mode? m_sandbox is determined by !startupConfig.GetBoolean("gridmode", false)
if (m_sandbox)
{
@@ -357,10 +348,10 @@ namespace OpenSim
}
// Create a ModuleLoader instance
- m_moduleLoader = new ModuleLoader(m_log, m_config);
+ m_moduleLoader = new ModuleLoader(m_config);
ExtensionNodeList nodes = AddinManager.GetExtensionNodes("/OpenSim/Startup");
- m_log.Verbose("PLUGINS", "Loading {0} OpenSim application plugins", nodes.Count);
+ m_log.Info(String.Format("[PLUGINS]: Loading {0} OpenSim application plugins", nodes.Count));
foreach (TypeExtensionNode node in nodes)
{
@@ -383,7 +374,7 @@ namespace OpenSim
}
else
{
- m_log.Verbose("STARTUP", "No startup command script specified. Moving on...");
+ m_log.Info("[STARTUP]: No startup command script specified. Moving on...");
}
// Start timer script (run a script every xx seconds)
@@ -396,10 +387,7 @@ namespace OpenSim
}
// We are done with startup
- m_log.Status("STARTUP",
- "Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
-
- // When we return now we will be in a wait for input command loop.
+ m_log.Info("[STARTUP]: Startup complete, serving " + m_udpServers.Count.ToString() + " region(s)");
}
protected override void Initialize()
@@ -433,8 +421,9 @@ namespace OpenSim
assetServer = sqlAssetServer;
}
- m_assetCache = new AssetCache(assetServer, m_log);
+ m_assetCache = new AssetCache(assetServer);
// m_assetCache = new assetCache("OpenSim.Region.GridInterfaces.Local.dll", m_networkServersInfo.AssetURL, m_networkServersInfo.AssetSendKey);
+
m_sceneManager.OnRestartSim += handleRestartRegion;
}
@@ -448,23 +437,23 @@ namespace OpenSim
UDPServer udpServer;
Scene scene = SetupScene(regionInfo, out udpServer, m_permissions);
- m_log.Verbose("MODULES", "Loading Region's modules");
+ m_log.Info("[MODULES]: Loading Region's modules");
m_moduleLoader.PickupModules(scene, ".");
//m_moduleLoader.PickupModules(scene, "ScriptEngines");
//m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", m_scriptEngine), scene);
- m_log.Verbose("MODULES", "Loading scripting engine modules");
+ m_log.Info("[MODULES]: Loading scripting engine modules");
foreach (string module in m_scriptEngine.Split(','))
{
string mod = module.Trim(" \t".ToCharArray()); // Clean up name
- m_log.Verbose("MODULES", "Loading scripting engine: " + mod);
+ m_log.Info("[MODULES]: Loading scripting engine: " + mod);
try
{
m_moduleLoader.LoadRegionModules(Path.Combine("ScriptEngines", mod), scene);
}
catch (Exception ex)
{
- m_log.Error("MODULES", "Failed to load script engine: " + ex.ToString());
+ m_log.Error("[MODULES]: Failed to load script engine: " + ex.ToString());
}
}
@@ -503,8 +492,7 @@ namespace OpenSim
SceneCommunicationService sceneGridService = new SceneCommunicationService(m_commsManager);
if (m_SendChildAgentTaskData)
{
- m_log.Error("WARNING",
- "Send Child Agent Task Updates is enabled. This is for testing only.");
+ m_log.Error("[WARNING]: Send Child Agent Task Updates is enabled. This is for testing only.");
//Thread.Sleep(12000);
}
return
@@ -516,7 +504,7 @@ namespace OpenSim
public void handleRestartRegion(RegionInfo whichRegion)
{
- m_log.Error("MAIN", "Got restart signal from SceneManager");
+ m_log.Error("[MAIN]: Got restart signal from SceneManager");
// Shutting down the UDP server
bool foundUDPServer = false;
int UDPServerElement = 0;
@@ -557,14 +545,9 @@ namespace OpenSim
//m_sceneManager.SendSimOnlineNotification(restartingRegion.RegionHandle);
}
- protected override LogBase CreateLog()
+ protected override ConsoleBase CreateConsole()
{
- if (!Directory.Exists(Util.logDir()))
- {
- Directory.CreateDirectory(Util.logDir());
- }
-
- return new LogBase((Path.Combine(Util.logDir(), m_logFilename)), "Region", this, m_verbose);
+ return new ConsoleBase("Region", this);
}
# region Setup methods
@@ -609,15 +592,15 @@ namespace OpenSim
RunCommandScript(m_shutdownCommandsFile);
}
- m_log.Verbose("SHUTDOWN", "Closing all threads");
- m_log.Verbose("SHUTDOWN", "Killing listener thread");
- m_log.Verbose("SHUTDOWN", "Killing clients");
+ m_log.Info("[SHUTDOWN]: Closing all threads");
+ m_log.Info("[SHUTDOWN]: Killing listener thread");
+ m_log.Info("[SHUTDOWN]: Killing clients");
// TODO: implement this
- m_log.Verbose("SHUTDOWN", "Closing console and terminating");
+ m_log.Info("[SHUTDOWN]: Closing console and terminating");
m_sceneManager.Close();
- m_log.Close();
+ m_console.Close();
Environment.Exit(0);
}
@@ -637,7 +620,7 @@ namespace OpenSim
///
private void RunCommandScript(string fileName)
{
- m_log.Verbose("COMMANDFILE", "Running " + fileName);
+ m_log.Info("[COMMANDFILE]: Running " + fileName);
if (File.Exists(fileName))
{
StreamReader readFile = File.OpenText(fileName);
@@ -646,14 +629,14 @@ namespace OpenSim
{
if (currentCommand != String.Empty)
{
- m_log.Verbose("COMMANDFILE", "Running '" + currentCommand + "'");
- m_log.MainLogRunCommand(currentCommand);
+ m_log.Info("[COMMANDFILE]: Running '" + currentCommand + "'");
+ m_console.RunCommand(currentCommand);
}
}
}
else
{
- m_log.Error("COMMANDFILE", "Command script missing. Can not run commands");
+ m_log.Error("[COMMANDFILE]: Command script missing. Can not run commands");
}
}
@@ -673,7 +656,7 @@ namespace OpenSim
break;
case "force-update":
- Console.WriteLine("Updating all clients");
+ m_console.Notice("Updating all clients");
m_sceneManager.ForceCurrentSceneClientUpdate();
break;
@@ -692,36 +675,36 @@ namespace OpenSim
break;
case "help":
- m_log.Notice("alert - send alert to a designated user or all users.");
- m_log.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
- m_log.Notice(" alert general [Message] - send an alert to all users.");
- m_log.Notice("backup - trigger a simulator backup");
- m_log.Notice("create user - adds a new user");
- m_log.Notice("change-region [name] - sets the region that many of these commands affect.");
- m_log.Notice("command-script [filename] - Execute command in a file.");
- m_log.Notice("debug - debugging commands");
- m_log.Notice(" packet 0..255 - print incoming/outgoing packets (0=off)");
- m_log.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
- m_log.Notice("export-map [filename] - save image of world map");
- m_log.Notice("force-update - force an update of prims in the scene");
- m_log.Notice("load-xml [filename] - load prims from XML");
- m_log.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
- m_log.Notice("permissions [true/false] - turn on/off permissions on the scene");
- m_log.Notice("quit - equivalent to shutdown.");
- m_log.Notice("restart - disconnects all clients and restarts the sims in the instance.");
- m_log.Notice("remove-region [name] - remove a region");
- m_log.Notice("save-xml [filename] - save prims to XML");
- m_log.Notice("save-xml2 [filename] - save prims to XML using version 2 format");
- m_log.Notice("script - manually trigger scripts? or script commands?");
- m_log.Notice("set-time [x] - set the current scene time phase");
- m_log.Notice("show users - show info about connected users.");
- m_log.Notice("show modules - shows info aboutloaded modules.");
- m_log.Notice("show stats - statistical information for this server not displayed in the client");
- m_log.Notice("shutdown - disconnect all clients and shutdown.");
- m_log.Notice("config set section field value - set a config value");
- m_log.Notice("config get section field - get a config value");
- m_log.Notice("config save - save OpenSim.ini");
- m_log.Notice("terrain help - show help for terrain commands.");
+ m_console.Notice("alert - send alert to a designated user or all users.");
+ m_console.Notice(" alert [First] [Last] [Message] - send an alert to a user. Case sensitive.");
+ m_console.Notice(" alert general [Message] - send an alert to all users.");
+ m_console.Notice("backup - trigger a simulator backup");
+ m_console.Notice("create user - adds a new user");
+ m_console.Notice("change-region [name] - sets the region that many of these commands affect.");
+ m_console.Notice("command-script [filename] - Execute command in a file.");
+ m_console.Notice("debug - debugging commands");
+ m_console.Notice(" packet 0..255 - print incoming/outgoing packets (0=off)");
+ m_console.Notice("edit-scale [prim name] [x] [y] [z] - resize given prim");
+ m_console.Notice("export-map [filename] - save image of world map");
+ m_console.Notice("force-update - force an update of prims in the scene");
+ m_console.Notice("load-xml [filename] - load prims from XML");
+ m_console.Notice("load-xml2 [filename] - load prims from XML using version 2 format");
+ m_console.Notice("permissions [true/false] - turn on/off permissions on the scene");
+ m_console.Notice("quit - equivalent to shutdown.");
+ m_console.Notice("restart - disconnects all clients and restarts the sims in the instance.");
+ m_console.Notice("remove-region [name] - remove a region");
+ m_console.Notice("save-xml [filename] - save prims to XML");
+ m_console.Notice("save-xml2 [filename] - save prims to XML using version 2 format");
+ m_console.Notice("script - manually trigger scripts? or script commands?");
+ m_console.Notice("set-time [x] - set the current scene time phase");
+ m_console.Notice("show users - show info about connected users.");
+ m_console.Notice("show modules - shows info aboutloaded modules.");
+ m_console.Notice("show stats - statistical information for this server not displayed in the client");
+ m_console.Notice("shutdown - disconnect all clients and shutdown.");
+ m_console.Notice("config set section field value - set a config value");
+ m_console.Notice("config get section field - get a config value");
+ m_console.Notice("config save - save OpenSim.ini");
+ m_console.Notice("terrain help - show help for terrain commands.");
break;
case "save-xml":
@@ -757,8 +740,8 @@ namespace OpenSim
{
loadOffset.Z = (float) Convert.ToDecimal(cmdparams[4]);
}
- m_log.Error("loadOffsets = <" + loadOffset.X + "," + loadOffset.Y + "," +
- loadOffset.Z + ">");
+ m_console.Error("loadOffsets = <" + loadOffset.X + "," + loadOffset.Y + "," +
+ loadOffset.Z + ">");
}
}
m_sceneManager.LoadCurrentSceneFromXml(cmdparams[0], generateNewIDS, loadOffset);
@@ -796,7 +779,7 @@ namespace OpenSim
if (!m_sceneManager.RunTerrainCmdOnCurrentScene(cmdparams, ref result))
{
- m_log.Error(result);
+ m_console.Error(result);
}
break;
@@ -867,20 +850,18 @@ namespace OpenSim
if (!m_sceneManager.TrySetCurrentScene(regionName))
{
- m_log.Error("Couldn't set current region to: " + regionName);
+ m_console.Error("Couldn't set current region to: " + regionName);
}
}
if (m_sceneManager.CurrentScene == null)
{
- m_log.Notice("CONSOLE",
- "Currently at Root level. To change region please use 'change-region '");
+ m_console.Error("CONSOLE", "Currently at Root level. To change region please use 'change-region '");
}
else
{
- m_log.Notice("CONSOLE",
- "Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
- ". To change region please use 'change-region '");
+ m_console.Error("CONSOLE", "Current Region: " + m_sceneManager.CurrentScene.RegionInfo.RegionName +
+ ". To change region please use 'change-region '");
}
break;
@@ -905,8 +886,8 @@ namespace OpenSim
case "set":
if (cmdparams.Length < 4)
{
- m_log.Notice(n, "SYNTAX: " + n + " SET SECTION KEY VALUE");
- m_log.Notice(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
+ m_console.Error(n, "SYNTAX: " + n + " SET SECTION KEY VALUE");
+ m_console.Error(n, "EXAMPLE: " + n + " SET ScriptEngine.DotNetEngine NumberOfScriptThreads 5");
}
else
{
@@ -916,37 +897,35 @@ namespace OpenSim
string _value = String.Join(" ", cmdparams, 3, cmdparams.Length - 3);
c.Set(cmdparams[2], _value);
m_config.Merge(c.ConfigSource);
-
- m_log.Notice(n,
- n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
- _value);
+
+ m_console.Error(n, n + " " + n + " " + cmdparams[1] + " " + cmdparams[2] + " " +
+ _value);
}
break;
case "get":
if (cmdparams.Length < 3)
{
- m_log.Notice(n, "SYNTAX: " + n + " GET SECTION KEY");
- m_log.Notice(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads");
+ m_console.Error(n, "SYNTAX: " + n + " GET SECTION KEY");
+ m_console.Error(n, "EXAMPLE: " + n + " GET ScriptEngine.DotNetEngine NumberOfScriptThreads");
}
else
{
IConfig c = DefaultConfig().Configs[cmdparams[1]];
if (c == null)
{
- m_log.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist.");
+ m_console.Notice(n, "Section \"" + cmdparams[1] + "\" does not exist.");
break;
}
else
{
- m_log.Notice(n,
- n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
- c.GetString(cmdparams[2]));
+ m_console.Notice(n + " GET " + cmdparams[1] + " " + cmdparams[2] + ": " +
+ c.GetString(cmdparams[2]));
}
}
break;
case "save":
- m_log.Notice(n, "Saving configuration file: " + Application.iniFilePath);
+ m_console.Notice("Saving configuration file: " + Application.iniFilePath);
m_config.Save(Application.iniFilePath);
break;
}
@@ -957,7 +936,7 @@ namespace OpenSim
* Temporarily disabled but it would be good to have this - needs to be levered
* in to BaseOpenSimServer (which requires a RunCmd method restrcuture probably)
default:
- m_log.Error("Unknown command");
+ m_console.Error("Unknown command");
break;
*/
}
@@ -973,18 +952,18 @@ namespace OpenSim
int newDebug;
if (int.TryParse(args[1], out newDebug))
{
- m_sceneManager.SetDebugPacketOnCurrentScene(m_log, newDebug);
+ m_sceneManager.SetDebugPacketOnCurrentScene(newDebug);
}
else
{
- m_log.Error("packet debug should be 0..2");
+ m_console.Error("packet debug should be 0..2");
}
- Console.WriteLine("New packet debug: " + newDebug.ToString());
+ m_console.Notice("New packet debug: " + newDebug.ToString());
}
break;
default:
- m_log.Error("Unknown debug");
+ m_console.Error("Unknown debug");
break;
}
}
@@ -997,7 +976,7 @@ namespace OpenSim
switch (ShowWhat)
{
case "users":
- m_log.Notice(
+ m_console.Notice(
String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}", "Firstname", "Lastname",
"Agent ID", "Circuit", "IP", "Region"));
@@ -1015,6 +994,7 @@ namespace OpenSim
{
regionName = regionInfo.RegionName;
}
+
for (int i = 0; i < m_udpServers.Count; i++)
{
if (m_udpServers[i].RegionHandle == presence.RegionHandle)
@@ -1023,7 +1003,8 @@ namespace OpenSim
m_udpServers[i].clientCircuits_reverse.TryGetValue(presence.ControllingClient.CircuitCode, out ep);
}
}
- m_log.Notice(
+
+ m_console.Notice(
String.Format("{0,-16}{1,-16}{2,-37}{3,-16}{4,-22}{5,-16}",
presence.Firstname,
presence.Lastname,
@@ -1035,10 +1016,10 @@ namespace OpenSim
break;
case "modules":
- m_log.Notice("The currently loaded shared modules are:");
+ m_console.Notice("The currently loaded shared modules are:");
foreach (IRegionModule module in m_moduleLoader.GetLoadedSharedModules)
{
- m_log.Notice("Shared Module: " + module.Name);
+ m_console.Notice("Shared Module: " + module.Name);
}
break;
@@ -1046,21 +1027,21 @@ namespace OpenSim
m_sceneManager.ForEachScene(
delegate(Scene scene)
{
- m_log.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
- scene.RegionInfo.RegionLocX + " , Region YLoc: " +
- scene.RegionInfo.RegionLocY);
+ m_console.Notice("Region Name: " + scene.RegionInfo.RegionName + " , Region XLoc: " +
+ scene.RegionInfo.RegionLocX + " , Region YLoc: " +
+ scene.RegionInfo.RegionLocY);
});
break;
case "stats":
if (StatsManager.SimExtraStats != null)
{
- m_log.Notice(
+ m_console.Notice(
"STATS", Environment.NewLine + StatsManager.SimExtraStats.Report());
}
else
{
- m_log.Notice("STATS", "Extra sim statistics collection has not been enabled");
+ m_console.Notice("Extra sim statistics collection has not been enabled");
}
break;
}
diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs
index 5fdb9b3..10bf0d1 100644
--- a/OpenSim/Region/ClientStack/ClientView.cs
+++ b/OpenSim/Region/ClientStack/ClientView.cs
@@ -51,6 +51,8 @@ namespace OpenSim.Region.ClientStack
///
public class ClientView : IClientAPI
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
/* static variables */
public static TerrainManager TerrainManager;
@@ -196,7 +198,7 @@ namespace OpenSim.Region.ClientStack
// m_inventoryCache = inventoryCache;
m_authenticateSessionsHandler = authenSessions;
- MainLog.Instance.Verbose("CLIENT", "Started up new client thread to handle incoming request");
+ m_log.Info("[CLIENT]: Started up new client thread to handle incoming request");
m_agentId = agentId;
m_sessionId = sessionId;
@@ -260,7 +262,7 @@ namespace OpenSim.Region.ClientStack
public void Close(bool ShutdownCircult)
{
// Pull Client out of Region
- MainLog.Instance.Verbose("CLIENT", "Close has been called");
+ m_log.Info("[CLIENT]: Close has been called");
//raiseevent on the packet server to Shutdown the circuit
if (ShutdownCircult)
@@ -286,7 +288,7 @@ namespace OpenSim.Region.ClientStack
public void Stop()
{
- MainLog.Instance.Verbose("BUG", "Stop called, please find out where and remove it");
+ m_log.Info("[BUG]: Stop called, please find out where and remove it");
}
#endregion
@@ -378,7 +380,7 @@ namespace OpenSim.Region.ClientStack
protected virtual void ClientLoop()
{
- MainLog.Instance.Verbose("CLIENT", "Entered loop");
+ m_log.Info("[CLIENT]: Entered loop");
while (true)
{
QueItem nextPacket = m_packetQueue.Dequeue();
@@ -445,7 +447,7 @@ namespace OpenSim.Region.ClientStack
m_clientPingTimer.Elapsed += new ElapsedEventHandler(CheckClientConnectivity);
m_clientPingTimer.Enabled = true;
- MainLog.Instance.Verbose("CLIENT", "Adding viewer agent to scene");
+ m_log.Info("[CLIENT]: Adding viewer agent to scene");
m_scene.AddNewClient(this, true);
}
@@ -458,13 +460,13 @@ namespace OpenSim.Region.ClientStack
if (!sessionInfo.Authorised)
{
//session/circuit not authorised
- MainLog.Instance.Notice("CLIENT", "New user request denied to " + m_userEndPoint.ToString());
+ m_log.Info("[CLIENT]: New user request denied to " + m_userEndPoint.ToString());
m_packetQueue.Close();
m_clientThread.Abort();
}
else
{
- MainLog.Instance.Notice("CLIENT", "Got authenticated connection from " + m_userEndPoint.ToString());
+ m_log.Info("[CLIENT]: Got authenticated connection from " + m_userEndPoint.ToString());
//session is authorised
m_firstName = sessionInfo.LoginInfo.First;
m_lastName = sessionInfo.LoginInfo.Last;
@@ -731,7 +733,7 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception e)
{
- MainLog.Instance.Warn("client",
+ m_log.Warn("[client]: " +
"ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
@@ -758,7 +760,7 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception e)
{
- MainLog.Instance.Warn("client",
+ m_log.Warn("[client]: " +
"ClientView.API.cs: SendLayerData() - Failed with exception " + e.ToString());
}
}
@@ -2102,7 +2104,7 @@ namespace OpenSim.Region.ClientStack
protected virtual bool Logout(IClientAPI client, Packet packet)
{
- MainLog.Instance.Verbose("CLIENT", "Got a logout request");
+ m_log.Info("[CLIENT]: Got a logout request");
if (OnLogout != null)
{
@@ -2431,10 +2433,10 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception e)
{
- MainLog.Instance.Warn("client",
+ m_log.Warn("[client]: " +
"ClientView.m_packetQueue.cs:ProcessOutPacket() - WARNING: Socket exception occurred on connection " +
m_userEndPoint.ToString() + " - killing thread");
- MainLog.Instance.Error(e.ToString());
+ m_log.Error(e.ToString());
Close(true);
}
}
@@ -2545,7 +2547,7 @@ namespace OpenSim.Region.ClientStack
{
if ((now - packet.TickCount > RESEND_TIMEOUT) && (!packet.Header.Resent))
{
- MainLog.Instance.Verbose("NETWORK", "Resending " + packet.Type.ToString() + " packet, " +
+ m_log.Info("[NETWORK]: Resending " + packet.Type.ToString() + " packet, " +
(now - packet.TickCount) + "ms have passed");
packet.Header.Resent = true;
@@ -2564,11 +2566,11 @@ namespace OpenSim.Region.ClientStack
if (m_pendingAcks.Count > 250)
{
// FIXME: Handle the odd case where we have too many pending ACKs queued up
- MainLog.Instance.Verbose("NETWORK", "Too many ACKs queued up!");
+ m_log.Info("[NETWORK]: Too many ACKs queued up!");
return;
}
- //MainLog.Instance.Verbose("NETWORK", "Sending PacketAck");
+ //m_log.Info("[NETWORK]: Sending PacketAck");
int i = 0;
PacketAckPacket acks = (PacketAckPacket)PacketPool.Instance.GetPacket(PacketType.PacketAck);
@@ -2754,7 +2756,7 @@ namespace OpenSim.Region.ClientStack
//rezPacket.RezData.RemoveItem;
//rezPacket.RezData.RezSelected;
//rezPacket.RezData.FromTaskID;
- //MainLog.Instance.Verbose("REZData", rezPacket.ToString());
+ //m_log.Info("[REZData]: " + rezPacket.ToString());
OnRezObject(this, rezPacket.InventoryData.ItemID, rezPacket.RezData.RayEnd,
rezPacket.RezData.RayStart, rezPacket.RezData.RayTargetID,
rezPacket.RezData.BypassRaycast, rezPacket.RezData.RayEndIsIntersection,
@@ -2772,7 +2774,7 @@ namespace OpenSim.Region.ClientStack
break;
case PacketType.ModifyLand:
ModifyLandPacket modify = (ModifyLandPacket)Pack;
- //MainLog.Instance.Verbose("LAND", "LAND:" + modify.ToString());
+ //m_log.Info("[LAND]: LAND:" + modify.ToString());
if (modify.ParcelData.Length > 0)
{
if (OnModifyTerrain != null)
@@ -2941,7 +2943,7 @@ namespace OpenSim.Region.ClientStack
{
ObjectAddPacket addPacket = (ObjectAddPacket)Pack;
PrimitiveBaseShape shape = GetShapeFromAddPacket(addPacket);
- // MainLog.Instance.Verbose("REZData", addPacket.ToString());
+ // m_log.Info("[REZData]: " + addPacket.ToString());
//BypassRaycast: 1
//RayStart: <69.79469, 158.2652, 98.40343>
//RayEnd: <61.97724, 141.995, 92.58341>
@@ -3068,7 +3070,7 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.ObjectPermissions:
- MainLog.Instance.Warn("CLIENT", "unhandled packet " + PacketType.ObjectPermissions.ToString());
+ m_log.Warn("[CLIENT]: unhandled packet " + PacketType.ObjectPermissions.ToString());
ObjectPermissionsPacket newobjPerms = (ObjectPermissionsPacket)Pack;
List permChanges =
@@ -3344,7 +3346,7 @@ namespace OpenSim.Region.ClientStack
}
break;
case PacketType.MoveTaskInventory:
- MainLog.Instance.Warn("CLIENT", "unhandled MoveTaskInventory packet");
+ m_log.Warn("[CLIENT]: unhandled MoveTaskInventory packet");
break;
case PacketType.RezScript:
//Console.WriteLine(Pack.ToString());
@@ -3594,7 +3596,7 @@ namespace OpenSim.Region.ClientStack
break;
case PacketType.GodKickUser:
- MainLog.Instance.Warn("CLIENT", "unhandled GodKickUser packet");
+ m_log.Warn("[CLIENT]: unhandled GodKickUser packet");
GodKickUserPacket gkupack = (GodKickUserPacket)Pack;
@@ -3624,88 +3626,88 @@ namespace OpenSim.Region.ClientStack
// Send the client the ping response back
// Pass the same PingID in the matching packet
// Handled In the packet processing
- //MainLog.Instance.Debug("CLIENT", "possibly unhandled StartPingCheck packet");
+ //m_log.Debug("[CLIENT]: possibly unhandled StartPingCheck packet");
break;
case PacketType.CompletePingCheck:
// TODO: Perhaps this should be processed on the Sim to determine whether or not to drop a dead client
- //MainLog.Instance.Warn("CLIENT", "unhandled CompletePingCheck packet");
+ //m_log.Warn("[CLIENT]: unhandled CompletePingCheck packet");
break;
case PacketType.ObjectScale:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled ObjectScale packet");
+ m_log.Warn("[CLIENT]: unhandled ObjectScale packet");
break;
case PacketType.ViewerStats:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled ViewerStats packet");
+ m_log.Warn("[CLIENT]: unhandled ViewerStats packet");
break;
case PacketType.CreateGroupRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled CreateGroupRequest packet");
+ m_log.Warn("[CLIENT]: unhandled CreateGroupRequest packet");
break;
case PacketType.GenericMessage:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled GenericMessage packet");
+ m_log.Warn("[CLIENT]: unhandled GenericMessage packet");
break;
case PacketType.MapItemRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled MapItemRequest packet");
+ m_log.Warn("[CLIENT]: unhandled MapItemRequest packet");
break;
case PacketType.AgentResume:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled AgentResume packet");
+ m_log.Warn("[CLIENT]: unhandled AgentResume packet");
break;
case PacketType.AgentPause:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled AgentPause packet");
+ m_log.Warn("[CLIENT]: unhandled AgentPause packet");
break;
case PacketType.TransferAbort:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled TransferAbort packet");
+ m_log.Warn("[CLIENT]: unhandled TransferAbort packet");
break;
case PacketType.MuteListRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled MuteListRequest packet");
+ m_log.Warn("[CLIENT]: unhandled MuteListRequest packet");
break;
case PacketType.AgentDataUpdateRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled AgentDataUpdateRequest packet");
+ m_log.Warn("[CLIENT]: unhandled AgentDataUpdateRequest packet");
break;
case PacketType.ParcelDwellRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled ParcelDwellRequest packet");
+ m_log.Warn("[CLIENT]: unhandled ParcelDwellRequest packet");
break;
case PacketType.UseCircuitCode:
// TODO: handle this packet
- //MainLog.Instance.Warn("CLIENT", "unhandled UseCircuitCode packet");
+ //m_log.Warn("[CLIENT]: unhandled UseCircuitCode packet");
break;
case PacketType.EconomyDataRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled EconomyDataRequest packet");
+ m_log.Warn("[CLIENT]: unhandled EconomyDataRequest packet");
break;
case PacketType.AgentHeightWidth:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled AgentHeightWidth packet");
+ m_log.Warn("[CLIENT]: unhandled AgentHeightWidth packet");
break;
case PacketType.ObjectSpinStop:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled ObjectSpinStop packet");
+ m_log.Warn("[CLIENT]: unhandled ObjectSpinStop packet");
break;
case PacketType.SoundTrigger:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled SoundTrigger packet");
+ m_log.Warn("[CLIENT]: unhandled SoundTrigger packet");
break;
case PacketType.UserInfoRequest:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled UserInfoRequest packet");
+ m_log.Warn("[CLIENT]: unhandled UserInfoRequest packet");
break;
case PacketType.InventoryDescendents:
// TODO: handle this packet
- MainLog.Instance.Warn("CLIENT", "unhandled InventoryDescent packet");
+ m_log.Warn("[CLIENT]: unhandled InventoryDescent packet");
break;
default:
- MainLog.Instance.Warn("CLIENT", "unhandled packet " + Pack.ToString());
+ m_log.Warn("[CLIENT]: unhandled packet " + Pack.ToString());
break;
#endregion
diff --git a/OpenSim/Region/ClientStack/PacketQueue.cs b/OpenSim/Region/ClientStack/PacketQueue.cs
index 685f91b..8b2a93a 100644
--- a/OpenSim/Region/ClientStack/PacketQueue.cs
+++ b/OpenSim/Region/ClientStack/PacketQueue.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Region.ClientStack
{
public class PacketQueue
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private bool m_enabled = true;
private BlockingQueue SendQueue;
@@ -204,7 +206,7 @@ namespace OpenSim.Region.ClientStack
SendQueue.Enqueue(AssetOutgoingPacketQueue.Dequeue());
}
}
- // MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets");
+ // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
}
}
@@ -253,7 +255,7 @@ namespace OpenSim.Region.ClientStack
lock (this)
{
ResetCounters();
- // MainLog.Instance.Verbose("THROTTLE", "Entering Throttle");
+ // m_log.Info("[THROTTLE]: Entering Throttle");
while (TotalThrottle.UnderLimit() && PacketsWaiting() &&
(throttleLoops <= MaxThrottleLoops))
{
@@ -316,7 +318,7 @@ namespace OpenSim.Region.ClientStack
AssetThrottle.Add(qpack.Packet.ToBytes().Length);
}
}
- // MainLog.Instance.Verbose("THROTTLE", "Processed " + throttleLoops + " packets");
+ // m_log.Info("[THROTTLE]: Processed " + throttleLoops + " packets");
}
}
@@ -426,7 +428,7 @@ namespace OpenSim.Region.ClientStack
tall = tResend + tLand + tWind + tCloud + tTask + tTexture + tAsset;
/*
- MainLog.Instance.Verbose("CLIENT", "Client AgentThrottle - Got throttle:resendbytes=" + tResend +
+ m_log.Info("[CLIENT]: Client AgentThrottle - Got throttle:resendbytes=" + tResend +
" landbytes=" + tLand +
" windbytes=" + tWind +
" cloudbytes=" + tCloud +
diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
index 72917d1..8a042b1 100644
--- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs
+++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Region.ClientStack
{
public abstract class RegionApplicationBase : BaseOpenSimServer
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
protected AssetCache m_assetCache;
protected Dictionary m_clientCircuits = new Dictionary();
protected NetworkServersInfo m_networkServersInfo;
@@ -75,19 +77,20 @@ namespace OpenSim.Region.ClientStack
m_httpServer = new BaseHttpServer(m_httpServerPort);
- m_log.Status("REGION", "Starting HTTP server");
+ m_log.Info("[REGION]: Starting HTTP server");
+
m_httpServer.Start();
}
protected abstract void Initialize();
- protected void StartLog()
+ protected void StartConsole()
{
- m_log = CreateLog();
- MainLog.Instance = m_log;
+ m_console = CreateConsole();
+ MainConsole.Instance = m_console;
}
- protected abstract LogBase CreateLog();
+ protected abstract ConsoleBase CreateConsole();
protected abstract PhysicsScene GetPhysicsScene();
protected abstract StorageManager CreateStorageManager(string connectionstring);
@@ -107,7 +110,7 @@ namespace OpenSim.Region.ClientStack
// listenIP = IPAddress.Parse("0.0.0.0");
uint port = (uint) regionInfo.InternalEndPoint.Port;
- udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, m_log, circuitManager);
+ udpServer = new UDPServer(listenIP, ref port, regionInfo.m_allow_alternate_ports, m_assetCache, circuitManager);
regionInfo.InternalEndPoint.Port = (int)port;
Scene scene = CreateScene(regionInfo, m_storageManager, circuitManager);
@@ -136,12 +139,12 @@ namespace OpenSim.Region.ClientStack
if (masterAvatar != null)
{
- m_log.Verbose("PARCEL", "Found master avatar [" + masterAvatar.UUID.ToString() + "]");
+ m_log.Info("[PARCEL]: Found master avatar [" + masterAvatar.UUID.ToString() + "]");
scene.RegionInfo.MasterAvatarAssignedUUID = masterAvatar.UUID;
}
else
{
- m_log.Verbose("PARCEL", "No master avatar found, using null.");
+ m_log.Info("[PARCEL]: No master avatar found, using null.");
scene.RegionInfo.MasterAvatarAssignedUUID = LLUUID.Zero;
}
diff --git a/OpenSim/Region/ClientStack/UDPServer.cs b/OpenSim/Region/ClientStack/UDPServer.cs
index 3e2b536..f9918ff 100644
--- a/OpenSim/Region/ClientStack/UDPServer.cs
+++ b/OpenSim/Region/ClientStack/UDPServer.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Region.ClientStack
{
public class UDPServer : ClientStackNetworkHandler
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
protected Dictionary clientCircuits = new Dictionary();
public Dictionary clientCircuits_reverse = new Dictionary();
public Socket Server;
@@ -56,7 +58,6 @@ namespace OpenSim.Region.ClientStack
protected IPAddress listenIP = IPAddress.Parse("0.0.0.0");
protected IScene m_localScene;
protected AssetCache m_assetCache;
- protected LogBase m_log;
protected AgentCircuitManager m_authenticateSessionsClass;
public PacketServer PacketServer
@@ -84,13 +85,12 @@ namespace OpenSim.Region.ClientStack
{
}
- public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, LogBase console, AgentCircuitManager authenticateClass)
+ public UDPServer(IPAddress _listenIP, ref uint port, bool allow_alternate_port, AssetCache assetCache, AgentCircuitManager authenticateClass)
{
listenIP = _listenIP;
listenPort = port;
Allow_Alternate_Port = allow_alternate_port;
m_assetCache = assetCache;
- m_log = console;
m_authenticateSessionsClass = authenticateClass;
CreatePacketServer();
@@ -121,7 +121,7 @@ namespace OpenSim.Region.ClientStack
{
// TODO : Actually only handle those states that we have control over, re-throw everything else,
// TODO: implement cases as we encounter them.
- //m_log.Error("UDPSERVER", "Connection Error! - " + e.ToString());
+ //m_log.Error("[UDPSERVER]: Connection Error! - " + e.ToString());
switch (e.SocketErrorCode)
{
case SocketError.AlreadyInProgress:
@@ -134,7 +134,7 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception a)
{
- MainLog.Instance.Verbose("UDPSERVER", a.ToString());
+ m_log.Info("[UDPSERVER]: " + a.ToString());
}
try
{
@@ -159,7 +159,7 @@ namespace OpenSim.Region.ClientStack
}
catch (Exception)
{
- //MainLog.Instance.Verbose("UDPSERVER", a.ToString());
+ //m_log.Info("[UDPSERVER]" + a.ToString());
}
try
{
@@ -191,8 +191,7 @@ namespace OpenSim.Region.ClientStack
}
catch (ObjectDisposedException)
{
-
- //MainLog.Instance.Debug("UDPSERVER", e.ToString());
+ //m_log.Debug("[UDPSERVER]: " + e.ToString());
return;
}
@@ -214,20 +213,20 @@ namespace OpenSim.Region.ClientStack
if (clientCircuits.TryGetValue(epSender, out circuit))
{
//if so then send packet to the packetserver
- //MainLog.Instance.Warn("UDPSERVER", "ALREADY HAVE Circuit!");
+ //m_log.Warn("[UDPSERVER]: ALREADY HAVE Circuit!");
m_packetServer.InPacket(circuit, packet);
}
else if (packet.Type == PacketType.UseCircuitCode)
{
// new client
- MainLog.Instance.Debug("UDPSERVER", "Adding New Client");
+ m_log.Debug("[UDPSERVER]: Adding New Client");
AddNewClient(packet);
}
else
{
// invalid client
//CFK: This message seems to have served its usefullness as of 12-15 so I am commenting it out for now
- //m_log.Warn("UDPSERVER", "Got a packet from an invalid client - " + packet.ToString());
+ //m_log.Warn("[UDPSERVER]: Got a packet from an invalid client - " + packet.ToString());
}
}
@@ -255,12 +254,11 @@ namespace OpenSim.Region.ClientStack
public void ServerListener()
{
-
uint newPort = listenPort;
for (uint i = 0; i < 20; i++)
{
newPort = listenPort + i;
- m_log.Verbose("SERVER", "Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString());
+ m_log.Info("[SERVER]: Opening UDP socket on " + listenIP.ToString() + " " + newPort + ".");// Allow alternate ports: " + Allow_Alternate_Port.ToString());
try
{
ServerIncoming = new IPEndPoint(listenIP, (int) newPort);
@@ -276,19 +274,19 @@ namespace OpenSim.Region.ClientStack
throw (ex);
// We are looking for alternate ports!
- m_log.Verbose("SERVER", "UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next.");
+ m_log.Info("[SERVER]: UDP socket on " + listenIP.ToString() + " " + listenPort.ToString() + " is not available, trying next.");
}
System.Threading.Thread.Sleep(100); // Wait before we retry socket
}
- m_log.Verbose("SERVER", "UDP socket bound, getting ready to listen");
+ m_log.Info("[SERVER]: UDP socket bound, getting ready to listen");
ipeSender = new IPEndPoint(listenIP, 0);
epSender = (EndPoint) ipeSender;
ReceivedData = new AsyncCallback(OnReceivedData);
Server.BeginReceiveFrom(RecvBuffer, 0, RecvBuffer.Length, SocketFlags.None, ref epSender, ReceivedData, null);
- m_log.Status("SERVER", "Listening on port " + newPort);
+ m_log.Info("[SERVER]: Listening on port " + newPort);
}
public virtual void RegisterPacketServer(PacketServer server)
diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
index 25452c1..98419ab 100644
--- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
+++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Region.Communications.Local
{
public class LocalBackEndServices : IGridServices, IInterRegionCommunications
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
protected Dictionary m_regions = new Dictionary();
protected Dictionary m_regionListeners =
@@ -93,8 +95,9 @@ namespace OpenSim.Region.Communications.Local
RegionCommsListener regionHost = new RegionCommsListener();
if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
{
- MainLog.Instance.Error("INTERREGION",
- "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
+ m_log.Error("[INTERREGION]: " +
+ "Error:Region registered twice as an Events listener for Interregion Communications but not as a listed region. " +
+ "In Standalone mode this will cause BIG issues. In grid mode, it means a region went down and came back up.");
m_regionListeners.Remove(regionInfo.RegionHandle);
}
m_regionListeners.Add(regionInfo.RegionHandle, regionHost);
@@ -105,7 +108,7 @@ namespace OpenSim.Region.Communications.Local
{
// Already in our list, so the region went dead and restarted.
m_regions.Remove(regionInfo.RegionHandle);
- MainLog.Instance.Warn("INTERREGION", "Region registered twice. Region went down and came back up.");
+ m_log.Warn("[INTERREGION]: Region registered twice. Region went down and came back up.");
RegionCommsListener regionHost = new RegionCommsListener();
if (m_regionListeners.ContainsKey(regionInfo.RegionHandle))
@@ -229,7 +232,7 @@ namespace OpenSim.Region.Communications.Local
{
// Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerChildAgentUpdate(regionHandle, cAgentData);
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true;
}
@@ -292,13 +295,13 @@ namespace OpenSim.Region.Communications.Local
//should change from agentCircuitData
{
//Console.WriteLine("CommsManager- Trying to Inform a region to expect child agent");
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Trying to inform region of child agent: " + agentData.firstname + " " + agentData.lastname);
if (m_regionListeners.ContainsKey(regionHandle))
{
// Console.WriteLine("CommsManager- Informing a region to expect child agent");
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agentData);
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Got Listener trigginering local event: " + agentData.firstname + " " + agentData.lastname);
return true;
}
@@ -389,11 +392,11 @@ namespace OpenSim.Region.Communications.Local
public void TriggerExpectUser(ulong regionHandle, AgentCircuitData agent)
{
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other region is sending child agent our way: " + agent.firstname + " " + agent.lastname);
if (m_regionListeners.ContainsKey(regionHandle))
{
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: FoundLocalRegion To send it to: " + agent.firstname + " " + agent.lastname);
m_regionListeners[regionHandle].TriggerExpectUser(regionHandle, agent);
}
@@ -443,11 +446,11 @@ namespace OpenSim.Region.Communications.Local
public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
{
- // MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname);
+ // m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: Other local region is sending child agent our way: " + agentData.firstname + " " + agentData.lastname);
if (m_regionListeners.ContainsKey(regionHandle))
{
- //MainLog.Instance.Verbose("INTER", rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname);
+ //m_log.Info("[INTER]: " + rdebugRegionName + ":Local BackEnd: found local region to trigger event on: " + agentData.firstname + " " + agentData.lastname);
TriggerExpectUser(regionHandle, agentData);
return true;
diff --git a/OpenSim/Region/Communications/Local/LocalLoginService.cs b/OpenSim/Region/Communications/Local/LocalLoginService.cs
index 2848b8a..f6dd379 100644
--- a/OpenSim/Region/Communications/Local/LocalLoginService.cs
+++ b/OpenSim/Region/Communications/Local/LocalLoginService.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Region.Communications.Local
public class LocalLoginService : LoginService
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private CommunicationsLocal m_Parent;
private NetworkServersInfo serversInfo;
@@ -77,7 +79,7 @@ namespace OpenSim.Region.Communications.Local
if (!authUsers)
{
//no current user account so make one
- MainLog.Instance.Notice("LOGIN", "No user account found so creating a new one.");
+ m_log.Info("[LOGIN]: No user account found so creating a new one.");
m_userManager.AddUserProfile(firstname, lastname, "test", defaultHomeX, defaultHomeY);
@@ -97,14 +99,14 @@ namespace OpenSim.Region.Communications.Local
if (!authUsers)
{
//for now we will accept any password in sandbox mode
- MainLog.Instance.Notice("LOGIN", "Authorising user (no actual password check)");
+ m_log.Info("[LOGIN]: Authorising user (no actual password check)");
return true;
}
else
{
- MainLog.Instance.Notice(
- "LOGIN", "Authenticating " + profile.username + " " + profile.surname);
+ m_log.Info(
+ "[LOGIN]: Authenticating " + profile.username + " " + profile.surname);
if (!password.StartsWith("$1$"))
password = "$1$" + Util.Md5Hash(password);
@@ -166,7 +168,7 @@ namespace OpenSim.Region.Communications.Local
}
else
{
- MainLog.Instance.Warn("LOGIN", "Not found region " + currentRegion);
+ m_log.Warn("[LOGIN]: Not found region " + currentRegion);
}
}
private LoginResponse.BuddyList ConvertFriendListItem(List LFL)
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index 1576bf3..f04574a 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Region.Communications.OGS1
{
public class OGS1GridServices : IGridServices, IInterRegionCommunications
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private LocalBackEndServices m_localBackend = new LocalBackEndServices();
private Dictionary m_remoteRegionInfoCache = new Dictionary();
private List m_knownRegions = new List();
@@ -138,7 +140,7 @@ namespace OpenSim.Region.Communications.OGS1
GridResp = GridReq.Send(serversInfo.GridURL, 10000);
} catch (Exception ex)
{
- MainLog.Instance.Error("Unable to connect to grid. Grid server not running?");
+ m_log.Error("Unable to connect to grid. Grid server not running?");
throw(ex);
}
Hashtable GridRespData = (Hashtable)GridResp.Value;
@@ -148,7 +150,7 @@ namespace OpenSim.Region.Communications.OGS1
if (GridRespData.ContainsKey("error"))
{
string errorstring = (string) GridRespData["error"];
- MainLog.Instance.Error("Unable to connect to grid: " + errorstring);
+ m_log.Error("Unable to connect to grid: " + errorstring);
return null;
}
else
@@ -330,9 +332,9 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException)
{
- MainLog.Instance.Error("GRID",
- "Region lookup failed for: " + regionHandle.ToString() +
- " - Is the GridServer down?");
+ m_log.Error("[GRID]: " +
+ "Region lookup failed for: " + regionHandle.ToString() +
+ " - Is the GridServer down?");
return null;
}
}
@@ -421,7 +423,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (Exception e)
{
- MainLog.Instance.Error("MapBlockQuery XMLRPC failure: " + e.ToString());
+ m_log.Error("MapBlockQuery XMLRPC failure: " + e.ToString());
return new Hashtable();
}
}
@@ -482,7 +484,7 @@ namespace OpenSim.Region.Communications.OGS1
m_localBackend.TriggerExpectUser(regionHandle, agentData);
- MainLog.Instance.Verbose("GRID", "Welcoming new user...");
+ m_log.Info("[GRID]: Welcoming new user...");
return new XmlRpcResponse();
}
@@ -555,7 +557,7 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found");
}
remObject = null;
- //MainLog.Instance.Verbose("INTER",
+ //m_log.Info("[INTER]: " +
//gdebugRegionName +
//": OGS1 tried to Update Child Agent data on outside region and got " +
//retValue.ToString());
@@ -569,45 +571,45 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " +
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (SocketException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + " " +
+ m_log.Warn("Socket Error: Unable to connect to adjacent region: " + " " +
regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " +
+ m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (AuthenticationException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " +
+ m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (Exception e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
}
else
{
- //MainLog.Instance.Verbose("INTERREGION", "Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString());
+ //m_log.Info("[INTERREGION]: Skipped Sending Child Update to a region because it failed too many times:" + regionHandle.ToString());
return false;
}
}
@@ -650,10 +652,10 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found");
}
remObject = null;
- MainLog.Instance.Verbose("INTER",
- gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " +
- agentData.firstname + " " + agentData.lastname + " and got " +
- retValue.ToString());
+ m_log.Info("[INTER]: " +
+ gdebugRegionName + ": OGS1 tried to InformRegionOfChildAgent for " +
+ agentData.firstname + " " + agentData.lastname + " and got " +
+ retValue.ToString());
return retValue;
@@ -664,41 +666,41 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (SocketException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
+ m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
+ m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (AuthenticationException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " +
+ m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (Exception e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
+ m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
}
@@ -748,7 +750,7 @@ namespace OpenSim.Region.Communications.OGS1
Console.WriteLine("remoting object not found");
}
remObject = null;
- MainLog.Instance.Verbose("INTER", gdebugRegionName + ": OGS1 tried to inform region I'm up");
+ m_log.Info("[INTER]: " + gdebugRegionName + ": OGS1 tried to inform region I'm up");
return retValue;
}
@@ -765,49 +767,49 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException e)
{
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" +
- regInfo.RemotingAddress +
- ":" + regInfo.RemotingPort +
- "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
- " - Is this neighbor up?");
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region using tcp://" +
+ regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
+ " - Is this neighbor up?");
+ m_log.Debug(e.ToString());
return false;
}
catch (SocketException e)
{
- MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
- regInfo.RemotingAddress +
- ":" + regInfo.RemotingPort +
- "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
- " - Is this neighbor up?");
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
+ regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
+ " - Is this neighbor up?");
+ m_log.Debug(e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
- MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
- regInfo.RemotingAddress +
- ":" + regInfo.RemotingPort +
- "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
+ regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (AuthenticationException e)
{
- MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
- regInfo.RemotingAddress +
- ":" + regInfo.RemotingPort +
- "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
+ regInfo.RemotingAddress +
+ ":" + regInfo.RemotingPort +
+ "/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (Exception e)
{
// This line errors with a Null Reference Exception.. Why? @.@
- //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
+ //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
// ":" + regInfo.RemotingPort +
//"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one");
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
}
@@ -860,41 +862,41 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (SocketException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
- regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Socket Error: Unable to connect to adjacent region: " + regInfo.RegionName + " " +
+ regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Invalid Credentials: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (AuthenticationException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region: " +
- regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Authentication exception: Unable to connect to adjacent region: " +
+ regInfo.RegionName + " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch (Exception e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Unknown exception: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
}
@@ -947,9 +949,9 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch
@@ -1000,9 +1002,9 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
- " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region: " + regInfo.RegionName +
+ " " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
+ m_log.Debug(e.ToString());
return false;
}
catch
@@ -1052,61 +1054,61 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName +
+ m_log.Warn("Remoting Error: Unable to connect to adjacent region to tell it to close child agents: " + regInfo.RegionName +
" " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- //MainLog.Instance.Debug(e.ToString());
+ //m_log.Debug(e.ToString());
return false;
}
catch (SocketException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
+ m_log.Warn("Socket Error: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY +
" - Is this neighbor up?");
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (InvalidCredentialException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
+ m_log.Warn("Invalid Credentials: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (AuthenticationException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
+ m_log.Warn("Authentication exception: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (WebException e)
{
NoteDeadRegion(regionHandle);
- MainLog.Instance.Warn("WebException exception: Unable to connect to adjacent region using tcp://" +
+ m_log.Warn("WebException exception: Unable to connect to adjacent region using tcp://" +
regInfo.RemotingAddress +
":" + regInfo.RemotingPort +
"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY);
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
catch (Exception e)
{
NoteDeadRegion(regionHandle);
// This line errors with a Null Reference Exception.. Why? @.@
- //MainLog.Instance.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
+ //m_log.Warn("Unknown exception: Unable to connect to adjacent region using tcp://" + regInfo.RemotingAddress +
// ":" + regInfo.RemotingPort +
//"/InterRegions - @ " + regInfo.RegionLocX + "," + regInfo.RegionLocY + " - This is likely caused by an incompatibility in the protocol between this sim and that one");
- MainLog.Instance.Debug(e.ToString());
+ m_log.Debug(e.ToString());
return false;
}
}
@@ -1133,7 +1135,7 @@ namespace OpenSim.Region.Communications.OGS1
///
public bool IncomingChildAgent(ulong regionHandle, AgentCircuitData agentData)
{
- //MainLog.Instance.Verbose("INTER", gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname);
+ //m_log.Info("[INTER]: " + gdebugRegionName + ": Incoming OGS1 Agent " + agentData.firstname + " " + agentData.lastname);
try
{
@@ -1141,16 +1143,16 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException)
{
- //MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ //m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
public bool TriggerRegionUp(SearializableRegionInfo regionData, ulong regionhandle)
{
- MainLog.Instance.Verbose("INTER",
- gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX +
- "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries");
+ m_log.Info("[INTER]: " +
+ gdebugRegionName + "Incoming OGS1 RegionUpReport: " + "(" + regionData.RegionLocX +
+ "," + regionData.RegionLocY + "). Giving this region a fresh set of 'dead' tries");
try
{
@@ -1169,14 +1171,14 @@ namespace OpenSim.Region.Communications.OGS1
catch (RemotingException e)
{
- MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
public bool TriggerChildAgentUpdate(ulong regionHandle, ChildAgentDataUpdate cAgentData)
{
- //MainLog.Instance.Verbose("INTER", "Incoming OGS1 Child Agent Data Update");
+ //m_log.Info("[INTER]: Incoming OGS1 Child Agent Data Update");
try
{
@@ -1184,7 +1186,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException e)
{
- MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
@@ -1206,7 +1208,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException e)
{
- MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
@@ -1226,7 +1228,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException e)
{
- MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
@@ -1239,7 +1241,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException e)
{
- MainLog.Instance.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
+ m_log.Error("Remoting Error: Unable to connect to adjacent region.\n" + e.ToString());
return false;
}
}
@@ -1252,7 +1254,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (RemotingException)
{
- MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to neighbour to tell it to close a child connection");
+ m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to neighbour to tell it to close a child connection");
return false;
}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
index b39e0b7..217bb81 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InterSimComms.cs
@@ -141,6 +141,8 @@ namespace OpenSim.Region.Communications.OGS1
public class OGS1InterRegionRemoting : MarshalByRefObject
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public OGS1InterRegionRemoting()
{
}
@@ -230,18 +232,18 @@ namespace OpenSim.Region.Communications.OGS1
return false;
}
}
+
public bool TellRegionToCloseChildConnection(ulong regionHandle, Guid agentID)
{
try
{
return InterRegionSingleton.Instance.TellRegionToCloseChildConnection(regionHandle, new LLUUID(agentID));
-
}
catch (RemotingException)
{
- OpenSim.Framework.Console.MainLog.Instance.Verbose("INTERREGION", "Remoting Error: Unable to connect to remote region: " + regionHandle.ToString());
+ m_log.Info("[INTERREGION]: Remoting Error: Unable to connect to remote region: " + regionHandle.ToString());
return false;
}
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
index 1780707..656dd70 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1InventoryService.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Communications.OGS1
{
public class OGS1InventoryService : IInventoryServices
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private string _inventoryServerUrl;
private Dictionary m_RequestingInventory = new Dictionary();
@@ -71,9 +73,9 @@ namespace OpenSim.Region.Communications.OGS1
{
try
{
- MainLog.Instance.Verbose(
- "INVENTORY", "Requesting inventory from {0}/GetInventory/ for user {1}",
- _inventoryServerUrl, userID);
+ m_log.Info(
+ String.Format("[INVENTORY]: Requesting inventory from {0}/GetInventory/ for user {1}",
+ _inventoryServerUrl, userID));
RestObjectPosterResponse requester
= new RestObjectPosterResponse();
@@ -83,7 +85,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (Exception e)
{
- MainLog.Instance.Error("INVENTORY", e.ToString());
+ m_log.Error("[INVENTORY]: " + e.ToString());
}
}
@@ -96,9 +98,9 @@ namespace OpenSim.Region.Communications.OGS1
LLUUID userID = response.UserID;
if (m_RequestingInventory.ContainsKey(userID))
{
- MainLog.Instance.Verbose("INVENTORY",
+ m_log.Info(String.Format("[INVENTORY]: " +
"Received inventory response for user {0} containing {1} folders and {2} items",
- userID, response.Folders.Count, response.AllItems.Count);
+ userID, response.Folders.Count, response.AllItems.Count));
InventoryFolderImpl rootFolder = null;
InventoryRequest request = m_RequestingInventory[userID];
@@ -132,10 +134,10 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- MainLog.Instance.Warn(
- "INVENTORY",
- "Received inventory response for {0} for which we do not have a record of requesting!",
- userID);
+ m_log.Warn(
+ String.Format("[INVENTORY]: " +
+ "Received inventory response for {0} for which we do not have a record of requesting!",
+ userID));
}
}
@@ -198,4 +200,4 @@ namespace OpenSim.Region.Communications.OGS1
}
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
index 70b7e89..9a22d14 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1UserServices.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Region.Communications.OGS1
{
public class OGS1UserServices : IUserService
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private CommunicationsOGS1 m_parent;
public OGS1UserServices(CommunicationsOGS1 parent)
@@ -51,10 +53,10 @@ namespace OpenSim.Region.Communications.OGS1
{
if (data.Contains("error_type"))
{
- MainLog.Instance.Warn("GRID",
- "Error sent by user server when trying to get user profile: (" +
- data["error_type"] +
- "): " + data["error_desc"]);
+ m_log.Warn("[GRID]: " +
+ "Error sent by user server when trying to get user profile: (" +
+ data["error_type"] +
+ "): " + data["error_desc"]);
return null;
}
@@ -104,7 +106,7 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- MainLog.Instance.Warn("INTERGRID", "Got invalid queryID from userServer");
+ m_log.Warn("[INTERGRID]: Got invalid queryID from userServer");
}
return pickerlist;
}
@@ -158,7 +160,7 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (System.Net.WebException)
{
- MainLog.Instance.Warn("LOGOFF", "Unable to notify grid server of user logoff");
+ m_log.Warn("[LOGOFF]: Unable to notify grid server of user logoff");
}
@@ -186,8 +188,8 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException e)
{
- MainLog.Instance.Warn("Error when trying to fetch Avatar Picker Response: " +
- e.Message);
+ m_log.Warn("Error when trying to fetch Avatar Picker Response: " +
+ e.Message);
// Return Empty picker list (no results)
}
return pickerlist;
@@ -209,8 +211,8 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException e)
{
- MainLog.Instance.Warn("Error when trying to fetch profile data by name from remote user server: " +
- e.Message);
+ m_log.Warn("Error when trying to fetch profile data by name from remote user server: " +
+ e.Message);
}
return null;
}
@@ -299,24 +301,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to add new friend, User Server Reported an issue");
+ m_log.Warn("[GRID]: Unable to add new friend, User Server Reported an issue");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to add new friend, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to add new friend, UserServer didn't understand me!");
}
}
catch (WebException e)
{
- MainLog.Instance.Warn("GRID","Error when trying to AddNewUserFriend: " +
- e.Message);
+ m_log.Warn("[GRID]: Error when trying to AddNewUserFriend: " +
+ e.Message);
}
@@ -352,24 +354,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to remove friend, User Server Reported an issue");
+ m_log.Warn("[GRID]: Unable to remove friend, User Server Reported an issue");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to remove friend, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to remove friend, UserServer didn't understand me!");
}
}
catch (WebException e)
{
- MainLog.Instance.Warn("GRID", "Error when trying to RemoveUserFriend: " +
- e.Message);
+ m_log.Warn("[GRID]: Error when trying to RemoveUserFriend: " +
+ e.Message);
}
}
@@ -404,25 +406,24 @@ namespace OpenSim.Region.Communications.OGS1
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, User Server Reported an issue");
+ m_log.Warn("[GRID]: Unable to update_user_friend_perms, User Server Reported an issue");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
}
}
else
{
- MainLog.Instance.Warn("GRID", "Unable to update_user_friend_perms, UserServer didn't understand me!");
+ m_log.Warn("[GRID]: Unable to update_user_friend_perms, UserServer didn't understand me!");
}
}
catch (WebException e)
{
- MainLog.Instance.Warn("GRID", "Error when trying to update_user_friend_perms: " +
- e.Message);
-
+ m_log.Warn("[GRID]: Error when trying to update_user_friend_perms: " +
+ e.Message);
}
}
///
@@ -452,14 +453,13 @@ namespace OpenSim.Region.Communications.OGS1
}
catch (WebException e)
{
- MainLog.Instance.Warn("Error when trying to fetch Avatar's friends list: " +
- e.Message);
+ m_log.Warn("Error when trying to fetch Avatar's friends list: " +
+ e.Message);
// Return Empty list (no friends)
}
return buddylist;
-
}
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/EstateManager.cs b/OpenSim/Region/Environment/EstateManager.cs
index edc86e5..860bd93 100644
--- a/OpenSim/Region/Environment/EstateManager.cs
+++ b/OpenSim/Region/Environment/EstateManager.cs
@@ -41,6 +41,8 @@ namespace OpenSim.Region.Environment
///
public class EstateManager
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private Scene m_scene;
private RegionInfo m_regInfo;
@@ -156,7 +158,7 @@ namespace OpenSim.Region.Environment
{
case "getinfo":
- //MainLog.Instance.Verbose("ESTATE","CLIENT--->" + packet.ToString());
+ //m_log.Info("[ESTATE]: CLIENT--->" + packet.ToString());
sendRegionInfoPacketToAll();
if (m_scene.PermissionsMngr.GenericEstatePermission(remote_client.AgentId))
{
@@ -223,7 +225,7 @@ namespace OpenSim.Region.Environment
}
break;
default:
- MainLog.Instance.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
+ m_log.Error("EstateOwnerMessage: Unknown method requested\n" + packet.ToString());
break;
}
}
@@ -283,7 +285,7 @@ namespace OpenSim.Region.Environment
returnblock[8].Parameter = Helpers.StringToField("1");
packet.ParamList = returnblock;
- //MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString());
+ //m_log.Info("[ESTATE]: SIM--->" + packet.ToString());
remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
sendEstateManagerList(remote_client, packet);
@@ -322,7 +324,7 @@ namespace OpenSim.Region.Environment
returnblock[j].Parameter = EstateManagers[i].GetBytes(); j++;
}
packet.ParamList = returnblock;
- //MainLog.Instance.Verbose("ESTATE", "SIM--->" + packet.ToString());
+ //m_log.Info("[ESTATE]: SIM--->" + packet.ToString());
remote_client.OutPacket(packet, ThrottleOutPacketType.Task);
}
@@ -364,10 +366,10 @@ namespace OpenSim.Region.Environment
default:
- MainLog.Instance.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta\n" + packet.ToString());
+ m_log.Error("EstateOwnerMessage: Unknown EstateAccessType requested in estateAccessDelta\n" + packet.ToString());
break;
}
- //MainLog.Instance.Error("EstateOwnerMessage: estateAccessDelta\n" + packet.ToString());
+ //m_log.Error("EstateOwnerMessage: estateAccessDelta\n" + packet.ToString());
}
@@ -375,7 +377,7 @@ namespace OpenSim.Region.Environment
{
if (packet.ParamList.Length != 9)
{
- MainLog.Instance.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length");
+ m_log.Error("EstateOwnerMessage: SetRegionInfo method has a ParamList of invalid length");
}
else
{
@@ -438,7 +440,7 @@ namespace OpenSim.Region.Environment
{
if (packet.ParamList.Length != 9)
{
- MainLog.Instance.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
+ m_log.Error("EstateOwnerMessage: SetRegionTerrain method has a ParamList of invalid length");
}
else
{
@@ -463,7 +465,7 @@ namespace OpenSim.Region.Environment
}
catch (Exception ex)
{
- MainLog.Instance.Error("EstateManager: Exception while setting terrain settings: \n" + packet.ToString() + "\n" + ex.ToString());
+ m_log.Error("EstateManager: Exception while setting terrain settings: \n" + packet.ToString() + "\n" + ex.ToString());
}
}
}
diff --git a/OpenSim/Region/Environment/LandManagement/LandManager.cs b/OpenSim/Region/Environment/LandManagement/LandManager.cs
index c0c1b73..09fa09b 100644
--- a/OpenSim/Region/Environment/LandManagement/LandManager.cs
+++ b/OpenSim/Region/Environment/LandManagement/LandManager.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+
using System;
using System.Collections.Generic;
using Axiom.Math;
@@ -38,7 +39,6 @@ using OpenSim.Region.Physics.Manager;
namespace OpenSim.Region.Environment.LandManagement
{
-
#region LandManager Class
///
@@ -46,6 +46,8 @@ namespace OpenSim.Region.Environment.LandManagement
///
public class LandManager
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
#region Constants
//Land types set with flags in ParcelOverlay.
@@ -57,7 +59,6 @@ namespace OpenSim.Region.Environment.LandManagement
public const byte LAND_TYPE_IS_FOR_SALE = (byte) 4; //Equals 00000100
public const byte LAND_TYPE_IS_BEING_AUCTIONED = (byte) 5; //Equals 00000101
-
//Flags that when set, a border on the given side will be placed
//NOTE: North and East is assumable by the west and south sides (if land to east has a west border, then I have an east border; etc)
//This took forever to figure out -- jeesh. /blame LL for even having to send these
@@ -73,7 +74,6 @@ namespace OpenSim.Region.Environment.LandManagement
public const int LAND_SELECT_OBJECTS_GROUP = 4;
public const int LAND_SELECT_OBJECTS_OTHER = 8;
-
//These are other constants. Yay!
public const int START_LAND_LOCAL_ID = 1;
@@ -127,7 +127,7 @@ namespace OpenSim.Region.Environment.LandManagement
//}
//catch (Exception ex)
//{
- //MainLog.Instance.Error("LandManager", "IncomingLandObjectsFromStorage: Exception: " + ex.ToString());
+ //m_log.Error("[LandManager]: IncomingLandObjectsFromStorage: Exception: " + ex.ToString());
//throw ex;
//}
}
@@ -526,8 +526,7 @@ namespace OpenSim.Region.Environment.LandManagement
}
catch (Exception e)
{
- MainLog.Instance.Debug("LAND",
- "Skipped Land checks because avatar is out of bounds: " + e.Message);
+ m_log.Debug("[LAND]: Skipped Land checks because avatar is out of bounds: " + e.Message);
}
}
}
diff --git a/OpenSim/Region/Environment/ModuleLoader.cs b/OpenSim/Region/Environment/ModuleLoader.cs
index 76ba14b..d4031d9 100644
--- a/OpenSim/Region/Environment/ModuleLoader.cs
+++ b/OpenSim/Region/Environment/ModuleLoader.cs
@@ -40,16 +40,16 @@ namespace OpenSim.Region.Environment
{
public class ModuleLoader
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public Dictionary LoadedAssemblys = new Dictionary();
private readonly List m_loadedModules = new List();
private readonly Dictionary m_loadedSharedModules = new Dictionary();
- private readonly LogBase m_log;
private readonly IConfigSource m_config;
- public ModuleLoader(LogBase log, IConfigSource config)
+ public ModuleLoader(IConfigSource config)
{
- m_log = log;
m_config = config;
}
@@ -78,7 +78,7 @@ namespace OpenSim.Region.Environment
DynamicTextureModule dynamicModule = new DynamicTextureModule();
if (m_loadedSharedModules.ContainsKey(dynamicModule.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", dynamicModule.Name, "DynamicTextureModule"));
}
else
{
@@ -88,7 +88,7 @@ namespace OpenSim.Region.Environment
ChatModule chat = new ChatModule();
if (m_loadedSharedModules.ContainsKey(chat.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", chat.Name, "ChatModule"));
}
else
{
@@ -98,7 +98,7 @@ namespace OpenSim.Region.Environment
InstantMessageModule imMod = new InstantMessageModule();
if (m_loadedSharedModules.ContainsKey(imMod.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", imMod.Name, "InstantMessageModule"));
}
else
{
@@ -108,7 +108,7 @@ namespace OpenSim.Region.Environment
LoadImageURLModule loadMod = new LoadImageURLModule();
if (m_loadedSharedModules.ContainsKey(loadMod.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", loadMod.Name, "LoadImageURLModule"));
}
else
{
@@ -118,7 +118,7 @@ namespace OpenSim.Region.Environment
AvatarFactoryModule avatarFactory = new AvatarFactoryModule();
if (m_loadedSharedModules.ContainsKey(avatarFactory.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", avatarFactory.Name, "AvarFactoryModule"));
}
else
{
@@ -128,7 +128,7 @@ namespace OpenSim.Region.Environment
XMLRPCModule xmlRpcMod = new XMLRPCModule();
if (m_loadedSharedModules.ContainsKey(xmlRpcMod.Name))
{
- m_log.Error("MODULES", "Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule");
+ m_log.Error(String.Format("[MODULES]: Module name \"{0}\" already exists in module list. Module type {1} not added!", xmlRpcMod.Name, "XMLRPCModule"));
}
else
{
@@ -186,17 +186,17 @@ namespace OpenSim.Region.Environment
if (modules.Length > 0)
{
- m_log.Verbose("MODULES", "Found Module Library [{0}]", dllName);
+ m_log.Info(String.Format("[MODULES]: Found Module Library [{0}]", dllName));
foreach (IRegionModule module in modules)
{
if (!module.IsSharedModule)
{
- m_log.Verbose("MODULES", " [{0}]: Initializing.", module.Name);
+ m_log.Info(String.Format("[MODULES]: [{0}]: Initializing.", module.Name));
InitializeModule(module, scene);
}
else
{
- m_log.Verbose("MODULES", " [{0}]: Loading Shared Module.", module.Name);
+ m_log.Info(String.Format("[MODULES]: [{0}]: Loading Shared Module.", module.Name));
LoadSharedModule(module);
}
}
@@ -246,7 +246,7 @@ namespace OpenSim.Region.Environment
}
catch (BadImageFormatException)
{
- //m_log.Verbose("MODULES", "The file [{0}] is not a module assembly.", e.FileName);
+ //m_log.Info(String.Format("[MODULES]: The file [{0}] is not a module assembly.", e.FileName));
}
}
@@ -270,7 +270,7 @@ namespace OpenSim.Region.Environment
}
catch (ReflectionTypeLoadException)
{
- m_log.Verbose("MODULES", "Could not load types for [{0}].", pluginAssembly.FullName);
+ m_log.Info(String.Format("[MODULES]: Could not load types for [{0}].", pluginAssembly.FullName));
}
}
diff --git a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs
index 81478a1..d51936b 100644
--- a/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs
+++ b/OpenSim/Region/Environment/Modules/BetaGridLikeMoneyModule.cs
@@ -41,8 +41,7 @@ namespace OpenSim.Region.Environment.Modules
{
public class BetaGridLikeMoneyModule: IRegionModule
{
-
- private LogBase m_log;
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Dictionary m_scenel = new Dictionary();
@@ -66,8 +65,6 @@ namespace OpenSim.Region.Environment.Modules
public void Initialise(Scene scene, IConfigSource config)
{
- m_log = MainLog.Instance;
-
m_gConfig = config;
ReadConfigAndPopulate();
@@ -160,11 +157,8 @@ namespace OpenSim.Region.Environment.Modules
}
else
{
- MainLog.Instance.Warn("MONEY", "Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString());
+ m_log.Warn("[MONEY]: Potential Fraud Warning, got money transfer request for avatar that isn't in this simulator - Details; Sender:" + e.sender.ToString() + " Reciver: " + e.reciever.ToString() + " Amount: " + e.amount.ToString());
}
-
-
-
}
private bool doMoneyTranfer(LLUUID Sender, LLUUID Receiver, int amount)
diff --git a/OpenSim/Region/Environment/Modules/ChatModule.cs b/OpenSim/Region/Environment/Modules/ChatModule.cs
index 749a923..82bd2ec 100644
--- a/OpenSim/Region/Environment/Modules/ChatModule.cs
+++ b/OpenSim/Region/Environment/Modules/ChatModule.cs
@@ -43,8 +43,9 @@ namespace OpenSim.Region.Environment.Modules
{
public class ChatModule : IRegionModule, ISimChat
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private List m_scenes = new List();
- private LogBase m_log;
private int m_whisperdistance = 10;
private int m_saydistance = 30;
@@ -59,11 +60,6 @@ namespace OpenSim.Region.Environment.Modules
internal object m_syncLogout = new object();
private Thread m_irc_connector=null;
- public ChatModule()
- {
- m_log = MainLog.Instance;
- }
-
public void Initialise(Scene scene, IConfigSource config)
{
lock (m_syncInit)
@@ -159,7 +155,7 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception ex)
{
- m_log.Error("IRC", "NewClient exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: NewClient exception trap:" + ex.ToString());
}
}
@@ -180,13 +176,13 @@ namespace OpenSim.Region.Environment.Modules
{
m_last_leaving_user = clientName;
m_irc.PrivMsg(m_irc.Nick, "Sim", "notices " + clientName + " left " + clientRegion);
- m_log.Verbose("IRC", "IRC watcher notices " + clientName + " left " + clientRegion);
+ m_log.Info("[IRC]: IRC watcher notices " + clientName + " left " + clientRegion);
}
}
}
catch (Exception ex)
{
- m_log.Error("IRC", "ClientLoggedOut exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: ClientLoggedOut exception trap:" + ex.ToString());
}
}
@@ -319,6 +315,8 @@ namespace OpenSim.Region.Environment.Modules
internal class IRCChatModule
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private string m_server = null;
private uint m_port = 6668;
private string m_user = "USER OpenSimBot 8 * :I'm a OpenSim to irc bot";
@@ -341,7 +339,6 @@ namespace OpenSim.Region.Environment.Modules
private List m_scenes = null;
private List m_last_scenes = null;
- private LogBase m_log;
public IRCChatModule(IConfigSource config)
{
@@ -388,9 +385,8 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception)
{
- MainLog.Instance.Verbose("CHAT", "No IRC config information, skipping IRC bridge configuration");
+ m_log.Info("[CHAT]: No IRC config information, skipping IRC bridge configuration");
}
- m_log = MainLog.Instance;
}
public bool Connect(List scenes)
@@ -404,9 +400,9 @@ namespace OpenSim.Region.Environment.Modules
if (m_last_scenes == null) { m_last_scenes = scenes; }
m_tcp = new TcpClient(m_server, (int)m_port);
- m_log.Verbose("IRC", "Connecting...");
+ m_log.Info("[IRC]: Connecting...");
m_stream = m_tcp.GetStream();
- m_log.Verbose("IRC", "Connected to " + m_server);
+ m_log.Info("[IRC]: Connected to " + m_server);
m_reader = new StreamReader(m_stream);
m_writer = new StreamWriter(m_stream);
@@ -422,7 +418,7 @@ namespace OpenSim.Region.Environment.Modules
m_writer.Flush();
m_writer.WriteLine("JOIN " + m_channel);
m_writer.Flush();
- m_log.Verbose("IRC", "Connection fully established");
+ m_log.Info("[IRC]: Connection fully established");
m_connected = true;
}
catch (Exception e)
@@ -475,16 +471,16 @@ namespace OpenSim.Region.Environment.Modules
m_writer.WriteLine(m_privmsgformat, m_channel, from, region, msg);
}
m_writer.Flush();
- m_log.Verbose("IRC", "PrivMsg " + from + " in " + region + " :" + msg);
+ m_log.Info("[IRC]: PrivMsg " + from + " in " + region + " :" + msg);
}
catch (IOException)
{
- m_log.Error("IRC", "Disconnected from IRC server.(PrivMsg)");
+ m_log.Error("[IRC]: Disconnected from IRC server.(PrivMsg)");
Reconnect();
}
catch (Exception ex)
{
- m_log.Error("IRC", "PrivMsg exception trap:" + ex.ToString());
+ m_log.Error("[IRC]: PrivMsg exception trap:" + ex.ToString());
}
}
@@ -493,7 +489,7 @@ namespace OpenSim.Region.Environment.Modules
//examines IRC commands and extracts any private messages
// which will then be reboadcast in the Sim
- m_log.Verbose("IRC", "ExtractMsg: " + input);
+ m_log.Info("[IRC]: ExtractMsg: " + input);
Dictionary result = null;
//string regex = @":(?\w*)!~(?\S*) PRIVMSG (?\S+) :(?.*)";
string regex = @":(?\w*)!(?\S*) PRIVMSG (?\S+) :(?.*)";
@@ -510,10 +506,10 @@ namespace OpenSim.Region.Environment.Modules
}
else
{
- m_log.Verbose("IRC", "Number of matches: " + matches.Count);
+ m_log.Info("[IRC]: Number of matches: " + matches.Count);
if (matches.Count > 0)
{
- m_log.Verbose("IRC", "Number of groups: " + matches[0].Groups.Count);
+ m_log.Info("[IRC]: Number of groups: " + matches[0].Groups.Count);
}
}
return result;
@@ -536,12 +532,12 @@ namespace OpenSim.Region.Environment.Modules
}
catch (IOException)
{
- m_log.Error("IRC", "Disconnected from IRC server.(PingRun)");
+ m_log.Error("[IRC]: Disconnected from IRC server.(PingRun)");
Reconnect();
}
catch (Exception ex)
{
- m_log.Error("IRC", "PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ m_log.Error("[IRC]: PingRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
}
}
}
@@ -552,29 +548,29 @@ namespace OpenSim.Region.Environment.Modules
LLVector3 pos = new LLVector3(128, 128, 20);
while (true)
{
- try
- {
- while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null))
+ try
{
+ while ((m_connected == true) && ((inputLine = m_reader.ReadLine()) != null))
+ {
// Console.WriteLine(inputLine);
if (inputLine.Contains(m_channel))
{
- Dictionary data = ExtractMsg(inputLine);
+ Dictionary data = ExtractMsg(inputLine);
// Any chat ???
if (data != null)
{
foreach (Scene m_scene in m_scenes)
{
m_scene.ForEachScenePresence(delegate(ScenePresence avatar)
+ {
+ if (!avatar.IsChildAgent)
{
- if (!avatar.IsChildAgent)
- {
- avatar.ControllingClient.SendChatMessage(
- Helpers.StringToField(data["msg"]), 255,
- pos, data["nick"],
- LLUUID.Zero);
- }
- });
+ avatar.ControllingClient.SendChatMessage(
+ Helpers.StringToField(data["msg"]), 255,
+ pos, data["nick"],
+ LLUUID.Zero);
+ }
+ });
}
@@ -584,24 +580,24 @@ namespace OpenSim.Region.Environment.Modules
// Was an command from the IRC server
ProcessIRCCommand(inputLine);
}
- }
+ }
else
{
// Was an command from the IRC server
ProcessIRCCommand(inputLine);
}
Thread.Sleep(150);
- }
- }
- catch (IOException)
- {
- m_log.Error("IRC", "ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
- Reconnect();
- }
- catch (Exception ex)
- {
- m_log.Error("IRC", "ListenerRun exception trap:" + ex.ToString()+"\n"+ex.StackTrace);
}
+ }
+ catch (IOException)
+ {
+ m_log.Error("[IRC]: ListenerRun IOException. Disconnected from IRC server ??? (ListenerRun)");
+ Reconnect();
+ }
+ catch (Exception ex)
+ {
+ m_log.Error("[IRC]: ListenerRun exception trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ }
}
}
@@ -626,27 +622,27 @@ namespace OpenSim.Region.Environment.Modules
}
catch (Exception ex) // IRC gate should not crash Sim
{
- m_log.Error("IRC", "BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace);
+ m_log.Error("[IRC]: BroadcastSim Exception Trap:" + ex.ToString() + "\n" + ex.StackTrace);
}
-
-
}
+
public enum ErrorReplies
{
NotRegistered = 451, // ":You have not registered"
NicknameInUse = 433 // " :Nickname is already in use"
}
+
public enum Replies
{
MotdStart = 375, // ":- Message of the day - "
Motd = 372, // ":- "
EndOfMotd = 376 // ":End of /MOTD command"
-
}
+
public void ProcessIRCCommand(string command)
{
- //m_log.Verbose("IRC", "ProcessIRCCommand:"+command);
+ //m_log.Info("[IRC]: ProcessIRCCommand:" + command);
string[] commArgs = new string[command.Split(' ').Length];
string c_server = m_server;
@@ -656,6 +652,7 @@ namespace OpenSim.Region.Environment.Modules
{
commArgs[0] = commArgs[0].Remove(0, 1);
}
+
if (commArgs[1] == "002")
{
// fetch the correct servername
@@ -668,7 +665,7 @@ namespace OpenSim.Region.Environment.Modules
if (commArgs[0] == "ERROR")
{
- m_log.Error("IRC", "IRC SERVER ERROR:" + command);
+ m_log.Error("[IRC]: IRC SERVER ERROR:" + command);
}
if (commArgs[0] == "PING")
@@ -695,7 +692,7 @@ namespace OpenSim.Region.Environment.Modules
case (int)ErrorReplies.NicknameInUse:
// Gen a new name
m_nick = m_basenick + Util.RandomClass.Next(1, 99);
- m_log.Error("IRC", "IRC SERVER reports NicknameInUse, trying " + m_nick);
+ m_log.Error("[IRC]: IRC SERVER reports NicknameInUse, trying " + m_nick);
// Retry
m_writer.WriteLine("NICK " + m_nick);
m_writer.Flush();
diff --git a/OpenSim/Region/Environment/Modules/FriendsModule.cs b/OpenSim/Region/Environment/Modules/FriendsModule.cs
index fec28a8..3c324a4 100644
--- a/OpenSim/Region/Environment/Modules/FriendsModule.cs
+++ b/OpenSim/Region/Environment/Modules/FriendsModule.cs
@@ -40,8 +40,7 @@ namespace OpenSim.Region.Environment.Modules
{
public class FriendsModule : IRegionModule
{
-
- private LogBase m_log;
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
private Scene m_scene;
@@ -49,7 +48,6 @@ namespace OpenSim.Region.Environment.Modules
public void Initialise(Scene scene, IConfigSource config)
{
- m_log = MainLog.Instance;
m_scene = scene;
scene.EventManager.OnNewClient += OnNewClient;
scene.EventManager.OnGridInstantMessageToFriendsModule += OnGridInstantMessage;
@@ -72,6 +70,7 @@ namespace OpenSim.Region.Environment.Modules
}
+
private void OnInstantMessage(IClientAPI client,LLUUID fromAgentID,
LLUUID fromAgentSession, LLUUID toAgentID,
LLUUID imSessionID, uint timestamp, string fromAgentName,
@@ -89,13 +88,13 @@ namespace OpenSim.Region.Environment.Modules
m_pendingFriendRequests.Add(friendTransactionID, fromAgentID);
- m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
+ m_log.Info("[FRIEND]: 38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
GridInstantMessage msg = new GridInstantMessage();
msg.fromAgentID = fromAgentID.UUID;
msg.fromAgentSession = fromAgentSession.UUID;
msg.toAgentID = toAgentID.UUID;
msg.imSessionID = friendTransactionID.UUID; // This is the item we're mucking with here
- m_log.Verbose("FRIEND","Filling Session: " + msg.imSessionID.ToString());
+ m_log.Info("[FRIEND]: Filling Session: " + msg.imSessionID.ToString());
msg.timestamp = timestamp;
if (client != null)
{
@@ -115,20 +114,18 @@ namespace OpenSim.Region.Environment.Modules
msg.binaryBucket = binaryBucket;
m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
}
+
+ // 39 == Accept Friendship
if (dialog == (byte)39)
{
- m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
-
+ m_log.Info("[FRIEND]: 39 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
+
+ // 40 == Decline Friendship
if (dialog == (byte)40)
{
- m_log.Verbose("FRIEND", "38 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
+ m_log.Info("[FRIEND]: 40 - From:" + fromAgentID.ToString() + " To: " + toAgentID.ToString() + " Session:" + imSessionID.ToString() + " Message:" + message);
}
-
- // 39 == Accept Friendship
-
- // 40 == Decline Friendship
-
}
private void OnApprovedFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders)
@@ -160,6 +157,7 @@ namespace OpenSim.Region.Environment.Modules
// TODO: Inform agent that the friend is online
}
}
+
private void OnDenyFriendRequest(IClientAPI client, LLUUID agentID, LLUUID transactionID, List callingCardFolders)
{
if (m_pendingFriendRequests.ContainsKey(transactionID))
@@ -184,20 +182,15 @@ namespace OpenSim.Region.Environment.Modules
msg.binaryBucket = new byte[0];
m_scene.TriggerGridInstantMessage(msg, InstantMessageReceiver.IMModule);
m_pendingFriendRequests.Remove(transactionID);
-
}
-
-
}
private void OnTerminateFriendship(IClientAPI client, LLUUID agent, LLUUID exfriendID)
{
m_scene.StoreRemoveFriendship(agent, exfriendID);
// TODO: Inform the client that the ExFriend is offline
-
}
-
private void OnGridInstantMessage(GridInstantMessage msg)
{
// Trigger the above event handler
@@ -206,16 +199,12 @@ namespace OpenSim.Region.Environment.Modules
msg.message, msg.dialog, msg.fromGroup, msg.offline, msg.ParentEstateID,
new LLVector3(msg.Position.x, msg.Position.y, msg.Position.z), new LLUUID(msg.RegionID),
msg.binaryBucket);
-
}
-
public void PostInitialise()
{
}
-
-
public void Close()
{
}
@@ -230,4 +219,4 @@ namespace OpenSim.Region.Environment.Modules
get { return false; }
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
index f5eb052..e0b3138 100644
--- a/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
+++ b/OpenSim/Region/Environment/Modules/InstantMessageModule.cs
@@ -39,12 +39,6 @@ namespace OpenSim.Region.Environment.Modules
public class InstantMessageModule : IRegionModule
{
private List m_scenes = new List();
- private LogBase m_log;
-
- public InstantMessageModule()
- {
- m_log = MainLog.Instance;
- }
public void Initialise(Scene scene, IConfigSource config)
{
@@ -68,7 +62,6 @@ namespace OpenSim.Region.Environment.Modules
uint ParentEstateID, LLVector3 Position, LLUUID RegionID,
byte[] binaryBucket)
{
-
bool FriendDialog = ((dialog == (byte)38) || (dialog == (byte)39) || (dialog == (byte)40));
// IM dialogs need to be pre-processed and have their sessionID filled by the server
diff --git a/OpenSim/Region/Environment/Modules/SunModule.cs b/OpenSim/Region/Environment/Modules/SunModule.cs
index bd6cd63..d2572c0 100644
--- a/OpenSim/Region/Environment/Modules/SunModule.cs
+++ b/OpenSim/Region/Environment/Modules/SunModule.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Modules
{
public class SunModule : IRegionModule
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private const double m_real_day = 24.0;
private const int m_default_frame = 100;
private int m_frame_mod;
@@ -48,7 +50,6 @@ namespace OpenSim.Region.Environment.Modules
private long m_start;
private Scene m_scene;
- private LogBase m_log;
public void Initialise(Scene scene, IConfigSource config)
{
@@ -69,7 +70,6 @@ namespace OpenSim.Region.Environment.Modules
m_dilation = (int) (m_real_day/m_day_length);
m_scene = scene;
- m_log = MainLog.Instance;
scene.EventManager.OnFrame += SunUpdate;
scene.EventManager.OnNewClient += SunToClient;
}
@@ -104,7 +104,7 @@ namespace OpenSim.Region.Environment.Modules
m_frame++;
return;
}
- // m_log.Verbose("SUN","I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay());
+ // m_log.Info("[SUN]: I've got an update {0} => {1}", m_scene.RegionsInfo.RegionName, HourOfTheDay());
List avatars = m_scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
{
@@ -191,4 +191,4 @@ namespace OpenSim.Region.Environment.Modules
// // OutPacket(viewertime);
// }
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/Modules/TextureSender.cs b/OpenSim/Region/Environment/Modules/TextureSender.cs
index a533078..053a558 100644
--- a/OpenSim/Region/Environment/Modules/TextureSender.cs
+++ b/OpenSim/Region/Environment/Modules/TextureSender.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Region.Environment.Modules
{
public class TextureSender
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public int counter = 0;
private AssetBase m_asset;
public long DataPointer = 0;
@@ -135,9 +137,8 @@ namespace OpenSim.Region.Environment.Modules
}
catch (ArgumentOutOfRangeException)
{
- MainLog.Instance.Error("TEXTURE",
- "Unable to separate texture into multiple packets: Array bounds failure on asset:" +
- m_asset.FullID.ToString() );
+ m_log.Error("[TEXTURE]: Unable to separate texture into multiple packets: Array bounds failure on asset:" +
+ m_asset.FullID.ToString() );
return;
}
RequestUser.OutPacket(im, ThrottleOutPacketType.Texture);
diff --git a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
index 76c6a53..762e76d 100644
--- a/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
+++ b/OpenSim/Region/Environment/Modules/XMLRPCModule.cs
@@ -75,6 +75,8 @@ namespace OpenSim.Region.Environment.Modules
{
public class XMLRPCModule : IRegionModule, IXMLRPC
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private Scene m_scene;
private Queue rpcQueue = new Queue();
private object XMLRPCListLock = new object();
@@ -83,7 +85,6 @@ namespace OpenSim.Region.Environment.Modules
private int RemoteReplyScriptTimeout = 900;
private int m_remoteDataPort = 0;
private List m_scenes = new List();
- private LogBase m_log;
//
private Dictionary m_openChannels;
@@ -91,11 +92,6 @@ namespace OpenSim.Region.Environment.Modules
//
private Dictionary m_pendingResponse;
- public XMLRPCModule()
- {
- m_log = MainLog.Instance;
- }
-
public void Initialise(Scene scene, IConfigSource config)
{
try
@@ -123,8 +119,8 @@ namespace OpenSim.Region.Environment.Modules
// Start http server
// Attach xmlrpc handlers
- m_log.Verbose("REMOTE_DATA",
- "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
+ m_log.Info("[REMOTE_DATA]: " +
+ "Starting XMLRPC Server on port " + m_remoteDataPort + " for llRemoteData commands.");
BaseHttpServer httpServer = new BaseHttpServer((uint) m_remoteDataPort);
httpServer.AddXmlRPCHandler("llRemoteData", XmlRpcRemoteData);
httpServer.Start();
@@ -413,4 +409,4 @@ namespace OpenSim.Region.Environment.Modules
return m_localID;
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
index 18a87cb..daaa319 100644
--- a/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
+++ b/OpenSim/Region/Environment/Scenes/AvatarAnimations.cs
@@ -35,6 +35,8 @@ namespace OpenSim.Region.Environment.Scenes
{
public class AvatarAnimations
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public Dictionary AnimsLLUUID = new Dictionary();
public Dictionary AnimsNames = new Dictionary();
@@ -44,7 +46,7 @@ namespace OpenSim.Region.Environment.Scenes
public void LoadAnims()
{
- //MainLog.Instance.Verbose("CLIENT", "Loading avatar animations");
+ //m_log.Info("[CLIENT]: Loading avatar animations");
using (XmlTextReader reader = new XmlTextReader("data/avataranimations.xml"))
{
XmlDocument doc = new XmlDocument();
@@ -58,7 +60,7 @@ namespace OpenSim.Region.Environment.Scenes
}
}
- // MainLog.Instance.Verbose("CLIENT", "Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
+ // m_log.Info("[CLIENT]: Loaded " + AnimsLLUUID.Count.ToString() + " animation(s)");
try
{
@@ -70,7 +72,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (InvalidOperationException)
{
- MainLog.Instance.Warn("AVATAR", "Unable to load animation names for an Avatar");
+ m_log.Warn("[AVATAR]: Unable to load animation names for an Avatar");
}
}
}
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 6c0ed28..49aeaf9 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Region.Environment.Scenes
public class InnerScene
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
#region Events
public event PhysicsCrash UnRecoverableError;
@@ -227,13 +229,13 @@ namespace OpenSim.Region.Environment.Scenes
if (child)
{
m_numChildAgents++;
- MainLog.Instance.Verbose("SCENE", m_regInfo.RegionName + ": Creating new child agent.");
+ m_log.Info("[SCENE]: " + m_regInfo.RegionName + ": Creating new child agent.");
}
else
{
m_numRootAgents++;
- MainLog.Instance.Verbose("SCENE", m_regInfo.RegionName + ": Creating new root agent.");
- MainLog.Instance.Verbose("SCENE", m_regInfo.RegionName + ": Adding Physical agent.");
+ m_log.Info("[SCENE]: " + m_regInfo.RegionName + ": Creating new root agent.");
+ m_log.Info("[SCENE]: " + m_regInfo.RegionName + ": Adding Physical agent.");
newAvatar.AddToPhysicalScene();
}
@@ -542,7 +544,7 @@ namespace OpenSim.Region.Environment.Scenes
LLVector3 oLoc = ((SceneObjectGroup)ent).AbsolutePosition;
float distResult = (float)Util.GetDistanceTo(presence.AbsolutePosition,oLoc);
- //MainLog.Instance.Verbose("DISTANCE", distResult.ToString());
+ //m_log.Info("[DISTANCE]: " + distResult.ToString());
if (distResult > 60)
{
@@ -897,9 +899,9 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Verbose("SCENE",
+ m_log.Info(String.Format("[SCENE]: " +
"DelinkObjects(): Could not find a root prim out of {0} as given to a delink request!",
- primIds);
+ primIds));
}
}
@@ -947,7 +949,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Warn("SCENE", "Attempted to duplicate nonexistant prim id {0}", GroupID);
+ m_log.Warn(String.Format("[SCENE]: Attempted to duplicate nonexistant prim id {0}", GroupID));
}
}
diff --git a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
index 81783f8..28760fd 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.Inventory.cs
@@ -26,6 +26,7 @@
*
*/
+using System;
using System.Collections.Generic;
using libsecondlife;
using libsecondlife.Packets;
@@ -37,12 +38,14 @@ namespace OpenSim.Region.Environment.Scenes
{
public partial class Scene
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
///
/// Start all the scripts in the scene which should be started.
///
public void StartScripts()
{
- MainLog.Instance.Verbose("PRIMINVENTORY", "Starting scripts in scene");
+ m_log.Info("[PRIMINVENTORY]: Starting scripts in scene");
foreach (SceneObjectGroup group in Entities.Values)
{
@@ -80,8 +83,8 @@ namespace OpenSim.Region.Environment.Scenes
if (!TryGetAvatar(avatarId, out avatar))
{
- MainLog.Instance.Error(
- "AGENTINVENTORY", "Could not find avatar {0} to add inventory item", avatarId);
+ m_log.Error(String.Format(
+ "[AGENTINVENTORY]: Could not find avatar {0} to add inventory item", avatarId));
return;
}
@@ -143,10 +146,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "AGENTINVENTORY",
- "Avatar {0} cannot be found to update its inventory item asset",
- avatarId);
+ m_log.Error(String.Format(
+ "[AGENTINVENTORY]: " +
+ "Avatar {0} cannot be found to update its inventory item asset",
+ avatarId));
}
return LLUUID.Zero;
@@ -168,10 +171,10 @@ namespace OpenSim.Region.Environment.Scenes
SceneObjectGroup group = part.ParentGroup;
if (null == group)
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
- itemId, primId);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Prim inventory update requested for item ID {0} in prim ID {1} but this prim does not exist",
+ itemId, primId));
return;
}
@@ -217,10 +220,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Avatar {0} cannot be found to update its prim item asset",
- avatarId);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Avatar {0} cannot be found to update its prim item asset",
+ avatarId));
}
}
@@ -289,16 +292,14 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "AGENTINVENTORY",
- "Item ID " + itemID + " not found for an inventory item update.");
+ m_log.Error(
+ "[AGENTINVENTORY]: Item ID " + itemID + " not found for an inventory item update.");
}
}
else
{
- MainLog.Instance.Error(
- "AGENTINVENTORY",
- "Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
+ m_log.Error(
+ "[AGENTINVENTORY]: Agent ID " + remoteClient.AgentId + " not found for an inventory item update.");
}
}
@@ -311,7 +312,7 @@ namespace OpenSim.Region.Environment.Scenes
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(oldAgentID);
if (userInfo == null)
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find user " + oldAgentID.ToString());
+ m_log.Error("[AGENTINVENTORY]: Failed to find user " + oldAgentID.ToString());
return;
}
@@ -320,13 +321,13 @@ namespace OpenSim.Region.Environment.Scenes
item = userInfo.RootFolder.HasItem(oldItemID);
if (item == null)
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString());
+ m_log.Error("[AGENTINVENTORY]: Failed to find item " + oldItemID.ToString());
return;
}
}
else
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + oldItemID.ToString());
+ m_log.Error("[AGENTINVENTORY]: Failed to find item " + oldItemID.ToString());
return;
}
}
@@ -335,7 +336,7 @@ namespace OpenSim.Region.Environment.Scenes
AssetBase asset = AssetCache.CopyAsset(item.assetID);
if (asset == null)
{
- MainLog.Instance.Warn("AGENTINVENTORY", "Failed to find asset " + item.assetID.ToString());
+ m_log.Warn("[AGENTINVENTORY]: Failed to find asset " + item.assetID.ToString());
return;
}
@@ -360,14 +361,14 @@ namespace OpenSim.Region.Environment.Scenes
public void MoveInventoryItem(IClientAPI remoteClient, LLUUID folderID, LLUUID itemID, int length,
string newName)
{
- MainLog.Instance.Verbose(
- "AGENTINVENTORY",
+ m_log.Info(
+ "[AGENTINVENTORY]: " +
"Moving item for " + remoteClient.AgentId.ToString());
CachedUserInfo userInfo = CommsManager.UserProfileCacheService.GetUserDetails(remoteClient.AgentId);
if (userInfo == null)
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find user " + remoteClient.AgentId.ToString());
+ m_log.Error("[AGENTINVENTORY]: Failed to find user " + remoteClient.AgentId.ToString());
return;
}
@@ -388,13 +389,13 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + itemID.ToString());
+ m_log.Error("[AGENTINVENTORY]: Failed to find item " + itemID.ToString());
return;
}
}
else
{
- MainLog.Instance.Error("AGENTINVENTORY", "Failed to find item " + itemID.ToString() + ", no root folder");
+ m_log.Error("[AGENTINVENTORY]: Failed to find item " + itemID.ToString() + ", no root folder");
return;
}
}
@@ -497,8 +498,8 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY", "Inventory requested of prim {0} which doesn't exist", primLocalID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: Inventory requested of prim {0} which doesn't exist", primLocalID));
}
}
@@ -523,11 +524,11 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Removal of item {0} requested of prim {1} but this prim does not exist",
- itemID,
- localID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Removal of item {0} requested of prim {1} but this prim does not exist",
+ itemID,
+ localID));
}
}
@@ -547,18 +548,18 @@ namespace OpenSim.Region.Environment.Scenes
{
// TODO Retrieve itemID from client's inventory to pass on
//group.AddInventoryItem(remoteClient, primLocalID, null);
- MainLog.Instance.Verbose(
- "PRIMINVENTORY",
- "Non script prim inventory not yet implemented!"
- + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
- itemID, folderID, primLocalID, remoteClient.Name);
+ m_log.Info(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Non script prim inventory not yet implemented!"
+ + "\nUpdateTaskInventory called with item {0}, folder {1}, primLocalID {2}, user {3}",
+ itemID, folderID, primLocalID, remoteClient.Name));
}
else
{
- MainLog.Instance.Warn(
- "PRIMINVENTORY",
- "Update with item {0} requested of prim {1} for {2} but this prim does not exist",
- itemID, primLocalID, remoteClient.Name);
+ m_log.Warn(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Update with item {0} requested of prim {1} for {2} but this prim does not exist",
+ itemID, primLocalID, remoteClient.Name));
}
}
@@ -596,25 +597,25 @@ namespace OpenSim.Region.Environment.Scenes
group.StartScript(localID, copyID);
group.GetProperites(remoteClient);
- // MainLog.Instance.Verbose(
- // "PRIMINVENTORY",
- // "Rezzed script {0} into prim local ID {1} for user {2}",
- // item.inventoryName, localID, remoteClient.Name);
+ // m_log.Info(
+ // String.Format("[PRIMINVENTORY]: " +
+ // "Rezzed script {0} into prim local ID {1} for user {2}",
+ // item.inventoryName, localID, remoteClient.Name));
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Could not rez script {0} into prim local ID {1} for user {2}"
- + " because the prim could not be found in the region!",
- item.inventoryName, localID, remoteClient.Name);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Could not rez script {0} into prim local ID {1} for user {2}"
+ + " because the prim could not be found in the region!",
+ item.inventoryName, localID, remoteClient.Name));
}
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY", "Could not find script inventory item {0} to rez for {1}!",
- itemID, remoteClient.Name);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: Could not find script inventory item {0} to rez for {1}!",
+ itemID, remoteClient.Name));
}
}
}
@@ -646,7 +647,7 @@ namespace OpenSim.Region.Environment.Scenes
foreach (DeRezObjectPacket.ObjectDataBlock Data in DeRezPacket.ObjectData)
{
EntityBase selectedEnt = null;
- //MainLog.Instance.Verbose("CLIENT", "LocalID:" + Data.ObjectLocalID.ToString());
+ //m_log.Info("[CLIENT]: LocalID:" + Data.ObjectLocalID.ToString());
List EntitieList = GetEntities();
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 1d688e3..a724ac0 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -270,12 +270,12 @@ namespace OpenSim.Region.Environment.Scenes
RegisterDefaultSceneEvents();
- MainLog.Instance.Verbose("SCENE", "Creating new entitities instance");
+ m_log.Info("[SCENE]: Creating new entitities instance");
Entities = new Dictionary();
m_scenePresences = new Dictionary();
//m_sceneObjects = new Dictionary();
- MainLog.Instance.Verbose("SCENE", "Creating LandMap");
+ m_log.Info("[SCENE]: Creating LandMap");
Terrain = new TerrainEngine((int) RegionInfo.RegionLocX, (int) RegionInfo.RegionLocY);
ScenePresence.LoadAnims();
@@ -365,16 +365,14 @@ namespace OpenSim.Region.Environment.Scenes
{
// This means that we're not booted up completely yet.
// This shouldn't happen too often anymore.
- MainLog.Instance.Error("SCENE",
- "Couldn't inform client of regionup because we got a null reference exception");
+ m_log.Error("[SCENE]: Couldn't inform client of regionup because we got a null reference exception");
}
}
else
{
- MainLog.Instance.Verbose("INTERGRID",
- "Got notice about far away Region: " + otherRegion.RegionName.ToString() +
- " at (" + otherRegion.RegionLocX.ToString() + ", " +
- otherRegion.RegionLocY.ToString() + ")");
+ m_log.Info("[INTERGRID]: Got notice about far away Region: " + otherRegion.RegionName.ToString() +
+ " at (" + otherRegion.RegionLocX.ToString() + ", " +
+ otherRegion.RegionLocY.ToString() + ")");
}
}
return true;
@@ -402,7 +400,7 @@ namespace OpenSim.Region.Environment.Scenes
m_RestartTimerCounter = 0;
m_restartTimer.AutoReset = true;
m_restartTimer.Elapsed += new ElapsedEventHandler(RestartTimer_Elapsed);
- MainLog.Instance.Error("REGION", "Restarting Region in " + (seconds/60) + " minutes");
+ m_log.Error("[REGION]: Restarting Region in " + (seconds/60) + " minutes");
m_restartTimer.Start();
SendRegionMessageFromEstateTools(LLUUID.Random(), LLUUID.Random(), String.Empty, RegionInfo.RegionName + ": Restarting in 2 Minutes");
//SendGeneralAlert(RegionInfo.RegionName + ": Restarting in 2 Minutes");
@@ -436,9 +434,9 @@ namespace OpenSim.Region.Environment.Scenes
// This causes the region to restart immediatley.
public void RestartNow()
{
- MainLog.Instance.Error("REGION", "Closing");
+ m_log.Error("[REGION]: Closing");
Close();
- MainLog.Instance.Error("REGION", "Firing Region Restart Message");
+ m_log.Error("[REGION]: Firing Region Restart Message");
base.Restart(0);
}
@@ -485,7 +483,7 @@ namespace OpenSim.Region.Environment.Scenes
if (m_scripts_enabled != !ScriptEngine)
{
// Tedd! Here's the method to disable the scripting engine!
- MainLog.Instance.Verbose("TOTEDD", "Here is the method to trigger disabling of the scripting engine");
+ m_log.Info("[TOTEDD]: Here is the method to trigger disabling of the scripting engine");
}
if (m_physics_enabled != !PhysicsEngine)
{
@@ -498,7 +496,7 @@ namespace OpenSim.Region.Environment.Scenes
// This is the method that shuts down the scene.
public override void Close()
{
- MainLog.Instance.Warn("SCENE", "Closing down the single simulator: " + RegionInfo.RegionName);
+ m_log.Warn("[SCENE]: Closing down the single simulator: " + RegionInfo.RegionName);
// Kick all ROOT agents with the message, 'The simulator is going down'
ForEachScenePresence(delegate(ScenePresence avatar)
{
@@ -543,7 +541,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void StartTimer()
{
- MainLog.Instance.Debug("SCENE", "Starting timer");
+ m_log.Debug("[SCENE]: Starting timer");
m_heartbeatTimer.Enabled = true;
m_heartbeatTimer.Interval = (int) (m_timespan*1000);
m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
@@ -649,7 +647,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Error("Scene", "Failed with exception " + e.ToString());
+ m_log.Error("[Scene]: Failed with exception " + e.ToString());
}
finally
{
@@ -848,7 +846,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (string.IsNullOrEmpty(m_regInfo.EstateSettings.terrainFile))
{
- MainLog.Instance.Verbose("TERRAIN", "No default terrain. Generating a new terrain.");
+ m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
Terrain.SetDefaultTerrain();
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
@@ -862,8 +860,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch
{
- MainLog.Instance.Verbose("TERRAIN",
- "No terrain found in database or default. Generating a new terrain.");
+ m_log.Info("[TERRAIN]: No terrain found in database or default. Generating a new terrain.");
Terrain.SetDefaultTerrain();
}
m_storageManager.DataStore.StoreTerrain(Terrain.GetHeights2DD(), RegionInfo.RegionID);
@@ -879,7 +876,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Warn("terrain", "Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
+ m_log.Warn("[terrain]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
}
}
@@ -894,12 +891,12 @@ namespace OpenSim.Region.Environment.Scenes
{
if (dGridSettings["allow_forceful_banlines"] != "TRUE")
{
- MainLog.Instance.Verbose("GRID", "Grid is disabling forceful parcel banlists");
+ m_log.Info("[GRID]: Grid is disabling forceful parcel banlists");
m_LandManager.allowedForcefulBans = false;
}
else
{
- MainLog.Instance.Verbose("GRID", "Grid is allowing forceful parcel banlists");
+ m_log.Info("[GRID]: Grid is allowing forceful parcel banlists");
m_LandManager.allowedForcefulBans = true;
}
}
@@ -929,7 +926,7 @@ namespace OpenSim.Region.Environment.Scenes
public void loadAllLandObjectsFromStorage()
{
- MainLog.Instance.Verbose("SCENE", "Loading land objects from storage");
+ m_log.Info("[SCENE]: Loading land objects from storage");
List landData = m_storageManager.DataStore.LoadLandObjects(RegionInfo.RegionID);
if (landData.Count == 0)
@@ -951,7 +948,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public virtual void LoadPrimsFromStorage(bool m_permissions)
{
- MainLog.Instance.Verbose("SCENE", "Loading objects from datastore");
+ m_log.Info("[SCENE]: Loading objects from datastore");
List PrimsFromDB = m_storageManager.DataStore.LoadObjects(m_regInfo.RegionID);
foreach (SceneObjectGroup group in PrimsFromDB)
@@ -964,7 +961,7 @@ namespace OpenSim.Region.Environment.Scenes
//rootPart.DoPhysicsPropertyUpdate(UsePhysics, true);
}
- MainLog.Instance.Verbose("SCENE", "Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
+ m_log.Info("[SCENE]: Loaded " + PrimsFromDB.Count.ToString() + " SceneObject(s)");
}
@@ -999,7 +996,7 @@ namespace OpenSim.Region.Environment.Scenes
{
pos = target.AbsolutePosition;
- //MainLog.Instance.Verbose("RAYTRACE", pos.ToString());
+ //m_log.Info("[RAYTRACE]: " + pos.ToString());
//EntityIntersection rayTracing = null;
//ScenePresence presence = ((ScenePresence)GetScenePresence(ownerID));
//if (presence != null)
@@ -1038,14 +1035,10 @@ namespace OpenSim.Region.Environment.Scenes
//Vector3 RezPoint = Newpos;
- //MainLog.Instance.Verbose("REZINFO", "Possible Rez Point:" + RezPoint.ToString());
+ //m_log.Info("[REZINFO]: Possible Rez Point:" + RezPoint.ToString());
//pos = new LLVector3(RezPoint.x, RezPoint.y, RezPoint.z);
//}
-
-
-
-
return pos;
}
else
@@ -1061,18 +1054,14 @@ namespace OpenSim.Region.Environment.Scenes
pos = RayEnd;
return pos;
}
-
}
public virtual void AddNewPrim(LLUUID ownerID, LLVector3 RayEnd, LLQuaternion rot, PrimitiveBaseShape shape,
- byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
- byte RayEndIsIntersection)
+ byte bypassRaycast, LLVector3 RayStart, LLUUID RayTargetID,
+ byte RayEndIsIntersection)
{
LLVector3 pos = GetNewRezLocation(RayStart, RayEnd, RayTargetID, rot, bypassRaycast, RayEndIsIntersection);
-
-
-
if (PermissionsMngr.CanRezObject(ownerID, pos))
{
// rez ON the ground, not IN the ground
@@ -1364,7 +1353,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Error("Scene.cs:RemoveClient exception: " + e.ToString());
+ m_log.Error("Scene.cs:RemoveClient exception: " + e.ToString());
}
// Remove client agent from profile, so new logins will work
@@ -1474,7 +1463,7 @@ namespace OpenSim.Region.Environment.Scenes
if (m_capsHandlers.ContainsKey(agent.AgentID))
{
- //MainLog.Instance.Warn("client", "Adding duplicate CAPS entry for user " +
+ //m_log.Warn("[client]: Adding duplicate CAPS entry for user " +
// agent.AgentID.ToString());
try
{
@@ -1514,8 +1503,8 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Verbose("SCENE", "Unable to do Agent Crossing.");
- MainLog.Instance.Debug("SCENE", e.ToString());
+ m_log.Info("[SCENE]: Unable to do Agent Crossing.");
+ m_log.Debug("[SCENE]: " + e.ToString());
}
//m_innerScene.SwapRootChildAgent(false);
}
@@ -2158,14 +2147,14 @@ namespace OpenSim.Region.Environment.Scenes
switch (showWhat)
{
case "users":
- MainLog.Instance.Error("Current Region: " + RegionInfo.RegionName);
- MainLog.Instance.Error(
+ m_log.Error("Current Region: " + RegionInfo.RegionName);
+ m_log.Error(
String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16}{5,-16}{6,-16}", "Firstname", "Lastname",
"Agent ID", "Session ID", "Circuit", "IP", "World"));
foreach (ScenePresence scenePrescence in GetAvatars())
{
- MainLog.Instance.Error(
+ m_log.Error(
String.Format("{0,-16}{1,-16}{2,-25}{3,-25}{4,-16},{5,-16}{6,-16}",
scenePrescence.Firstname,
scenePrescence.Lastname,
@@ -2177,12 +2166,12 @@ namespace OpenSim.Region.Environment.Scenes
}
break;
case "modules":
- MainLog.Instance.Error("The currently loaded modules in " + RegionInfo.RegionName + " are:");
+ m_log.Error("The currently loaded modules in " + RegionInfo.RegionName + " are:");
foreach (IRegionModule module in Modules.Values)
{
if (!module.IsSharedModule)
{
- MainLog.Instance.Error("Region Module: " + module.Name);
+ m_log.Error("Region Module: " + module.Name);
}
}
break;
@@ -2250,11 +2239,10 @@ namespace OpenSim.Region.Environment.Scenes
///
///
///
- ///
- public void AddScriptEngine(ScriptEngineInterface scriptEngine, LogBase logger)
+ public void AddScriptEngine(ScriptEngineInterface scriptEngine)
{
ScriptEngines.Add(scriptEngine);
- scriptEngine.InitializeEngine(this, logger);
+ scriptEngine.InitializeEngine(this);
}
public void TriggerObjectChanged(uint localID, uint change)
@@ -2372,7 +2360,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Verbose("BUG", e.ToString());
+ m_log.Info("[BUG]: " + e.ToString());
}
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneBase.cs b/OpenSim/Region/Environment/Scenes/SceneBase.cs
index d4a4bb0..2e95322 100644
--- a/OpenSim/Region/Environment/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneBase.cs
@@ -36,6 +36,8 @@ namespace OpenSim.Region.Environment.Scenes
{
public abstract class SceneBase : IScene
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
#region Events
public event restart OnRestart;
@@ -155,7 +157,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public virtual void Restart(int seconds)
{
- MainLog.Instance.Error("REGION", "passing Restart Message up the namespace");
+ m_log.Error("[REGION]: passing Restart Message up the namespace");
OnRestart(RegionInfo);
}
@@ -180,7 +182,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (Exception e)
{
- MainLog.Instance.Error("SCENE", "SceneBase.cs: Close() - Failed with exception " + e.ToString());
+ m_log.Error("[SCENE]: SceneBase.cs: Close() - Failed with exception " + e.ToString());
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index 2bb36a3..a89b52c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Region.Environment.Scenes
public class SceneCommunicationService //one instance per region
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
protected CommunicationsManager m_commsProvider;
protected RegionInfo m_regionInfo;
@@ -77,7 +79,7 @@ namespace OpenSim.Region.Environment.Scenes
if (regionCommsHost != null)
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got" + regionCommsHost.ToString());
regionCommsHost.debugRegionName = _debugRegionName;
@@ -91,7 +93,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: registered with gridservice and got null");
}
}
@@ -122,7 +124,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (OnExpectUser != null)
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: OnExpectUser Fired for User:" + agent.firstname + " " + agent.lastname);
OnExpectUser(regionHandle, agent);
}
}
@@ -131,7 +133,7 @@ namespace OpenSim.Region.Environment.Scenes
{
if (OnRegionUp != null)
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName);
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: newRegionUp Fired for User:" + region.RegionName);
OnRegionUp(region);
}
return true;
@@ -164,7 +166,7 @@ namespace OpenSim.Region.Environment.Scenes
protected bool CloseConnection(ulong regionHandle, LLUUID agentID)
{
- MainLog.Instance.Verbose("INTERREGION", "Incoming Agent Close Request for agent: " + agentID.ToString());
+ m_log.Info("[INTERREGION]: Incoming Agent Close Request for agent: " + agentID.ToString());
if (OnCloseAgentConnection != null)
{
@@ -199,14 +201,14 @@ namespace OpenSim.Region.Environment.Scenes
private void InformClientOfNeighbourAsync(ScenePresence avatar, AgentCircuitData a, ulong regionHandle,
IPEndPoint endPoint)
{
- MainLog.Instance.Notice("INTERGRID", "Starting to inform client about neighbours");
+ m_log.Info("[INTERGRID]: Starting to inform client about neighbours");
bool regionAccepted = m_commsProvider.InterRegion.InformRegionOfChildAgent(regionHandle, a);
if (regionAccepted)
{
avatar.ControllingClient.InformClientOfNeighbour(regionHandle, endPoint);
avatar.AddNeighbourRegion(regionHandle);
- MainLog.Instance.Notice("INTERGRID", "Completed inform client about neighbours");
+ m_log.Info("[INTERGRID]: Completed inform client about neighbours");
}
}
@@ -291,17 +293,17 @@ namespace OpenSim.Region.Environment.Scenes
private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle)
{
- MainLog.Instance.Notice("INTERGRID", "Starting to inform neighbors that I'm here");
+ m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here");
bool regionAccepted =
m_commsProvider.InterRegion.RegionUp((new SearializableRegionInfo(region)), regionhandle);
if (regionAccepted)
{
- MainLog.Instance.Notice("INTERGRID", "Completed informing neighbors that I'm here");
+ m_log.Info("[INTERGRID]: Completed informing neighbors that I'm here");
}
else
{
- MainLog.Instance.Notice("INTERGRID", "Failed to inform neighbors that I'm here");
+ m_log.Info("[INTERGRID]: Failed to inform neighbors that I'm here");
}
}
@@ -311,7 +313,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void InformNeighborsThatRegionisUp(RegionInfo region)
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
List neighbours = new List();
@@ -343,7 +345,7 @@ namespace OpenSim.Region.Environment.Scenes
///
private void SendChildAgentDataUpdateAsync(ChildAgentDataUpdate cAgentData, ScenePresence presence)
{
- //MainLog.Instance.Notice("INTERGRID", "Informing neighbors about my agent.");
+ //m_log.Info("[INTERGRID]: Informing neighbors about my agent.");
try
{
foreach (ulong regionHandle in presence.KnownChildRegions)
@@ -352,11 +354,11 @@ namespace OpenSim.Region.Environment.Scenes
if (regionAccepted)
{
- //MainLog.Instance.Notice("INTERGRID", "Completed sending a neighbor an update about my agent");
+ //m_log.Info("[INTERGRID]: Completed sending a neighbor an update about my agent");
}
else
{
- //MainLog.Instance.Notice("INTERGRID", "Failed sending a neighbor an update about my agent");
+ //m_log.Info("[INTERGRID]: Failed sending a neighbor an update about my agent");
}
}
}
@@ -397,12 +399,12 @@ namespace OpenSim.Region.Environment.Scenes
if (regionAccepted)
{
- MainLog.Instance.Notice("INTERGRID", "Completed sending agent Close agent Request to neighbor");
+ m_log.Info("[INTERGRID]: Completed sending agent Close agent Request to neighbor");
presence.RemoveNeighbourRegion(regionHandle);
}
else
{
- MainLog.Instance.Notice("INTERGRID", "Failed sending agent Close agent Request to neighbor");
+ m_log.Info("[INTERGRID]: Failed sending agent Close agent Request to neighbor");
}
@@ -431,7 +433,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public virtual RegionInfo RequestNeighbouringRegionInfo(ulong regionHandle)
{
- //MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionHandle.ToString());
+ //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending Grid Services Request about neighbor " + regionHandle.ToString());
return m_commsProvider.GridService.RequestNeighbourInfo(regionHandle);
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneManager.cs b/OpenSim/Region/Environment/Scenes/SceneManager.cs
index 1eac61b..7156428 100644
--- a/OpenSim/Region/Environment/Scenes/SceneManager.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneManager.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Environment.Scenes
public class SceneManager
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public event RestartSim OnRestartSim;
private readonly List m_localScenes;
@@ -98,8 +100,7 @@ namespace OpenSim.Region.Environment.Scenes
public void HandleRestart(RegionInfo rdata)
{
- MainLog.Instance.Error("SCENEMANAGER",
- "Got Restart message for region:" + rdata.RegionName + " Sending up to main");
+ m_log.Error("[SCENEMANAGER]: Got Restart message for region:" + rdata.RegionName + " Sending up to main");
int RegionSceneElement = -1;
for (int i = 0; i < m_localScenes.Count; i++)
{
@@ -146,7 +147,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error("REGION", "Unable to notify Other regions of this Region coming up");
+ m_log.Error("[REGION]: Unable to notify Other regions of this Region coming up");
}
}
@@ -285,29 +286,29 @@ namespace OpenSim.Region.Environment.Scenes
return false;
}
- public void SetDebugPacketOnCurrentScene(LogBase log, int newDebug)
+ public void SetDebugPacketOnCurrentScene(int newDebug)
{
ForEachCurrentScene(delegate(Scene scene)
- {
- List EntitieList = scene.GetEntities();
+ {
+ List EntitieList = scene.GetEntities();
- foreach (EntityBase entity in EntitieList)
+ foreach (EntityBase entity in EntitieList)
+ {
+ if (entity is ScenePresence)
{
- if (entity is ScenePresence)
+ ScenePresence scenePrescence = entity as ScenePresence;
+ if (!scenePrescence.IsChildAgent)
{
- ScenePresence scenePrescence = entity as ScenePresence;
- if (!scenePrescence.IsChildAgent)
- {
- log.Error(String.Format("Packet debug for {0} {1} set to {2}",
- scenePrescence.Firstname,
- scenePrescence.Lastname,
- newDebug));
+ m_log.Error(String.Format("Packet debug for {0} {1} set to {2}",
+ scenePrescence.Firstname,
+ scenePrescence.Lastname,
+ newDebug));
- scenePrescence.ControllingClient.SetDebug(newDebug);
- }
+ scenePrescence.ControllingClient.SetDebug(newDebug);
}
}
- });
+ }
+ });
}
public List GetCurrentSceneAvatars()
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
index 1bddf25..0956f74 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.Inventory.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Environment.Scenes
{
public partial class SceneObjectGroup : EntityBase
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
///
/// Start a given script.
///
@@ -53,10 +55,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
- localID, Name, UUID, itemID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
+ localID, Name, UUID, itemID));
}
}
@@ -74,10 +76,10 @@ namespace OpenSim.Region.Environment.Scenes
// }
// else
// {
-// MainLog.Instance.Error(
-// "PRIMINVENTORY",
-// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
-// localID, Name, UUID, itemID);
+// m_log.Error(String.Format(
+// "[PRIMINVENTORY]: " +
+// "Couldn't find part {0} in object group {1}, {2} to start script with ID {3}",
+// localID, Name, UUID, itemID));
// }
// }
@@ -106,10 +108,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
- partID, Name, UUID, itemID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find part {0} in object group {1}, {2} to stop script with ID {3}",
+ partID, Name, UUID, itemID));
}
}
@@ -127,10 +129,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
- localID, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find part {0} in object group {1}, {2} to retreive prim inventory",
+ localID, Name, UUID));
}
return false;
}
@@ -144,10 +146,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find part {0} in object group {1}, {2} to request inventory data",
- localID, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find part {0} in object group {1}, {2} to request inventory data",
+ localID, Name, UUID));
}
}
@@ -183,10 +185,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
- localID, Name, UUID, newItemId);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find prim local ID {0} in group {1}, {2} to add inventory item ID {3}",
+ localID, Name, UUID, newItemId));
}
return false;
@@ -207,10 +209,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
- primID, part.Name, part.UUID, itemID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find prim local ID {0} in prim {1}, {2} to get inventory item ID {3}",
+ primID, part.Name, part.UUID, itemID));
}
return null;
@@ -233,10 +235,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't find prim ID {0} to update item {1}, {2}",
- item.ParentPartID, item.Name, item.ItemID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't find prim ID {0} to update item {1}, {2}",
+ item.ParentPartID, item.Name, item.ItemID));
}
return false;
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
index 10395b6..4fe7b55 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectGroup.cs
@@ -1003,9 +1003,9 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Verbose("SCENE",
+ m_log.Info(String.Format("[SCENE]: " +
"DelinkFromGroup(): Child prim local id {0} not found in object with root prim id {1}",
- partID, LocalId);
+ partID, LocalId));
}
}
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
index d4e2102..d9ee94c 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs
@@ -41,6 +41,8 @@ namespace OpenSim.Region.Environment.Scenes
{
public partial class SceneObjectPart : IScriptHost
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private string m_inventoryFileName = String.Empty;
///
@@ -131,10 +133,10 @@ namespace OpenSim.Region.Environment.Scenes
///
public void StartScript(TaskInventoryItem item)
{
-// MainLog.Instance.Verbose(
-// "PRIMINVENTORY",
-// "Starting script {0}, {1} in prim {2}, {3}",
-// item.Name, item.ItemID, Name, UUID);
+// m_log.Info(String.Format(
+// "[PRIMINVENTORY]: " +
+// "Starting script {0}, {1} in prim {2}, {3}",
+// item.Name, item.ItemID, Name, UUID));
AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false);
@@ -145,10 +147,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't start script {0}, {1} since asset ID {2} could not be found",
- item.Name, item.ItemID, item.AssetID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't start script {0}, {1} since asset ID {2} could not be found",
+ item.Name, item.ItemID, item.AssetID));
}
}
@@ -168,10 +170,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
- itemId, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}",
+ itemId, Name, UUID));
}
}
}
@@ -188,10 +190,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}",
- itemId, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}",
+ itemId, Name, UUID));
}
}
@@ -251,10 +253,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
- itemID, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
+ itemID, Name, UUID));
}
}
@@ -283,10 +285,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
- item.ItemID, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
+ item.ItemID, Name, UUID));
}
}
@@ -316,10 +318,10 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Error(
- "PRIMINVENTORY",
- "Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
- itemID, Name, UUID);
+ m_log.Error(String.Format(
+ "[PRIMINVENTORY]: " +
+ "Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory",
+ itemID, Name, UUID));
}
}
@@ -384,8 +386,8 @@ namespace OpenSim.Region.Environment.Scenes
fileData = Helpers.StringToField(invString.BuildString);
-// MainLog.Instance.Verbose(
-// "PRIMINVENTORY", "RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData));
+// m_log.Info(String.Format(
+// "[PRIMINVENTORY]: RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData)));
if (fileData.Length > 2)
{
diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
index 0ba64f2..4456fce 100644
--- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs
@@ -306,7 +306,7 @@ namespace OpenSim.Region.Environment.Scenes
{
// Ignore, and skip over.
}
- //MainLog.Instance.Verbose("PART", "OFFSET:" + m_offsetPosition, ToString());
+ //m_log.Info("[PART]: OFFSET:" + m_offsetPosition.ToString());
}
}
@@ -347,14 +347,14 @@ namespace OpenSim.Region.Environment.Scenes
if (ParentID == 0)
{
PhysActor.Orientation = new Quaternion(value.W, value.X, value.Y, value.Z);
- //MainLog.Instance.Verbose("PART", "RO1:" + PhysActor.Orientation.ToString());
+ //m_log.Info("[PART]: RO1:" + PhysActor.Orientation.ToString());
}
else
{
// Child prim we have to calculate it's world rotationwel
LLQuaternion resultingrotation = GetWorldRotation();
PhysActor.Orientation = new Quaternion(resultingrotation.W, resultingrotation.X, resultingrotation.Y, resultingrotation.Z);
- //MainLog.Instance.Verbose("PART", "RO2:" + PhysActor.Orientation.ToString());
+ //m_log.Info("[PART]: RO2:" + PhysActor.Orientation.ToString());
}
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
//}
@@ -1554,14 +1554,13 @@ namespace OpenSim.Region.Environment.Scenes
// Are we the owner?
if (AgentID == OwnerID)
{
- MainLog.Instance.Verbose("PERMISSIONS",
- "field: " + field.ToString() + ", mask: " + mask.ToString() + " addRemTF: " +
- addRemTF.ToString());
+ m_log.Info("[PERMISSIONS]: field: " + field.ToString() + ", mask: " + mask.ToString() + " addRemTF: " +
+ addRemTF.ToString());
//Field 8 = EveryoneMask
if (field == (byte) 8)
{
- MainLog.Instance.Verbose("PERMISSIONS", "Left over: " + (OwnerMask - EveryoneMask));
+ m_log.Info("[PERMISSIONS]: Left over: " + (OwnerMask - EveryoneMask));
if (addRemTF == (byte) 0)
{
//EveryoneMask = (uint)0;
@@ -1751,7 +1750,7 @@ namespace OpenSim.Region.Environment.Scenes
public void PhysicsOutOfBounds(PhysicsVector pos)
{
- MainLog.Instance.Verbose("PHYSICS", "Physical Object went out of bounds.");
+ m_log.Info("[PHYSICS]: Physical Object went out of bounds.");
RemFlag(LLObject.ObjectFlags.Physics);
DoPhysicsPropertyUpdate(false, true);
m_parentGroup.Scene.PhysicsScene.AddPhysicsActorTaint(PhysActor);
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index 659a1f5..5c33dfc 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -39,6 +39,8 @@ namespace OpenSim.Region.Environment.Scenes
{
public class ScenePresence : EntityBase
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public static AvatarAnimations Animations;
public static byte[] DefaultTexture;
public LLUUID currentParcelUUID = LLUUID.Zero;
@@ -345,7 +347,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch (KeyNotFoundException)
{
- MainLog.Instance.Warn("AVATAR", "KeyNotFound Exception playing avatar stand animation");
+ m_log.Warn("[AVATAR]: KeyNotFound Exception playing avatar stand animation");
}
m_animationSeqs.Add(1);
@@ -933,7 +935,7 @@ namespace OpenSim.Region.Environment.Scenes
}
else
{
- MainLog.Instance.Warn("Sit requested on unknown object: " + targetID.ToString());
+ m_log.Warn("Sit requested on unknown object: " + targetID.ToString());
}
SendSitResponse(remoteClient, targetID, offset);
}
@@ -1047,7 +1049,7 @@ namespace OpenSim.Region.Environment.Scenes
}
catch
{
- MainLog.Instance.Warn("AVATAR", "SetMovementAnimation for avatar failed. Attempting recovery...");
+ m_log.Warn("[AVATAR]: SetMovementAnimation for avatar failed. Attempting recovery...");
m_animations[0] = anim;
m_animationSeqs[0] = seq;
SendAnimPack();
@@ -1184,13 +1186,13 @@ namespace OpenSim.Region.Environment.Scenes
//bool controlland = (((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) || ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_UP_NEG) != 0));
//bool colliding = (m_physicsActor.IsColliding==true);
//if (controlland)
- // MainLog.Instance.Verbose("AGENT","landCommand");
+ // m_log.Info("[AGENT]: landCommand");
//if (colliding )
- // MainLog.Instance.Verbose("AGENT","colliding");
+ // m_log.Info("[AGENT]: colliding");
//if (m_physicsActor.Flying && colliding && controlland)
//{
// StopFlying();
- // MainLog.Instance.Verbose("AGENT", "Stop FLying");
+ // m_log.Info("[AGENT]: Stop FLying");
//}
}
else
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
index d781806..5d432f5 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineInterface.cs
@@ -33,7 +33,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
{
public interface ScriptEngineInterface
{
- void InitializeEngine(Scene Sceneworld, LogBase logger);
+ void InitializeEngine(Scene Sceneworld);
void Shutdown();
// void StartScript(string ScriptID, IScriptHost ObjectID);
}
diff --git a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
index 74f9358..b52b2e9 100644
--- a/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
+++ b/OpenSim/Region/Environment/Scenes/Scripting/ScriptEngineLoader.cs
@@ -35,12 +35,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
{
public class ScriptEngineLoader
{
- private LogBase m_log;
-
- public ScriptEngineLoader(LogBase logger)
- {
- m_log = logger;
- }
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
public ScriptEngineInterface LoadScriptEngine(string EngineName)
{
@@ -54,7 +49,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
}
catch (Exception e)
{
- m_log.Error("ScriptEngine",
+ m_log.Error("[ScriptEngine]: " +
"Error loading assembly \"" + EngineName + "\": " + e.Message + ", " +
e.StackTrace.ToString());
}
@@ -88,7 +83,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
//}
//catch (Exception e)
//{
- // m_log.Error("ScriptEngine", "Error loading assembly \String.Empty + FileName + "\": " + e.ToString());
+ // m_log.Error("[ScriptEngine]: Error loading assembly \String.Empty + FileName + "\": " + e.ToString());
//}
@@ -105,7 +100,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
//}
//catch (Exception e)
//{
- // m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
+ // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//}
ScriptEngineInterface ret;
@@ -115,7 +110,7 @@ namespace OpenSim.Region.Environment.Scenes.Scripting
//}
//catch (Exception e)
//{
- // m_log.Error("ScriptEngine", "Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
+ // m_log.Error("[ScriptEngine]: Error initializing type \String.Empty + NameSpace + "\" from \String.Empty + FileName + "\": " + e.ToString());
//}
return ret;
diff --git a/OpenSim/Region/Environment/StorageManager.cs b/OpenSim/Region/Environment/StorageManager.cs
index 1c41373..f15bbdb 100644
--- a/OpenSim/Region/Environment/StorageManager.cs
+++ b/OpenSim/Region/Environment/StorageManager.cs
@@ -35,6 +35,8 @@ namespace OpenSim.Region.Environment
{
public class StorageManager
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private IRegionDataStore m_dataStore;
public IRegionDataStore DataStore
@@ -49,7 +51,7 @@ namespace OpenSim.Region.Environment
public StorageManager(string dllName, string connectionstring, bool persistPrimInventories)
{
- MainLog.Instance.Verbose("DATASTORE", "Attempting to load " + dllName);
+ m_log.Info("[DATASTORE]: Attempting to load " + dllName);
Assembly pluginAssembly = Assembly.LoadFrom(dllName);
foreach (Type pluginType in pluginAssembly.GetTypes())
@@ -66,7 +68,7 @@ namespace OpenSim.Region.Environment
m_dataStore = plug;
- MainLog.Instance.Verbose("DATASTORE", "Added IRegionDataStore Interface");
+ m_log.Info("[DATASTORE]: Added IRegionDataStore Interface");
}
}
}
diff --git a/OpenSim/Region/Examples/SimpleApp/Program.cs b/OpenSim/Region/Examples/SimpleApp/Program.cs
index 6c18540..f919276 100644
--- a/OpenSim/Region/Examples/SimpleApp/Program.cs
+++ b/OpenSim/Region/Examples/SimpleApp/Program.cs
@@ -51,9 +51,9 @@ namespace SimpleApp
private string m_userPlugin = "OpenSim.Framework.Data.SQLite.dll";
private string m_inventoryPlugin = "OpenSim.Framework.Data.SQLite.dll";
- protected override LogBase CreateLog()
+ protected override ConsoleBase CreateConsole()
{
- return new LogBase(null, "SimpleApp", this, true);
+ return new ConsoleBase("SimpleApp", this);
}
protected override void Initialize()
@@ -64,12 +64,12 @@ namespace SimpleApp
LocalAssetServer assetServer = new LocalAssetServer();
- m_assetCache = new AssetCache(assetServer, m_log);
+ m_assetCache = new AssetCache(assetServer);
}
public void Run()
{
- StartLog();
+ StartConsole();
StartUp();
LocalInventoryService inventoryService = new LocalInventoryService();
@@ -94,7 +94,7 @@ namespace SimpleApp
m_httpServer.AddXmlRPCHandler("login_to_simulator", loginService.XmlRpcLoginMethod);
- m_log.Notice(m_log.LineInfo);
+ m_console.Notice(m_console.LineInfo);
IPEndPoint internalEndPoint =
new IPEndPoint(IPAddress.Parse("127.0.0.1"), (int) m_networkServersInfo.HttpListenerPort);
@@ -104,7 +104,7 @@ namespace SimpleApp
UDPServer udpServer;
- m_moduleLoader = new ModuleLoader(m_log, m_config);
+ m_moduleLoader = new ModuleLoader(m_config);
m_moduleLoader.LoadDefaultSharedModules();
Scene scene = SetupScene(regionInfo, out udpServer, false);
@@ -170,8 +170,8 @@ namespace SimpleApp
scene.AddEntity(fileObject);
}
- m_log.Notice("Press enter to quit.");
- m_log.ReadLine();
+ m_console.Notice("Press enter to quit.");
+ m_console.ReadLine();
}
protected override Scene CreateScene(RegionInfo regionInfo, StorageManager storageManager,
@@ -182,7 +182,7 @@ namespace SimpleApp
return
new MyWorld(regionInfo, circuitManager, permissionManager, m_commsManager, sceneGridService,
m_assetCache, storageManager, m_httpServer,
- new ModuleLoader(m_log, m_config), true, false);
+ new ModuleLoader(m_config), true, false);
}
protected override StorageManager CreateStorageManager(string connectionstring)
@@ -211,6 +211,8 @@ namespace SimpleApp
private static void Main(string[] args)
{
+ log4net.Config.XmlConfigurator.Configure();
+
Program app = new Program();
app.Run();
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
index b625f43..03d478f 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/CSharp/CSharpScriptEngine.cs
@@ -35,6 +35,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
{
public class CSharpScriptEngine : IScriptCompiler
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public string FileExt()
{
return ".cs";
@@ -58,10 +60,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.CSharp
if (compilerResults.Errors.Count > 0)
{
- MainLog.Instance.Error("Compile errors");
+ m_log.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors)
{
- MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
+ m_log.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
}
}
else
diff --git a/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs b/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
index bc5c413..dbe0dca 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Engines/JScript/JScriptEngine.cs
@@ -35,6 +35,8 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
{
public class JScriptEngine : IScriptCompiler
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public string FileExt()
{
return ".js";
@@ -58,10 +60,10 @@ namespace OpenSim.Region.ExtensionsScriptModule.JScript
if (compilerResults.Errors.Count > 0)
{
- MainLog.Instance.Error("Compile errors");
+ m_log.Error("Compile errors");
foreach (CompilerError error in compilerResults.Errors)
{
- MainLog.Instance.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
+ m_log.Error(error.Line.ToString() + ": " + error.ErrorText.ToString());
}
}
else
diff --git a/OpenSim/Region/ExtensionsScriptModule/Script.cs b/OpenSim/Region/ExtensionsScriptModule/Script.cs
index 0555277..d9d569b 100644
--- a/OpenSim/Region/ExtensionsScriptModule/Script.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/Script.cs
@@ -53,12 +53,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
private void events_OnNewPresence(ScenePresence presence)
{
- script.logger.Verbose("TESTSCRIPT", "Hello " + presence.Firstname.ToString() + "!");
+ script.Log.Info("[TESTSCRIPT]: Hello " + presence.Firstname.ToString() + "!");
}
private void events_OnFrame()
{
- //script.logger.Verbose("TESTSCRIPT", "Hello World!");
+ //script.logger.Info("[TESTSCRIPT]: Hello World!");
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
index af54a4e..e90bfc1 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInfo.cs
@@ -36,23 +36,26 @@ namespace OpenSim.Region.ExtensionsScriptModule
///
public class ScriptInfo
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
// Reference to world.eventsManager provided for convenience
public EventManager events;
// The main world
public Scene world;
- // The console
- public LogBase logger;
-
// API Access
public ScriptAPI api;
+ public log4net.ILog Log
+ {
+ get { return m_log; }
+ }
+
public ScriptInfo(Scene scene)
{
world = scene;
events = world.EventManager;
- logger = MainLog.Instance;
api = new ScriptAPI(world, LLUUID.Zero);
}
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
index b3a0d4f..0f50358 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptInterpretedAPI.cs
@@ -45,6 +45,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
/// Avoid at all costs. This should ONLY be used for LSL.
internal class ScriptInterpretedAPI
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
protected Key m_object;
protected Scene m_scene;
@@ -109,7 +111,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
{
//Dont do anything!
}
- MainLog.Instance.Warn("script",
+ m_log.Warn("[script]: " +
"Unimplemented function called by script: osAddToLandPassList(Key avatar, float hours)");
return;
}
@@ -117,7 +119,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
[Obsolete("Unimplemented")]
public void osAdjustSoundVolume(float volume)
{
- MainLog.Instance.Warn("script", "Unimplemented function called by script: osAdjustSoundVolume(float volume)");
+ m_log.Warn("[script]: Unimplemented function called by script: osAdjustSoundVolume(float volume)");
return;
}
diff --git a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
index d080ab8..6c2d940 100644
--- a/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
+++ b/OpenSim/Region/ExtensionsScriptModule/ScriptManager.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.ExtensionsScriptModule
{
public class ScriptManager : IRegionModule, IExtensionScriptModule
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private readonly List scripts = new List();
private Scene m_scene;
private readonly Dictionary compilers = new Dictionary();
@@ -48,12 +50,12 @@ namespace OpenSim.Region.ExtensionsScriptModule
{
ScriptInfo scriptInfo = new ScriptInfo(m_scene);
// Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
- MainLog.Instance.Verbose("SCRIPT", "Loading " + script.Key);
+ m_log.Info("[SCRIPT]: Loading " + script.Key);
script.Value.Initialise(scriptInfo);
scripts.Add(script.Value);
}
- MainLog.Instance.Verbose("SCRIPT", string.Format("Finished loading {0} script(s)", compiledscripts.Count));
+ m_log.Info("[SCRIPT]: " + string.Format("Finished loading {0} script(s)", compiledscripts.Count));
}
public ScriptManager()
@@ -71,7 +73,7 @@ namespace OpenSim.Region.ExtensionsScriptModule
public void Initialise(Scene scene, IConfigSource config)
{
- MainLog.Instance.Verbose("SCRIPTMODULE", "Initialising Extensions Scripting Module");
+ m_log.Info("[SCRIPTMODULE]: Initialising Extensions Scripting Module");
m_scene = scene;
m_scene.RegisterModuleInterface(this);
@@ -118,14 +120,14 @@ namespace OpenSim.Region.ExtensionsScriptModule
break;
default:
- MainLog.Instance.Error("Unknown script command");
+ m_log.Error("Unknown script command");
break;
}
}
public bool AddPreCompiledScript(IScript script)
{
- MainLog.Instance.Verbose("SCRIPT", "Loading script " + script.Name);
+ m_log.Info("[SCRIPT]: Loading script " + script.Name);
ScriptInfo scriptInfo = new ScriptInfo(m_scene);
// Since each script could potentially corrupt their access with a stray assignment, making a new one for each script.
script.Initialise(scriptInfo);
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
index b76fbbf..919910c 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/AssemblyInfo.cs
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
+[assembly : AssemblyVersion("1.0.*")]
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index f42fdf6..27ae490 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -81,6 +81,8 @@ namespace OpenSim.Region.Physics.BulletXPlugin
///
public class BulletXMaths
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
//Vector3
public static Vector3 PhysicsVectorToXnaVector3(PhysicsVector physicsVector)
{
@@ -311,7 +313,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin
bool needsCollision = base.NeedsCollision(bodyA, bodyB);
- //MainLog.Instance.Debug("BulletX", "A collision was detected between {0} and {1} --> {2}", nameA, nameB,
+ //m_log.Debug("[BulletX]: A collision was detected between {0} and {1} --> {2}", nameA, nameB,
//needsCollision);
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index a4ac54f..acaa389b 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -38,6 +38,8 @@ namespace OpenSim.Region.Physics.Manager
///
public class PhysicsPluginManager
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private Dictionary _PhysPlugins = new Dictionary();
private Dictionary _MeshPlugins = new Dictionary();
@@ -60,25 +62,25 @@ namespace OpenSim.Region.Physics.Manager
IMesher meshEngine = null;
if (_MeshPlugins.ContainsKey(meshEngineName))
{
- MainLog.Instance.Verbose("PHYSICS", "creating meshing engine " + meshEngineName);
+ m_log.Info("[PHYSICS]: creating meshing engine " + meshEngineName);
meshEngine = _MeshPlugins[meshEngineName].GetMesher();
}
else
{
- MainLog.Instance.Warn("PHYSICS", "couldn't find meshingEngine: {0}", meshEngineName);
+ m_log.Warn(String.Format("[PHYSICS]: couldn't find meshingEngine: {0}", meshEngineName));
throw new ArgumentException(String.Format("couldn't find meshingEngine: {0}", meshEngineName));
}
if (_PhysPlugins.ContainsKey(physEngineName))
{
- MainLog.Instance.Verbose("PHYSICS", "creating " + physEngineName);
+ m_log.Info("[PHYSICS]: creating " + physEngineName);
PhysicsScene result = _PhysPlugins[physEngineName].GetScene();
result.Initialise(meshEngine);
return result;
}
else
{
- MainLog.Instance.Warn("PHYSICS", "couldn't find physicsEngine: {0}", physEngineName);
+ m_log.Warn(String.Format("[PHYSICS]: couldn't find physicsEngine: {0}", physEngineName));
throw new ArgumentException(String.Format("couldn't find physicsEngine: {0}", physEngineName));
}
}
@@ -89,7 +91,7 @@ namespace OpenSim.Region.Physics.Manager
IMeshingPlugin plugHard;
plugHard = new ZeroMesherPlugin();
_MeshPlugins.Add(plugHard.GetName(), plugHard);
- MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plugHard.GetName());
+ m_log.Info("[PHYSICS]: Added meshing engine: " + plugHard.GetName());
// And now walk all assemblies (DLLs effectively) and see if they are home
// of a plugin that is of interest for us
@@ -120,7 +122,7 @@ namespace OpenSim.Region.Physics.Manager
(IPhysicsPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
plug.Init();
_PhysPlugins.Add(plug.GetName(), plug);
- MainLog.Instance.Verbose("PHYSICS", "Added physics engine: " + plug.GetName());
+ m_log.Info("[PHYSICS]: Added physics engine: " + plug.GetName());
}
Type meshTypeInterface = pluginType.GetInterface("IMeshingPlugin", true);
@@ -130,7 +132,7 @@ namespace OpenSim.Region.Physics.Manager
IMeshingPlugin plug =
(IMeshingPlugin) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString()));
_MeshPlugins.Add(plug.GetName(), plug);
- MainLog.Instance.Verbose("PHYSICS", "Added meshing engine: " + plug.GetName());
+ m_log.Info("[PHYSICS]: Added meshing engine: " + plug.GetName());
}
physTypeInterface = null;
@@ -147,11 +149,11 @@ namespace OpenSim.Region.Physics.Manager
{
if (isWarning)
{
- MainLog.Instance.Warn("PHYSICS", message);
+ m_log.Warn("[PHYSICS]: " + message);
}
else
{
- MainLog.Instance.Verbose("PHYSICS", message);
+ m_log.Info("[PHYSICS]: " + message);
}
}
@@ -171,4 +173,4 @@ namespace OpenSim.Region.Physics.Manager
string GetName();
IMesher GetMesher();
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 37481f1..bd2ad99 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -25,6 +25,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*/
+using System;
using Axiom.Math;
using OpenSim.Framework;
using OpenSim.Framework.Console;
@@ -35,6 +36,8 @@ namespace OpenSim.Region.Physics.Manager
public abstract class PhysicsScene
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
// The only thing that should register for this event is the InnerScene
// Anything else could cause problems.
@@ -92,7 +95,7 @@ namespace OpenSim.Region.Physics.Manager
public override PhysicsActor AddAvatar(string avName, PhysicsVector position)
{
- MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddAvatar({0})", position);
+ m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddAvatar({0})", position));
return PhysicsActor.Null;
}
@@ -107,7 +110,7 @@ namespace OpenSim.Region.Physics.Manager
/*
public override PhysicsActor AddPrim(PhysicsVector position, PhysicsVector size, Quaternion rotation)
{
- MainLog.Instance.Verbose("NullPhysicsScene : AddPrim({0},{1})", position, size);
+ m_log.Info(String.Format("NullPhysicsScene : AddPrim({0},{1})", position, size));
return PhysicsActor.Null;
}
*/
@@ -121,7 +124,7 @@ namespace OpenSim.Region.Physics.Manager
public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, PhysicsVector position,
PhysicsVector size, Quaternion rotation, bool isPhysical)
{
- MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : AddPrim({0},{1})", position, size);
+ m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size));
return PhysicsActor.Null;
}
@@ -131,20 +134,19 @@ namespace OpenSim.Region.Physics.Manager
public override float Simulate(float timeStep)
{
- m_workIndicator = (m_workIndicator + 1)%10;
+ m_workIndicator = (m_workIndicator + 1) % 10;
- //MainLog.Instance.SetStatus(m_workIndicator.ToString());
return 0f;
}
public override void GetResults()
{
- MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : GetResults()");
+ m_log.Info("[PHYSICS]: NullPhysicsScene : GetResults()");
}
public override void SetTerrain(float[] heightMap)
{
- MainLog.Instance.Verbose("PHYSICS", "NullPhysicsScene : SetTerrain({0} items)", heightMap.Length);
+ m_log.Info(String.Format("[PHYSICS]: NullPhysicsScene : SetTerrain({0} items)", heightMap.Length));
}
public override void DeleteTerrain()
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index 3217dd8..d4c9926 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -53,6 +53,8 @@ namespace OpenSim.Region.Physics.Meshing
public class Meshmerizer : IMesher
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
// Setting baseDir to a path will enable the dumping of raw files
// raw files can be imported by blender so a visual inspection of the results can be done
// const string baseDir = "rawFiles";
@@ -101,7 +103,6 @@ namespace OpenSim.Region.Physics.Meshing
return influenced;
}
-
private static void InsertVertices(List vertices, int usedForSeed, List triangles)
{
// This is a variant of the delaunay algorithm
@@ -174,7 +175,6 @@ namespace OpenSim.Region.Physics.Meshing
}
}
-
private static Mesh CreateBoxMesh(String primName, PrimitiveBaseShape primShape, PhysicsVector size)
// Builds the z (+ and -) surfaces of a box shaped prim
{
@@ -236,7 +236,7 @@ namespace OpenSim.Region.Physics.Meshing
// Calculated separately to avoid errors
cutHull.AddVertex(legEnd);
- MainLog.Instance.Debug("Starting cutting of the hollow shape from the prim {1}", 0, primName);
+ m_log.Debug(String.Format("Starting cutting of the hollow shape from the prim {1}", 0, primName));
SimpleHull cuttedHull = SimpleHull.SubtractHull(outerHull, cutHull);
outerHull = cuttedHull;
diff --git a/OpenSim/Region/Physics/Meshing/SimpleHull.cs b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
index 4532bda..9209860 100644
--- a/OpenSim/Region/Physics/Meshing/SimpleHull.cs
+++ b/OpenSim/Region/Physics/Meshing/SimpleHull.cs
@@ -42,6 +42,8 @@ namespace OpenSim.Region.Physics.Meshing
// is defined by the hull lies inside or outside the simplex chain
public class SimpleHull
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private List vertices = new List();
private List holeVertices = new List(); // Only used, when the hull is hollow
@@ -243,9 +245,9 @@ namespace OpenSim.Region.Physics.Meshing
SimpleHull otherHullClone = otherHull.Clone();
bool intersects = false;
- MainLog.Instance.Debug("State before intersection detection");
- MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
- MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
+ m_log.Debug("State before intersection detection");
+ m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
+ m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
{
int iBase, iOther;
@@ -274,8 +276,8 @@ namespace OpenSim.Region.Physics.Meshing
}
}
- MainLog.Instance.Debug("State after intersection detection for the base hull");
- MainLog.Instance.Debug("The baseHull is:\n{1}", 0, baseHullClone.ToString());
+ m_log.Debug("State after intersection detection for the base hull");
+ m_log.Debug(String.Format("The baseHull is:\n{1}", 0, baseHullClone.ToString()));
{
int iOther, iBase;
@@ -303,8 +305,8 @@ namespace OpenSim.Region.Physics.Meshing
}
}
- MainLog.Instance.Debug("State after intersection detection for the base hull");
- MainLog.Instance.Debug("The otherHull is:\n{1}", 0, otherHullClone.ToString());
+ m_log.Debug("State after intersection detection for the base hull");
+ m_log.Debug(String.Format("The otherHull is:\n{1}", 0, otherHullClone.ToString()));
bool otherIsInBase = baseHullClone.containsPointsFrom(otherHullClone);
@@ -387,7 +389,7 @@ namespace OpenSim.Region.Physics.Meshing
done = true;
}
- MainLog.Instance.Debug("The resulting Hull is:\n{1}", 0, result.ToString());
+ m_log.Debug(String.Format("The resulting Hull is:\n{1}", 0, result.ToString()));
return result;
}
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index a21b7eb..98069a0 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -56,6 +56,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
public class OdeCharacter : PhysicsActor
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private PhysicsVector _position;
private d.Vector3 _zeroPosition;
private d.Matrix3 m_StandUpRotation;
@@ -357,7 +359,7 @@ namespace OpenSim.Region.Physics.OdePlugin
//capsuleradius = 0.2f;
CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z*0.52f))); // subtract 43% of the size
- OpenSim.Framework.Console.MainLog.Instance.Verbose("SIZE", CAPSULE_LENGTH.ToString());
+ m_log.Info("[SIZE]: " + CAPSULE_LENGTH.ToString());
d.BodyDestroy(Body);
_parent_scene.waitForSpaceUnlock(_parent_scene.space);
@@ -440,7 +442,7 @@ namespace OpenSim.Region.Physics.OdePlugin
//d.QfromR(
//d.Matrix3 checkrotation = new d.Matrix3(0.7071068,0.5, -0.7071068,
//
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICSAV", "Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
+ //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
//standupStraight();
@@ -479,7 +481,7 @@ namespace OpenSim.Region.Physics.OdePlugin
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, servo, 0.0f, 0.0f, 1.0f);
d.BodyAddForceAtRelPos(Body, 0.0f, 0.0f, -servo, 0.0f, 0.0f, -1.0f);
//d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICSAV", "Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
+ //m_log.Info("[PHYSICSAV]: Rotation: " + bodyrotation.M00 + " : " + bodyrotation.M01 + " : " + bodyrotation.M02 + " : " + bodyrotation.M10 + " : " + bodyrotation.M11 + " : " + bodyrotation.M12 + " : " + bodyrotation.M20 + " : " + bodyrotation.M21 + " : " + bodyrotation.M22);
}
public override PhysicsVector Force
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 93ba29e..690e9d3 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -37,6 +37,8 @@ namespace OpenSim.Region.Physics.OdePlugin
{
public class OdePrim : PhysicsActor
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public PhysicsVector _position;
private PhysicsVector _velocity;
private PhysicsVector m_lastVelocity = new PhysicsVector(0.0f, 0.0f, 0.0f);
@@ -530,7 +532,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Failed to load a sphere bad size");
+ m_log.Info("[PHYSICS]: Failed to load a sphere bad size");
_parent_scene.waitForSpaceUnlock(m_targetSpace);
prim_geom = d.CreateBox(m_targetSpace, _size.X, _size.Y, _size.Z);
}
@@ -683,7 +685,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
lock (m_forcelist)
{
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "dequeing forcelist");
+ //m_log.Info("[PHYSICS]: dequeing forcelist");
if (IsPhysical)
{
PhysicsVector iforce = new PhysicsVector();
@@ -747,7 +749,7 @@ namespace OpenSim.Region.Physics.OdePlugin
get { return _position; }
set { _position = value;
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", _position.ToString());
+ //m_log.Info("[PHYSICS]: " + _position.ToString());
}
}
@@ -824,7 +826,7 @@ namespace OpenSim.Region.Physics.OdePlugin
{
m_forcelist.Add(force);
m_taintforce = true;
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Added Force:" + force.ToString() + " to prim at " + Position.ToString());
+ //m_log.Info("[PHYSICS]: Added Force:" + force.ToString() + " to prim at " + Position.ToString());
}
public override PhysicsVector RotationalVelocity
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index bff2c80..9cf6d50 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Region.Physics.OdePlugin
///
public class OdePlugin : IPhysicsPlugin
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private OdeScene _mScene;
public OdePlugin()
@@ -76,6 +78,8 @@ namespace OpenSim.Region.Physics.OdePlugin
public class OdeScene : PhysicsScene
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
// TODO: this should be hard-coded in some common place
private const uint m_regionWidth = 256;
private const uint m_regionHeight = 256;
@@ -284,7 +288,7 @@ namespace OpenSim.Region.Physics.OdePlugin
//if (id == d.GeomClassID.TriMeshClass)
//{
- // MainLog.Instance.Verbose("near: A collision was detected between {1} and {2}", 0, name1, name2);
+ // m_log.Info("near: A collision was detected between {1} and {2}", 0, name1, name2);
//System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2);
//}
@@ -296,8 +300,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
catch (SEHException)
{
- MainLog.Instance.Error("PHYSICS",
- "The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
+ m_log.Error("[PHYSICS]: The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim.");
base.TriggerPhysicsBasedRestart();
}
@@ -352,7 +355,7 @@ namespace OpenSim.Region.Physics.OdePlugin
if (contacts[i].depth >= 1.00f)
{
- //MainLog.Instance.Debug("PHYSICS",contacts[i].depth.ToString());
+ //m_log.Debug("[PHYSICS]: " +contacts[i].depth.ToString());
}
//If you interpenetrate a prim with an agent
@@ -405,7 +408,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
if (contacts[i].depth >= 1.00f)
{
- //OpenSim.Framework.Console.MainLog.Instance.Verbose("P", contacts[i].depth.ToString());
+ //m_log.Info("[P]: " + contacts[i].depth.ToString());
if ((p2.PhysicsActorType == (int) ActorTypes.Agent &&
p1.PhysicsActorType == (int) ActorTypes.Unknown) ||
(p1.PhysicsActorType == (int) ActorTypes.Agent &&
@@ -654,9 +657,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'removeprim from scene':" +
- ((OdePrim) prim).m_targetSpace.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" +
+ ((OdePrim) prim).m_targetSpace.ToString());
}
}
}
@@ -678,9 +680,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'removeprim from scene':" +
- ((OdePrim) prim).m_targetSpace.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'removeprim from scene':" +
+ ((OdePrim) prim).m_targetSpace.ToString());
}
}
}
@@ -742,9 +743,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() +
- " Geom:" + geom.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() +
+ " Geom:" + geom.ToString());
}
}
else
@@ -761,9 +761,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'recalculatespace':" +
- sGeomIsIn.ToString() + " Geom:" + geom.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
+ sGeomIsIn.ToString() + " Geom:" + geom.ToString());
}
}
}
@@ -787,9 +786,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'recalculatespace':" +
- currentspace.ToString() + " Geom:" + geom.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
+ currentspace.ToString() + " Geom:" + geom.ToString());
}
}
}
@@ -807,9 +805,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'recalculatespace':" +
- currentspace.ToString() + " Geom:" + geom.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
+ currentspace.ToString() + " Geom:" + geom.ToString());
}
}
else
@@ -826,9 +823,8 @@ namespace OpenSim.Region.Physics.OdePlugin
}
else
{
- MainLog.Instance.Verbose("Physics",
- "Invalid Scene passed to 'recalculatespace':" +
- sGeomIsIn.ToString() + " Geom:" + geom.ToString());
+ m_log.Info("[Physics]: Invalid Scene passed to 'recalculatespace':" +
+ sGeomIsIn.ToString() + " Geom:" + geom.ToString());
}
}
}
@@ -876,7 +872,7 @@ namespace OpenSim.Region.Physics.OdePlugin
IntPtr locationbasedspace =IntPtr.Zero;
int[] xyspace = calculateSpaceArrayItemFromPos(pos);
- //MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
+ //m_log.Info("[Physics]: Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString());
locationbasedspace = staticPrimspace[xyspace[0], xyspace[1]];
//locationbasedspace = space;
@@ -970,7 +966,7 @@ namespace OpenSim.Region.Physics.OdePlugin
name2 = "null";
}
- MainLog.Instance.Verbose("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
+ m_log.Info("TriArrayCallback: A collision was detected between {1} and {2}", 0, name1, name2);
*/
return 1;
}
@@ -984,19 +980,20 @@ namespace OpenSim.Region.Physics.OdePlugin
{
name1 = "null";
}
+
if (!geom_name_map.TryGetValue(refObject, out name2))
{
name2 = "null";
}
-// MainLog.Instance.Verbose("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex);
+// m_log.Info("TriCallback: A collision was detected between {1} and {2}. Index was {3}", 0, name1, name2, triangleIndex);
d.Vector3 v0 = new d.Vector3();
d.Vector3 v1 = new d.Vector3();
d.Vector3 v2 = new d.Vector3();
d.GeomTriMeshGetTriangle(trimesh, 0, ref v0, ref v1, ref v2);
-// MainLog.Instance.Debug("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z);
+// m_log.Debug("Triangle {0} is <{1},{2},{3}>, <{4},{5},{6}>, <{7},{8},{9}>", triangleIndex, v0.X, v0.Y, v0.Z, v1.X, v1.Y, v1.Z, v2.X, v2.Y, v2.Z);
return 1;
}
@@ -1105,19 +1102,16 @@ namespace OpenSim.Region.Physics.OdePlugin
}
catch (StackOverflowException)
{
- MainLog.Instance.Error("PHYSICS",
- "The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim.");
+ m_log.Error("[PHYSICS]: The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim.");
base.TriggerPhysicsBasedRestart();
}
int i = 0;
-
// Figure out the Frames Per Second we're going at.
//(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
fps = (step_time/ODE_STEPSIZE) * 1000;
-
while (step_time > 0.0f)
{
foreach (OdeCharacter actor in _characters)
@@ -1126,7 +1120,6 @@ namespace OpenSim.Region.Physics.OdePlugin
actor.collidelock = true;
}
-
collision_optimized(timeStep);
d.WorldQuickStep(world, ODE_STEPSIZE);
d.JointGroupEmpty(contactgroup);
@@ -1178,8 +1171,8 @@ namespace OpenSim.Region.Physics.OdePlugin
public override bool IsThreaded
{
- get { return (false); // for now we won't be multithreaded
- }
+ // for now we won't be multithreaded
+ get { return (false); }
}
public float[] ResizeTerrain512NearestNeighbour(float[] heightMap)
{
@@ -1275,6 +1268,7 @@ namespace OpenSim.Region.Physics.OdePlugin
}
}
}
+
//Flatten out the array
int i = 0;
for (int y = 0; y < 512; y++)
diff --git a/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs
index 3bb71d4..da9f587 100644
--- a/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/POSPlugin/AssemblyInfo.cs
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
+[assembly : AssemblyVersion("1.0.*")]
diff --git a/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs b/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
index 36cb952..8e6d2a6 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/AssemblyInfo.cs
@@ -55,4 +55,4 @@ using System.Runtime.InteropServices;
// You can specify all values by your own or you can build default build and revision
// numbers with the '*' character (the default):
-[assembly : AssemblyVersion("1.0.*")]
\ No newline at end of file
+[assembly : AssemblyVersion("1.0.*")]
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
index 8511b56..3a38497 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
@@ -41,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.Common
{
public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
{
-
//
// Included as base for any LSL-script that is compiled.
// Any function added here will be accessible to the LSL script. But it must also be added to "LSL_BuiltIn_Commands_Interface" in "OpenSim.Region.ScriptEngine.Common" class.
@@ -49,6 +48,8 @@ namespace OpenSim.Region.ScriptEngine.Common
// Security note: This script will be running inside an restricted AppDomain. Currently AppDomain is not very restricted.
//
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
// Object never expires
public override Object InitializeLifetimeService()
{
@@ -112,7 +113,7 @@ namespace OpenSim.Region.ScriptEngine.Common
{
m_LSL_Functions = LSL_Functions;
- //MainLog.Instance.Notice(ScriptEngineName, "LSL_BaseClass.Start() called.");
+ //m_log.Info(ScriptEngineName, "LSL_BaseClass.Start() called.");
// Get this AppDomain's settings and display some of them.
AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index 242bd27..66475c3 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -43,12 +43,13 @@ using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
namespace OpenSim.Region.ScriptEngine.Common
{
-
///
/// Contains all LSL ll-functions. This class will be in Default AppDomain.
///
public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private ASCIIEncoding enc = new ASCIIEncoding();
private ScriptEngineBase.ScriptEngine m_ScriptEngine;
private SceneObjectPart m_host;
@@ -63,7 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Common
m_localID = localID;
m_itemID = itemID;
- //MainLog.Instance.Notice(ScriptEngineName, "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
+ //m_log.Info(ScriptEngineName, "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
}
private DateTime m_timer = DateTime.Now;
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
index 2ed0529..0fb8d75 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
@@ -26,7 +26,6 @@
*
*/
-
using System;
using System.Collections;
using System.Collections.Generic;
@@ -37,7 +36,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
public class AppDomainManager : iScriptEngineFunctionModule
{
-
//
// This class does AppDomain handling and loading/unloading of scripts in it.
// It is instanced in "ScriptEngine" and controlled from "ScriptManager"
@@ -48,7 +46,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
// 4. Unload AppDomain completely when all scripts in it has stopped
//
-
private int maxScriptsPerAppDomain = 1;
///
@@ -149,8 +146,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads);
- m_scriptEngine.Log.Verbose(m_scriptEngine.ScriptEngineName, "AppDomain Loading: " +
- AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString());
+ m_scriptEngine.Log.Info("[" + m_scriptEngine.ScriptEngineName + "]: AppDomain Loading: " +
+ AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString());
AD.Load(AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll"));
// Return the new AppDomain
@@ -183,7 +180,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
// Unload
AppDomain.Unload(ads.CurrentAppDomain);
#if DEBUG
- m_scriptEngine.Log.Verbose(m_scriptEngine.ScriptEngineName, "AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + " bytes of memory");
+ m_scriptEngine.Log.Info("[" + m_scriptEngine.ScriptEngineName + "]: AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + " bytes of memory");
#endif
}
}
@@ -191,14 +188,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
} // lock
}
-
public IScript LoadScript(string FileName)
{
// Find next available AppDomain to put it in
AppDomainStructure FreeAppDomain = GetFreeAppDomain();
#if DEBUG
- m_scriptEngine.Log.Verbose(m_scriptEngine.ScriptEngineName, "Loading into AppDomain: " + FileName);
+ m_scriptEngine.Log.Info("[" + m_scriptEngine.ScriptEngineName + "]: Loading into AppDomain: " + FileName);
#endif
IScript mbrt =
(IScript)
@@ -220,7 +216,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
lock (freeLock)
{
#if DEBUG
- m_scriptEngine.Log.Verbose(m_scriptEngine.ScriptEngineName, "Stopping script in AppDomain");
+ m_scriptEngine.Log.Info("[" + m_scriptEngine.ScriptEngineName + "]: Stopping script in AppDomain");
#endif
// Check if it is current AppDomain
if (currentAD.CurrentAppDomain == ad)
@@ -244,6 +240,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
UnloadAppDomains(); // Outsite lock, has its own GetLock
}
+
///
/// If set to true then threads and stuff should try to make a graceful exit
///
@@ -253,6 +250,5 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
set { _PleaseShutdown = value; }
}
private bool _PleaseShutdown = false;
-
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
index fe6dfcd..e99f0a7 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
@@ -26,7 +26,6 @@
*
*/
-
namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
public static class Common
@@ -36,23 +35,23 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
// This class just contains some static log stuff used for debugging.
- //public delegate void SendToDebugEventDelegate(string Message);
- //public delegate void SendToLogEventDelegate(string Message);
+ //public delegate void SendToDebugEventDelegate(string message);
+ //public delegate void SendToLogEventDelegate(string message);
//static public event SendToDebugEventDelegate SendToDebugEvent;
//static public event SendToLogEventDelegate SendToLogEvent;
- public static void SendToDebug(string Message)
+ public static void SendToDebug(string message)
{
//if (Debug == true)
- mySE.Log.Verbose(mySE.ScriptEngineName, "Debug: " + Message);
- //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
+ mySE.Log.Info("[" + mySE.ScriptEngineName + "]: Debug: " + message);
+ //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + message);
}
- public static void SendToLog(string Message)
+ public static void SendToLog(string message)
{
//if (Debug == true)
- mySE.Log.Verbose(mySE.ScriptEngineName, "LOG: " + Message);
- //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
+ mySE.Log.Info("[" + mySE.ScriptEngineName + "]: LOG: " + message);
+ //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + message);
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
index 678c3d0..1de010a 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
@@ -39,7 +39,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
[Serializable]
public class EventManager : OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents, iScriptEngineFunctionModule
{
-
//
// Class is instanced in "ScriptEngine" and Uses "EventQueueManager" that is also instanced in "ScriptEngine".
// This class needs a bit of explaining:
@@ -65,7 +64,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
// We may not want to do it because someone is controlling us and will deliver events to us
if (performHookUp)
{
- myScriptEngine.Log.Verbose(myScriptEngine.ScriptEngineName, "Hooking up to server events");
+ myScriptEngine.Log.Info("[" + myScriptEngine.ScriptEngineName + "]: Hooking up to server events");
myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
@@ -78,7 +77,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
}
-
public void changed(uint localID, uint change)
{
// Add to queue for all scripts in localID, Object pass change.
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
index e1b1b6c..5e06fcd 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
@@ -44,7 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
[Serializable]
public class EventQueueManager : iScriptEngineFunctionModule
{
-
//
// Class is instanced in "ScriptEngine" and used by "EventManager" also instanced in "ScriptEngine".
//
@@ -256,16 +255,15 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
#endregion
-
#region " Start / stop script execution threads (ThreadClasses) "
private void StartNewThreadClass()
{
EventQueueThreadClass eqtc = new EventQueueThreadClass(this);
eventQueueThreads.Add(eqtc);
staticGlobalEventQueueThreads.Add(eqtc);
- m_ScriptEngine.Log.Debug(m_ScriptEngine.ScriptEngineName, "Started new script execution thread. Current thread count: " + eventQueueThreads.Count);
-
+ m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: Started new script execution thread. Current thread count: " + eventQueueThreads.Count);
}
+
private void AbortThreadClass(EventQueueThreadClass threadClass)
{
if (eventQueueThreads.Contains(threadClass))
@@ -279,10 +277,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
catch (Exception ex)
{
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName + ":EventQueueManager", "If you see this, could you please report it to Tedd:");
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName + ":EventQueueManager", "Script thread execution timeout kill ended in exception: " + ex.ToString());
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: If you see this, could you please report it to Tedd:");
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + ":EventQueueManager]: Script thread execution timeout kill ended in exception: " + ex.ToString());
}
- m_ScriptEngine.Log.Debug(m_ScriptEngine.ScriptEngineName, "Killed script execution thread. Remaining thread count: " + eventQueueThreads.Count);
+ m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: Killed script execution thread. Remaining thread count: " + eventQueueThreads.Count);
}
#endregion
@@ -334,8 +332,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void AddToObjectQueue(uint localID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param)
{
// Determine all scripts in Object and add to their queue
- //myScriptEngine.m_logger.Verbose(ScriptEngineName, "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
-
+ //myScriptEngine.log.Info("[" + ScriptEngineName + "]: EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
// Do we have any scripts in this object at all? If not, return
if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false)
@@ -368,8 +365,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
if (eventQueue.Count >= EventExecutionMaxQueueSize)
{
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "ERROR: Event execution queue item count is at " + eventQueue.Count + ". Config variable \"EventExecutionMaxQueueSize\" is set to " + EventExecutionMaxQueueSize + ", so ignoring new event.");
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "Event ignored: localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: ERROR: Event execution queue item count is at " + eventQueue.Count + ". Config variable \"EventExecutionMaxQueueSize\" is set to " + EventExecutionMaxQueueSize + ", so ignoring new event.");
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Event ignored: localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
return;
}
@@ -456,6 +453,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
}
#endregion
+
///
/// If set to true then threads and stuff should try to make a graceful exit
///
@@ -465,6 +463,5 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
set { _PleaseShutdown = value; }
}
private bool _PleaseShutdown = false;
-
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
index ee38306..afa1839 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueThreadClass.cs
@@ -96,7 +96,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
break;
default:
MyThreadPriority = ThreadPriority.BelowNormal; // Default
- eventQueueManager.m_ScriptEngine.Log.Error("ScriptEngineBase", "Unknown priority type \"" + pri + "\" in config file. Defaulting to \"BelowNormal\".");
+ eventQueueManager.m_ScriptEngine.Log.Error("[ScriptEngineBase]: Unknown priority type \"" + pri + "\" in config file. Defaulting to \"BelowNormal\".");
break;
}
@@ -137,7 +137,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
catch (Exception)
{
- //myScriptEngine.Log.Verbose(ScriptEngineName, "EventQueueManager Exception killing worker thread: " + e.ToString());
+ //myScriptEngine.Log.Info("[" + ScriptEngineName + "]: EventQueueManager Exception killing worker thread: " + e.ToString());
}
}
}
@@ -147,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
///
private void EventQueueThreadLoop()
{
- //myScriptEngine.m_logger.Verbose(ScriptEngineName, "EventQueueManager Worker thread spawned");
+ //myScriptEngine.Log.Info("[" + ScriptEngineName + "]: EventQueueManager Worker thread spawned");
try
{
while (true)
@@ -196,7 +196,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
else
{
// Something in queue, process
- //myScriptEngine.m_logger.Verbose(ScriptEngineName, "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
+ //myScriptEngine.Log.Info("[" + ScriptEngineName + "]: Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
// OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
lock (eventQueueManager.queueLock)
@@ -228,12 +228,12 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
try
{
#if DEBUG
- eventQueueManager.m_ScriptEngine.Log.Debug(ScriptEngineName,
- "Executing event:\r\n"
- + "QIS.localID: " + QIS.localID
- + ", QIS.itemID: " + QIS.itemID
- + ", QIS.functionName: " +
- QIS.functionName);
+ eventQueueManager.m_ScriptEngine.Log.Debug("[" + ScriptEngineName + "]: " +
+ "Executing event:\r\n"
+ + "QIS.localID: " + QIS.localID
+ + ", QIS.itemID: " + QIS.itemID
+ + ", QIS.functionName: " +
+ QIS.functionName);
#endif
LastExecutionStarted = DateTime.Now.Ticks;
KillCurrentScript = false;
@@ -284,9 +284,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
//else
//{
// T oconsole
- eventQueueManager.m_ScriptEngine.Log.Error(ScriptEngineName,
- "Unable to send text in-world:\r\n" +
- text);
+ eventQueueManager.m_ScriptEngine.Log.Error("[" + ScriptEngineName + "]: " +
+ "Unable to send text in-world:\r\n" +
+ text);
}
finally
{
@@ -309,17 +309,17 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
catch (ThreadAbortException tae)
{
- eventQueueManager.m_ScriptEngine.Log.Notice(ScriptEngineName, "ThreadAbortException while executing function.");
+ eventQueueManager.m_ScriptEngine.Log.Info("[" + ScriptEngineName + "]: ThreadAbortException while executing function.");
}
catch (Exception e)
{
- eventQueueManager.m_ScriptEngine.Log.Error(ScriptEngineName, "Exception in EventQueueThreadLoop: " + e.ToString());
+ eventQueueManager.m_ScriptEngine.Log.Error("[" + ScriptEngineName + "]: Exception in EventQueueThreadLoop: " + e.ToString());
}
} // while
} // try
catch (ThreadAbortException)
{
- //myScriptEngine.Log.Verbose(ScriptEngineName, "EventQueueManager Worker thread killed: " + tae.Message);
+ //myScriptEngine.Log.Info("[" + ScriptEngineName + "]: EventQueueManager Worker thread killed: " + tae.Message);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
index 4a119f0..ab4ea04 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/MaintenanceThread.cs
@@ -87,7 +87,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
private void StopMaintenanceThread()
{
#if DEBUG
- m_ScriptEngine.Log.Debug(m_ScriptEngine.ScriptEngineName, "StopMaintenanceThread() called");
+ m_ScriptEngine.Log.Debug("[" + m_ScriptEngine.ScriptEngineName + "]: StopMaintenanceThread() called");
#endif
PleaseShutdown = true;
Thread.Sleep(100);
@@ -103,7 +103,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
catch (Exception ex)
{
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "Exception stopping maintenence thread: " + ex.ToString());
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Exception stopping maintenence thread: " + ex.ToString());
}
}
@@ -113,8 +113,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public void MaintenanceLoop()
{
if (m_ScriptEngine.m_EventQueueManager.maxFunctionExecutionTimens < MaintenanceLoopms)
- m_ScriptEngine.Log.Warn(m_ScriptEngine.ScriptEngineName,
- "Configuration error: MaxEventExecutionTimeMs is less than MaintenanceLoopms. The Maintenance Loop will only check scripts once per run.");
+ m_ScriptEngine.Log.Warn("[" + m_ScriptEngine.ScriptEngineName + "]: " +
+ "Configuration error: MaxEventExecutionTimeMs is less than MaintenanceLoopms. The Maintenance Loop will only check scripts once per run.");
long Last_maxFunctionExecutionTimens = 0; // DateTime.Now.Ticks;
long Last_ReReadConfigFilens = DateTime.Now.Ticks;
@@ -170,7 +170,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
}
catch (Exception ex)
{
- m_ScriptEngine.Log.Error(m_ScriptEngine.ScriptEngineName, "Exception in MaintenanceLoopThread. Thread will recover after 5 sec throttle. Exception: " + ex.ToString());
+ m_ScriptEngine.Log.Error("[" + m_ScriptEngine.ScriptEngineName + "]: Exception in MaintenanceLoopThread. Thread will recover after 5 sec throttle. Exception: " + ex.ToString());
Thread.Sleep(5000);
}
}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
index f09e631..78d9f7d 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
@@ -26,7 +26,6 @@
*
*/
-
using System;
using System.IO;
using Nini.Config;
@@ -45,6 +44,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
[Serializable]
public abstract class ScriptEngine : IRegionModule, OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.ScriptEngine, iScriptEngineFunctionModule
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
public Scene World;
public EventManager m_EventManager; // Handles and queues incoming events from OpenSim
public EventQueueManager m_EventQueueManager; // Executes events, handles script threads
@@ -73,7 +74,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
public abstract ScriptManager _GetScriptManager();
- private LogBase m_log;
+ public log4net.ILog Log
+ {
+ get { return m_log; }
+ }
public ScriptEngine()
{
@@ -81,25 +85,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
Common.mySE = this;
}
- public LogBase Log
- {
- get { return m_log; }
- }
-
- public void InitializeEngine(Scene Sceneworld, IConfigSource config, LogBase logger, bool HookUpToServer, ScriptManager newScriptManager)
+ public void InitializeEngine(Scene Sceneworld, IConfigSource config, bool HookUpToServer, ScriptManager newScriptManager)
{
World = Sceneworld;
- m_log = logger;
ConfigSource = config;
- Log.Verbose(ScriptEngineName, "ScriptEngine initializing");
+ m_log.Info("[" + ScriptEngineName + "]: ScriptEngine initializing");
// Make sure we have config
if (ConfigSource.Configs[ScriptEngineName] == null)
ConfigSource.AddConfig(ScriptEngineName);
ScriptConfigSource = ConfigSource.Configs[ScriptEngineName];
-
- //m_logger.Status(ScriptEngineName, "InitializeEngine");
+ //m_log.Info("[" + ScriptEngineName + "]: InitializeEngine");
// Create all objects we'll be using
m_EventQueueManager = new EventQueueManager(this);
@@ -111,11 +108,9 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
m_ASYNCLSLCommandManager = new AsyncLSLCommandManager(this);
m_MaintenanceThread = new MaintenanceThread(this);
- Log.Verbose(ScriptEngineName, "Reading configuration from config section \"" + ScriptEngineName + "\"");
+ m_log.Info("[" + ScriptEngineName + "]: Reading configuration from config section \"" + ScriptEngineName + "\"");
ReadConfig();
-
-
// Should we iterate the region for scripts that needs starting?
// Or can we assume we are loaded before anything else so we can use proper events?
}
@@ -129,10 +124,11 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
return this.m_EventManager;
}
+
public void ReadConfig()
{
//#if DEBUG
-// Log.Debug(ScriptEngineName, "Refreshing configuration for all modules");
+// m_log.Debug("[" + ScriptEngineName + "]: Refreshing configuration for all modules");
//#endif
RefreshConfigFileSeconds = ScriptConfigSource.GetInt("RefreshConfig", 30);
@@ -153,10 +149,8 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
if (m_AppDomainManager != null) m_AppDomainManager.ReadConfig();
if (m_ASYNCLSLCommandManager != null) m_ASYNCLSLCommandManager.ReadConfig();
if (m_MaintenanceThread != null) m_MaintenanceThread.ReadConfig();
-
}
-
#region IRegionModule
public abstract void Initialise(Scene scene, IConfigSource config);
@@ -179,8 +173,6 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
get { return false; }
}
-
-
#endregion
///
@@ -194,4 +186,4 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
private bool _PleaseShutdown = false;
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index 6661fcc..12d26fc 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -249,7 +249,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
{
if (LUQueue.Count >= LoadUnloadMaxQueueSize)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "ERROR: Load/unload queue item count is at " + LUQueue.Count + ". Config variable \"LoadUnloadMaxQueueSize\" is set to " + LoadUnloadMaxQueueSize + ", so ignoring new script.");
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: ERROR: Load/unload queue item count is at " + LUQueue.Count + ". Config variable \"LoadUnloadMaxQueueSize\" is set to " + LoadUnloadMaxQueueSize + ", so ignoring new script.");
return;
}
@@ -299,7 +299,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
Console.WriteLine("ScriptEngine: Inside ExecuteEvent for event " + FunctionName);
#endif
// Execute a function in the script
- //m_scriptEngine.Log.Verbose(ScriptEngineName, "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
+ //m_scriptEngine.Log.Info("[" + ScriptEngineName + "]: Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
//ScriptBaseInterface Script = (ScriptBaseInterface)GetScript(localID, itemID);
IScript Script = GetScript(localID, itemID);
if (Script == null)
@@ -418,4 +418,4 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
private bool _PleaseShutdown = false;
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
index 38f7e7b..d5031c8 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptServerInterfaces.cs
@@ -79,12 +79,12 @@ namespace OpenSim.Region.ScriptEngine.Common
{
RemoteEvents Events();
}
+
public interface ScriptEngine
{
RemoteEvents EventManager();
- void InitializeEngine(Scene Sceneworld, IConfigSource config, LogBase logger, bool DontHookUp, ScriptManager newScriptManager);
+ void InitializeEngine(Scene Sceneworld, IConfigSource config, bool DontHookUp, ScriptManager newScriptManager);
ScriptManager GetScriptManager();
}
-
}
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
index 3451cce..2f985e4 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/LSL/Compiler.cs
@@ -40,7 +40,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
{
public class Compiler
{
-
// * Uses "LSL2Converter" to convert LSL to C# if necessary.
// * Compiles C#-code into an assembly
// * Returns assembly name ready for AppDomain load.
@@ -113,7 +112,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
AllowedCompilers.Clear();
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Allowed languages: " + allowComp);
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Allowed languages: " + allowComp);
#endif
@@ -122,18 +121,18 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
string strlan = strl.Trim(" \t".ToCharArray()).ToLower();
if (!LanguageMapping.ContainsKey(strlan))
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Config error. Compiler is unable to recongnize language type \"" + strlan + "\" specified in \"AllowedCompilers\".");
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Config error. Compiler is unable to recongnize language type \"" + strlan + "\" specified in \"AllowedCompilers\".");
}
else
{
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Config OK. Compiler recongnized language type \"" + strlan + "\" specified in \"AllowedCompilers\".");
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Config OK. Compiler recongnized language type \"" + strlan + "\" specified in \"AllowedCompilers\".");
#endif
}
AllowedCompilers.Add(strlan, true);
}
if (AllowedCompilers.Count == 0)
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Config error. Compiler could not recognize any language in \"AllowedCompilers\". Scripts will not be executed!");
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Config error. Compiler could not recognize any language in \"AllowedCompilers\". Scripts will not be executed!");
// Default language
string defaultCompileLanguage = m_scriptEngine.ScriptConfigSource.GetString("DefaultCompileLanguage", "lsl").ToLower();
@@ -141,22 +140,22 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
// Is this language recognized at all?
if (!LanguageMapping.ContainsKey(defaultCompileLanguage))
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName,
- "Config error. Default language \"" + defaultCompileLanguage + "\" specified in \"DefaultCompileLanguage\" is not recognized as a valid language. Changing default to: \"lsl\".");
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: " +
+ "Config error. Default language \"" + defaultCompileLanguage + "\" specified in \"DefaultCompileLanguage\" is not recognized as a valid language. Changing default to: \"lsl\".");
defaultCompileLanguage = "lsl";
}
// Is this language in allow-list?
if (!AllowedCompilers.ContainsKey(defaultCompileLanguage))
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName,
- "Config error. Default language \"" + defaultCompileLanguage + "\"specified in \"DefaultCompileLanguage\" is not in list of \"AllowedCompilers\". Scripts may not be executed!");
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: " +
+ "Config error. Default language \"" + defaultCompileLanguage + "\"specified in \"DefaultCompileLanguage\" is not in list of \"AllowedCompilers\". Scripts may not be executed!");
}
else
{
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName,
- "Config OK. Default language \"" + defaultCompileLanguage + "\" specified in \"DefaultCompileLanguage\" is recognized as a valid language.");
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: " +
+ "Config OK. Default language \"" + defaultCompileLanguage + "\" specified in \"DefaultCompileLanguage\" is recognized as a valid language.");
#endif
// LANGUAGE IS IN ALLOW-LIST
DefaultCompileLanguage = LanguageMapping[defaultCompileLanguage];
@@ -181,13 +180,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
}
catch (Exception ex)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Exception trying to create ScriptEngine directory \"" + ScriptEnginesPath + "\": " + ex.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Exception trying to create ScriptEngine directory \"" + ScriptEnginesPath + "\": " + ex.ToString());
}
}
foreach (string file in Directory.GetFiles(ScriptEnginesPath))
{
- //m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "FILE FOUND: " + file);
+ //m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: FILE FOUND: " + file);
if (file.ToLower().StartsWith(FilePrefix + "_compiled_") ||
file.ToLower().StartsWith(FilePrefix + "_source_"))
@@ -198,7 +197,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
}
catch (Exception ex)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Exception trying delete old script file \"" + file + "\": " + ex.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Exception trying delete old script file \"" + file + "\": " + ex.ToString());
}
}
@@ -313,7 +312,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
Path.Combine("ScriptEngines",
FilePrefix + "_compiled_" + instanceID.ToString() + "_" + scriptCompileCounter.ToString() + ".dll");
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Starting compile of \"" + OutFile + "\".");
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Starting compile of \"" + OutFile + "\".");
#endif
try
{
@@ -321,7 +320,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
}
catch (Exception e)
{
- //m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Unable to delete old existring script-file before writing new. Compile aborted: " + e.ToString());
+ //m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Unable to delete old existring script-file before writing new. Compile aborted: " + e.ToString());
throw new Exception("Unable to delete old existring script-file before writing new. Compile aborted: " + e.ToString());
}
//string OutFile = Path.Combine("ScriptEngines", "SecondLife.Script.dll");
@@ -338,7 +337,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL
}
catch (Exception ex)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Exception while trying to write script source to file \"" + srcFileName + "\": " + ex.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Exception while trying to write script source to file \"" + srcFileName + "\": " + ex.ToString());
}
}
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
index 720f946..514c550 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs
@@ -40,7 +40,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
public override void Initialise(Scene scene, IConfigSource config)
{
ConfigSource = config;
- InitializeEngine(scene, config, MainLog.Instance, true, GetScriptManager());
+ InitializeEngine(scene, config, true, GetScriptManager());
}
public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager()
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
index 61da6ef..c39d376 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs
@@ -26,6 +26,7 @@
*
*/
/* Original code: Tedd Hansen */
+
using System;
using libsecondlife;
using OpenSim.Framework;
@@ -60,7 +61,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
public override void _StartScript(uint localID, LLUUID itemID, string Script)
{
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID);
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: ScriptManager StartScript: localID: " + localID + ", itemID: " + itemID);
//IScriptHost root = host.GetRoot();
@@ -85,7 +86,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
CompiledScript = m_scriptEngine.m_AppDomainManager.LoadScript(ScriptSource);
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before);
+ m_scriptEngine.Log.Debug(String.Format("[" + m_scriptEngine.ScriptEngineName + "]: Script " + itemID + " occupies {0} bytes", GC.GetTotalMemory(true) - before));
#endif
CompiledScript.Source = Script;
@@ -106,7 +107,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
catch (Exception e)
{
- //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString());
+ //m_scriptEngine.Log.Error("[ScriptEngine]: Error compiling script: " + e.ToString());
try
{
// DISPLAY ERROR INWORLD
@@ -118,9 +119,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
catch (Exception e2)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Error displaying error in-world: " + e2.ToString());
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName,
- "Errormessage: Error compiling script:\r\n" + e.Message.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Error displaying error in-world: " + e2.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: " +
+ "Errormessage: Error compiling script:\r\n" + e.Message.ToString());
}
}
}
@@ -129,7 +130,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
{
// Stop script
#if DEBUG
- m_scriptEngine.Log.Debug(m_scriptEngine.ScriptEngineName, "Stop script localID: " + localID + " LLUID: " + itemID.ToString());
+ m_scriptEngine.Log.Debug("[" + m_scriptEngine.ScriptEngineName + "]: Stop script localID: " + localID + " LLUID: " + itemID.ToString());
#endif
// Stop long command on script
@@ -142,7 +143,6 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
// TEMP: First serialize it
//GetSerializedScript(localID, itemID);
-
try
{
// Get AppDomain
@@ -156,10 +156,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine
}
catch (Exception e)
{
- m_scriptEngine.Log.Error(m_scriptEngine.ScriptEngineName, "Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() +
- ": " + e.ToString());
+ m_scriptEngine.Log.Error("[" + m_scriptEngine.ScriptEngineName + "]: Exception stopping script localID: " + localID + " LLUID: " + itemID.ToString() +
+ ": " + e.ToString());
}
}
-
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptEngine.cs
index 45dfd9e..2a846a9 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptEngine.cs
@@ -44,7 +44,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
// We need to override a few things for our DotNetEngine
public override void Initialise(Scene scene, IConfigSource config)
{
- InitializeEngine(scene, config, MainLog.Instance, true, GetScriptManager());
+ InitializeEngine(scene, config, true, GetScriptManager());
}
public override OpenSim.Region.ScriptEngine.Common.ScriptEngineBase.ScriptManager _GetScriptManager()
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
index 652c24c..db81487 100644
--- a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs
@@ -101,7 +101,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
}
catch (Exception e)
{
- //m_scriptEngine.Log.Error("ScriptEngine", "Error compiling script: " + e.ToString());
+ //m_scriptEngine.Log.Error("[ScriptEngine]: Error compiling script: " + e.ToString());
try
{
// DISPLAY ERROR INWORLD
@@ -113,9 +113,9 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
}
catch (Exception e2)
{
- m_scriptEngine.Log.Error("ScriptEngine", "Error displaying error in-world: " + e2.ToString());
- m_scriptEngine.Log.Error("ScriptEngine",
- "Errormessage: Error compiling script:\r\n" + e.Message.ToString());
+ m_scriptEngine.Log.Error("[ScriptEngine]: Error displaying error in-world: " + e2.ToString());
+ m_scriptEngine.Log.Error("[ScriptEngine]: " +
+ "Errormessage: Error compiling script:\r\n" + e.Message.ToString());
}
}
}
@@ -125,7 +125,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
// Stop script
Console.WriteLine("Stop script localID: " + localID + " LLUID: " + itemID.ToString());
-
// Stop long command on script
m_scriptEngine.m_ASYNCLSLCommandManager.RemoveScript(localID, itemID);
@@ -136,7 +135,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
// TEMP: First serialize it
//GetSerializedScript(localID, itemID);
-
try
{
// Get AppDomain
@@ -157,7 +155,6 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine
public override void Initialize()
{
-
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs b/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs
index bac32cb..e65b8ff 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/Common.cs
@@ -26,6 +26,7 @@
*
*/
/* Original code: Tedd Hansen */
+
namespace OpenSim.Region.ScriptEngine.RemoteServer
{
public static class Common
@@ -43,15 +44,15 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
public static void SendToDebug(string Message)
{
//if (Debug == true)
- mySE.Log.Verbose("ScriptEngine", "Debug: " + Message);
+ mySE.Log.Info("[ScriptEngine]: Debug: " + Message);
//SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
public static void SendToLog(string Message)
{
//if (Debug == true)
- mySE.Log.Verbose("ScriptEngine", "LOG: " + Message);
+ mySE.Log.Info("[ScriptEngine]: LOG: " + Message);
//SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
}
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
index 047ff2e..971982c 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/EventManager.cs
@@ -26,6 +26,7 @@
*
*/
/* Original code: Tedd Hansen */
+
using System;
using libsecondlife;
using OpenSim.Framework;
@@ -40,7 +41,6 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
[Serializable]
internal class EventManager
{
-
System.Collections.Generic.Dictionary remoteScript = new System.Collections.Generic.Dictionary();
TCPClient m_TCPClient;
TRPC_Remote RPC;
@@ -59,32 +59,28 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
RPC.ReceiveCommand += new TRPC_Remote.ReceiveCommandDelegate(RPC_ReceiveCommand);
myScriptServerID = m_TCPClient.ConnectAndReturnID(remoteHost, remotePort);
- myScriptEngine.Log.Verbose("RemoteEngine", "Hooking up to server events");
+ myScriptEngine.Log.Info("[RemoteEngine]: Hooking up to server events");
//myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
//myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
-
-
}
void RPC_ReceiveCommand(int ID, string Command, params object[] p)
{
- myScriptEngine.Log.Notice("REMOTESERVER", "Received command: '" + Command + "'");
+ myScriptEngine.Log.Info("[REMOTESERVER]: Received command: '" + Command + "'");
if (p != null)
{
for (int i = 0; i < p.Length; i++)
{
- myScriptEngine.Log.Notice("REMOTESERVER", "Param " + i + ": " + p[i].ToString());
+ myScriptEngine.Log.Info("[REMOTESERVER]: Param " + i + ": " + p[i].ToString());
}
}
-
}
-
public void OnRezScript(uint localID, LLUUID itemID, string script)
{
// WE ARE CREATING A NEW SCRIPT ... CREATE SCRIPT, GET A REMOTEID THAT WE MAP FROM LOCALID
- myScriptEngine.Log.Verbose("RemoteEngine", "Creating new script (with connection)");
+ myScriptEngine.Log.Info("[RemoteEngine]: Creating new script (with connection)");
// Temp for now: We have one connection only - this is hardcoded in myScriptServerID
RPC.SendCommand(myScriptServerID, "OnRezScript", localID, itemID.ToString(), script);
@@ -92,18 +88,15 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
//ScriptServerInterfaces.ServerRemotingObject obj = myScriptEngine.m_RemoteServer.Connect("localhost", 1234);
//remoteScript.Add(localID, obj);
//remoteScript[localID].Events().OnRezScript(localID, itemID, script);
-
-
}
public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
{
- //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient);
+ //remoteScript[localID].Events.touch_start(localID, offsetPos, remoteClient);
RPC.SendCommand(myScriptServerID, "touch_start", offsetPos, "How to transfer IClientAPI?");
}
-
// PLACEHOLDERS -- CODE WILL CHANGE!
@@ -266,6 +259,5 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
//{
// remoteScript[localID].Events.http_response(localID, itemID);
//}
-
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
index d0dc7ab..8d27251 100644
--- a/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/RemoteServer/ScriptEngine.cs
@@ -26,6 +26,7 @@
*
*/
/* Original code: Tedd Hansen */
+
using System;
using Nini.Config;
using OpenSim.Framework.Console;
@@ -41,28 +42,27 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
[Serializable]
public class ScriptEngine : IRegionModule
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
internal Scene World;
internal EventManager m_EventManager; // Handles and queues incoming events from OpenSim
internal RemoteServer m_RemoteServer; // Handles connections to remote servers
- private LogBase m_log;
-
public ScriptEngine()
{
Common.mySE = this;
}
- public LogBase Log
+ public log4net.ILog Log
{
get { return m_log; }
}
- public void InitializeEngine(Scene Sceneworld, LogBase logger)
+ public void InitializeEngine(Scene Sceneworld)
{
World = Sceneworld;
- m_log = logger;
- Log.Verbose("ScriptEngine", "RemoteEngine (Remote Script Server) initializing");
+ m_log.Info("[ScriptEngine]: RemoteEngine (Remote Script Server) initializing");
// Create all objects we'll be using
m_EventManager = new EventManager(this);
m_RemoteServer = new RemoteServer();
@@ -74,12 +74,11 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
// We are shutting down
}
-
#region IRegionModule
public void Initialise(Scene scene, IConfigSource config)
{
- InitializeEngine(scene, MainLog.Instance);
+ InitializeEngine(scene);
}
public void PostInitialise()
@@ -101,6 +100,5 @@ namespace OpenSim.Region.ScriptEngine.RemoteServer
}
#endregion
-
}
-}
\ No newline at end of file
+}
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
index 5125709..992f931 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.DB4o/DB4oDataStore.cs
@@ -42,9 +42,10 @@ using Db4objects.Db4o.Query;
namespace OpenSim.DataStore.DB4oStorage
{
-
public class SceneObjectQuery : Predicate
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private LLUUID globalIDSearch;
public SceneObjectQuery(LLUUID find)
@@ -58,17 +59,14 @@ namespace OpenSim.DataStore.DB4oStorage
}
}
-
public class DB4oDataStore : IRegionDataStore
{
private IObjectContainer db;
public void Initialise(string dbfile, string dbname)
{
- MainLog.Instance.Verbose("DATASTORE", "DB4O - Opening " + dbfile);
+ m_log.Info("[DATASTORE]: DB4O - Opening " + dbfile);
db = Db4oFactory.OpenFile(dbfile);
-
- return;
}
public void StoreObject(SceneObjectGroup obj, LLUUID regionUUID)
@@ -91,7 +89,7 @@ namespace OpenSim.DataStore.DB4oStorage
IObjectSet result = db.Get(typeof(SceneObjectGroup));
List retvals = new List();
- MainLog.Instance.Verbose("DATASTORE", "DB4O - LoadObjects found " + result.Count.ToString() + " objects");
+ m_log.Info("[DATASTORE]: DB4O - LoadObjects found " + result.Count.ToString() + " objects");
foreach (Object obj in result)
{
@@ -103,7 +101,6 @@ namespace OpenSim.DataStore.DB4oStorage
public void StoreTerrain(double[,] ter)
{
-
}
public double[,] LoadTerrain()
@@ -113,12 +110,10 @@ namespace OpenSim.DataStore.DB4oStorage
public void RemoveLandObject(uint id)
{
-
}
public void StoreParcel(Land parcel)
{
-
}
public List LoadLandObjects()
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index 28df4e7..6a79c8a 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -43,6 +43,8 @@ namespace OpenSim.DataStore.MSSQL
{
public class MSSQLDataStore : IRegionDataStore
{
+ private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
+
private const string primSelect = "select * from prims";
private const string shapeSelect = "select * from primshapes";
private const string terrainSelect = "select * from terrain";
@@ -68,7 +70,7 @@ namespace OpenSim.DataStore.MSSQL
ds = new DataSet();
- MainLog.Instance.Verbose("DATASTORE", "MSSQL - connecting: " + settingInitialCatalog);
+ m_log.Info("[DATASTORE]: MSSQL - connecting: " + settingInitialCatalog);
SqlConnection conn = new SqlConnection(connectionString);
SqlCommand primSelectCmd = new SqlCommand(primSelect, conn);
primDa = new SqlDataAdapter(primSelectCmd);
@@ -109,7 +111,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (Exception)
{
- MainLog.Instance.Verbose("DATASTORE", "Caught fill error on primshapes table");
+ m_log.Info("[DATASTORE]: Caught fill error on primshapes table");
}
try
{
@@ -117,7 +119,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (Exception)
{
- MainLog.Instance.Verbose("DATASTORE", "Caught fill error on terrain table");
+ m_log.Info("[DATASTORE]: Caught fill error on terrain table");
}
return;
}
@@ -129,18 +131,18 @@ namespace OpenSim.DataStore.MSSQL
{
foreach (SceneObjectPart prim in obj.Children.Values)
{
- MainLog.Instance.Verbose("DATASTORE", "Adding obj: " + obj.UUID + " to region: " + regionUUID);
+ m_log.Info("[DATASTORE]: Adding obj: " + obj.UUID + " to region: " + regionUUID);
addPrim(prim, obj.UUID, regionUUID);
}
}
Commit();
- // MainLog.Instance.Verbose("Dump of prims:", ds.GetXml());
+ // m_log.Info("Dump of prims:", ds.GetXml());
}
public void RemoveObject(LLUUID obj, LLUUID regionUUID)
{
- MainLog.Instance.Verbose("DATASTORE", "Removing obj: {0} from region: {1}", obj.UUID, regionUUID);
+ m_log.Info(String.Format("[DATASTORE]: Removing obj: {0} from region: {1}", obj.UUID, regionUUID));
DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["primshapes"];
@@ -179,7 +181,7 @@ namespace OpenSim.DataStore.MSSQL
lock (ds)
{
DataRow[] primsForRegion = prims.Select(byRegion, orderByParent);
- MainLog.Instance.Verbose("DATASTORE",
+ m_log.Info("[DATASTORE]: " +
"Loaded " + primsForRegion.Length + " prims for region: " + regionUUID);
foreach (DataRow primRow in primsForRegion)
@@ -199,7 +201,7 @@ namespace OpenSim.DataStore.MSSQL
}
else
{
- MainLog.Instance.Notice(
+ m_log.Info(
"No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default;
}
@@ -219,7 +221,7 @@ namespace OpenSim.DataStore.MSSQL
}
else
{
- MainLog.Instance.Notice(
+ m_log.Info(
"No shape found for prim in storage, so setting default box shape");
prim.Shape = PrimitiveBaseShape.Default;
}
@@ -228,11 +230,11 @@ namespace OpenSim.DataStore.MSSQL
}
catch (Exception e)
{
- MainLog.Instance.Error("DATASTORE", "Failed create prim object, exception and data follows");
- MainLog.Instance.Verbose("DATASTORE", e.ToString());
+ m_log.Error("[DATASTORE]: Failed create prim object, exception and data follows");
+ m_log.Info("[DATASTORE]: " + e.ToString());
foreach (DataColumn col in prims.Columns)
{
- MainLog.Instance.Verbose("DATASTORE", "Col: " + col.ColumnName + " => " + primRow[col]);
+ m_log.Info("[DATASTORE]: Col: " + col.ColumnName + " => " + primRow[col]);
}
}
}
@@ -245,7 +247,7 @@ namespace OpenSim.DataStore.MSSQL
{
int revision = Util.UnixTimeSinceEpoch();
- MainLog.Instance.Verbose("DATASTORE", "Storing terrain revision r" + revision.ToString());
+ m_log.Info("[DATASTORE]: Storing terrain revision r" + revision.ToString());
DataTable terrain = ds.Tables["terrain"];
lock (ds)
@@ -288,12 +290,12 @@ namespace OpenSim.DataStore.MSSQL
}
else
{
- MainLog.Instance.Verbose("DATASTORE", "No terrain found for region");
+ m_log.Info("[DATASTORE]: No terrain found for region");
return null;
}
- MainLog.Instance.Verbose("DATASTORE", "Loaded terrain revision r" + rev.ToString());
+ m_log.Info("[DATASTORE]: Loaded terrain revision r" + rev.ToString());
}
return terret;
@@ -950,7 +952,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (SqlException)
{
- MainLog.Instance.Warn("MSSQL", "Primitives Table Already Exists");
+ m_log.Warn("[MSSQL]: Primitives Table Already Exists");
}
try
@@ -960,7 +962,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (SqlException)
{
- MainLog.Instance.Warn("MSSQL", "Shapes Table Already Exists");
+ m_log.Warn("[MSSQL]: Shapes Table Already Exists");
}
try
@@ -970,7 +972,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (SqlException)
{
- MainLog.Instance.Warn("MSSQL", "Terrain Table Already Exists");
+ m_log.Warn("[MSSQL]: Terrain Table Already Exists");
}
conn.Close();
@@ -994,7 +996,7 @@ namespace OpenSim.DataStore.MSSQL
}
catch (SqlException)
{
- MainLog.Instance.Verbose("DATASTORE", "MSSQL Database doesn't exist... creating");
+ m_log.Info("[DATASTORE]: MSSQL Database doesn't exist... creating");
InitDB(conn);
}
@@ -1009,14 +1011,14 @@ namespace OpenSim.DataStore.MSSQL
}
catch (SqlException e)
{
- MainLog.Instance.Verbose("DATASTORE", e.ToString());
+ m_log.Info("[DATASTORE]: " + e.ToString());
}
foreach (DataColumn col in createPrimTable().Columns)
{
if (!tmpDS.Tables["prims"].Columns.Contains(col.ColumnName))
{
- MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName);
+ m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false;
}
}
@@ -1024,7 +1026,7 @@ namespace OpenSim.DataStore.MSSQL
{
if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName))
{
- MainLog.Instance.Verbose("DATASTORE", "Missing required column:" + col.ColumnName);
+ m_log.Info("[DATASTORE]: Missing required column:" + col.ColumnName);
return false;
}
}
@@ -1032,7 +1034,7 @@ namespace OpenSim.DataStore.MSSQL
{
if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName))
{
- MainLog.Instance.Verbose("DATASTORE", "Missing require column:" + col.ColumnName);
+ m_log.Info("[DATASTORE]: Missing require column:" + col.ColumnName);
return false;
}
}
diff --git a/OpenSim/Region/Terrain.BasicTerrain/Properties/AssemblyInfo.cs b/OpenSim/Region/Terrain.BasicTerrain/Properties/AssemblyInfo.cs
index 33537fa..219ab1c 100644
--- a/OpenSim/Region/Terrain.BasicTerrain/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/Terrain.BasicTerrain/Properties/AssemblyInfo.cs
@@ -62,4 +62,4 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below:
[assembly : AssemblyVersion("1.0.0.0")]
-[assembly : AssemblyFileVersion("1.0.0.0")]
\ No newline at end of file
+[assembly : AssemblyFileVersion("1.0.0.0")]
--
cgit v1.1