From 8f55b9d735fbc975ce7a4b54e972c17ffbfb1f49 Mon Sep 17 00:00:00 2001 From: Charles Krinke Date: Sun, 22 Feb 2009 20:52:55 +0000 Subject: Mantis#3218. Thank you kindly, TLaukkan (Tommil) for a patch that: * Added log4net dependency to physxplugin in prebuild.xml. * Added missing m_log fields to classes. * Replaced Console.WriteLine with appropriate m_log.Xxxx * Tested that nant test target runs succesfully. * Tested that local opensim sandbox starts up without errors. --- OpenSim/Data/MSSQL/MSSQLLogData.cs | 3 +- OpenSim/Data/MySQL/MySQLManager.cs | 2 - OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs | 7 +- OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs | 5 +- OpenSim/Data/MySQL/Tests/MySQLGridTest.cs | 8 +- OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs | 5 +- OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs | 7 +- OpenSim/Data/MySQL/Tests/MySQLUserTest.cs | 7 +- .../NHibernate/Tests/NHibernateMsSqlAssetTest.cs | 7 +- .../NHibernate/Tests/NHibernateMsSqlEstateTest.cs | 5 +- .../NHibernate/Tests/NHibernateMsSqlGridTest.cs | 7 +- .../Tests/NHibernateMsSqlInventoryTest.cs | 5 +- .../NHibernate/Tests/NHibernateMsSqlRegionTest.cs | 7 +- .../NHibernate/Tests/NHibernateMsSqlUserTest.cs | 7 +- .../NHibernate/Tests/NHibernateMySQLAssetTest.cs | 7 +- .../NHibernate/Tests/NHibernateMySQLGridTest.cs | 7 +- .../Tests/NHibernateMySQLInventoryTest.cs | 5 +- .../NHibernate/Tests/NHibernateMySQLRegionTest.cs | 7 +- .../NHibernate/Tests/NHibernateMySQLUserTest.cs | 7 +- .../NHibernate/Tests/NHibernateMySqlEstateTest.cs | 5 +- .../Tests/NHibernatePostgreSQLAssetTest.cs | 7 +- .../Tests/NHibernatePostgreSQLEstateTest.cs | 5 +- .../Tests/NHibernatePostgreSQLGridTest.cs | 7 +- .../Tests/NHibernatePostgreSQLInventoryTest.cs | 5 +- .../Tests/NHibernatePostgreSQLRegionTest.cs | 7 +- .../Tests/NHibernatePostgreSQLUserTest.cs | 7 +- .../NHibernate/Tests/NHibernateSQLiteAssetTest.cs | 7 +- .../NHibernate/Tests/NHibernateSQLiteEstateTest.cs | 5 +- .../NHibernate/Tests/NHibernateSQLiteGridTest.cs | 7 +- .../Tests/NHibernateSQLiteInventoryTest.cs | 5 +- .../NHibernate/Tests/NHibernateSQLiteRegionTest.cs | 7 +- .../NHibernate/Tests/NHibernateSQLiteUserTest.cs | 8 +- OpenSim/Data/Tests/BasicAssetTest.cs | 3 + OpenSim/Data/Tests/BasicEstateTest.cs | 3 + OpenSim/Data/Tests/BasicGridTest.cs | 3 + OpenSim/Data/Tests/BasicInventoryTest.cs | 3 + OpenSim/Data/Tests/BasicRegionTest.cs | 7 +- OpenSim/Data/Tests/BasicUserTest.cs | 3 + OpenSim/Framework/AgentCircuitManager.cs | 2 +- OpenSim/Framework/AvatarAppearance.cs | 12 +-- OpenSim/Framework/AvatarWearable.cs | 4 +- OpenSim/Framework/ChildAgentDataUpdate.cs | 8 +- .../Framework/Communications/Cache/AssetCache.cs | 4 +- .../Framework/Communications/Capabilities/Caps.cs | 4 +- OpenSim/Framework/Console/ConsoleBase.cs | 2 +- OpenSim/Framework/HGNetworkServersInfo.cs | 2 +- OpenSim/Framework/Util.cs | 6 +- OpenSim/Framework/WearableItem.cs | 2 +- OpenSim/Grid/AssetInventoryServer/Main.cs | 6 +- OpenSim/Grid/GridServer/GridRestModule.cs | 2 +- OpenSim/Grid/GridServer/GridXmlRpcModule.cs | 2 +- OpenSim/Grid/UserServer/UserManager.cs | 4 +- OpenSim/Region/Application/Application.cs | 8 +- OpenSim/Region/Application/ConfigurationLoader.cs | 2 +- OpenSim/Region/Application/HGOpenSimNode.cs | 10 +-- .../Region/ClientStack/LindenUDP/LLClientView.cs | 66 +++++++-------- .../Region/ClientStack/LindenUDP/LLImageManager.cs | 18 ++-- .../ClientStack/LindenUDP/Tests/TestLLUDPServer.cs | 6 +- .../Communications/Hypergrid/HGGridServices.cs | 98 +++++++++++----------- .../Communications/Local/LocalBackEndServices.cs | 10 +-- .../Communications/Local/LocalUserServices.cs | 5 +- .../AgentAssetTransactionsManager.cs | 6 +- .../AssetTransaction/AssetTransactionModule.cs | 10 +-- .../Agent/Capabilities/CapabilitiesModule.cs | 8 +- .../Agent/TextureDownload/TextureDownloadModule.cs | 2 +- .../Communications/Local/LocalInterregionComms.cs | 4 +- .../Communications/REST/RESTInterregionComms.cs | 44 +++++----- .../CoreModules/Hypergrid/HGWorldMapModule.cs | 2 +- .../InterGrid/OpenGridProtocolModule.cs | 4 +- .../DynamicTexture/DynamicTextureModule.cs | 9 +- .../Scripting/LoadImageURL/LoadImageURLModule.cs | 7 +- .../Scripting/VectorRender/VectorRenderModule.cs | 8 +- .../CoreModules/Scripting/XMLRPC/XMLRPCModule.cs | 2 +- .../World/Terrain/Effects/CookieCutter.cs | 12 ++- .../CoreModules/World/WorldMap/MapImageModule.cs | 2 +- .../World/WorldMap/TexturedMapTileRenderer.cs | 10 ++- .../Framework/Scenes/ChildAgentDataUpdate.cs | 11 ++- OpenSim/Region/Framework/Scenes/EntityBase.cs | 4 +- .../Hypergrid/HGSceneCommunicationService.cs | 2 +- .../Framework/Scenes/Scene.PacketHandlers.cs | 2 +- OpenSim/Region/Framework/Scenes/Scene.cs | 12 +-- .../Framework/Scenes/SceneCommunicationService.cs | 14 ++-- OpenSim/Region/Framework/Scenes/SceneManager.cs | 2 +- .../Framework/Scenes/SceneObjectGroup.Inventory.cs | 2 +- .../Region/Framework/Scenes/SceneObjectGroup.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 18 ++-- .../Framework/Scenes/SceneObjectPartInventory.cs | 2 +- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 36 ++++---- .../Framework/Scenes/Scripting/NullScriptHost.cs | 6 +- .../Scenes/Scripting/ScriptEngineLoader.cs | 4 +- .../Region/Framework/Scenes/SimStatsReporter.cs | 2 +- .../Scenes/Tests/SceneObjectBasicTests.cs | 4 +- .../Scenes/Tests/SceneObjectLinkingTests.cs | 60 ++++++------- .../Framework/Scenes/Types/BasicQuadTreeNode.cs | 2 +- .../Region/Framework/Scenes/Types/UpdateQueue.cs | 4 +- OpenSim/Region/Physics/Meshing/Meshmerizer.cs | 21 +++-- OpenSim/Region/Physics/Meshing/PrimMesher.cs | 11 ++- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 2 +- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 4 +- OpenSim/Region/Physics/OdePlugin/ODETestClass.cs | 12 ++- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 8 +- OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | 10 ++- .../ScriptEngine/DotNetEngine/EventQueueManager.cs | 2 +- .../ScriptEngine/DotNetEngine/MaintenanceThread.cs | 2 +- .../ScriptEngine/DotNetEngine/ScriptEngine.cs | 8 +- .../Shared/Api/Implementation/LSL_Api.cs | 14 ++-- .../Shared/Api/Implementation/OSSL_Api.cs | 2 +- .../Api/Implementation/Plugins/HttpRequest.cs | 2 +- .../Shared/Api/Implementation/Plugins/Timer.cs | 2 +- .../ScriptEngine/Shared/Api/Runtime/Executor.cs | 23 ++--- .../Shared/Api/Runtime/YieldProlog/YP.cs | 12 +-- .../Shared/CodeTools/YP2CSConverter.cs | 8 +- .../ScriptEngine/Shared/Instance/ScriptInstance.cs | 7 +- .../Region/ScriptEngine/XEngine/EventManager.cs | 2 +- .../DotNetEngine/Scheduler/BaseClassFactory.cs | 4 +- OpenSim/ScriptEngine/Shared/EventParams.cs | 12 ++- 116 files changed, 579 insertions(+), 410 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/MSSQL/MSSQLLogData.cs b/OpenSim/Data/MSSQL/MSSQLLogData.cs index 63cd605..1332305 100644 --- a/OpenSim/Data/MSSQL/MSSQLLogData.cs +++ b/OpenSim/Data/MSSQL/MSSQLLogData.cs @@ -112,8 +112,7 @@ namespace OpenSim.Data.MSSQL catch (Exception e) { //Are we not in a loop here - //m_log.Error(e.ToString()); - Console.WriteLine("[LOG DB] Error logging : " + e.Message); + m_log.Error("[LOG DB] Error logging : " + e.Message); } } } diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 3bb6857..2f14f16 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -1030,7 +1030,6 @@ namespace OpenSim.Data.MySQL { IDbCommand result = Query(sql, parameters); - //Console.WriteLine(result.CommandText); // int x; // if ((x = result.ExecuteNonQuery()) > 0) // { @@ -1123,7 +1122,6 @@ namespace OpenSim.Data.MySQL { IDbCommand result = Query(sql, parameters); - //Console.WriteLine(result.CommandText); // int x; // if ((x = result.ExecuteNonQuery()) > 0) // { diff --git a/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs b/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs index d03e66c..514e04e 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLAssetTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLAssetTest : BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -73,4 +76,4 @@ namespace OpenSim.Data.MySQL.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs b/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs index f148385..79fcc2d 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLEstateTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLEstateTest : BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -56,7 +59,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error("Exception {0}", e); Assert.Ignore(); } } diff --git a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs index 953294f..fd71022 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLGridTest.cs @@ -28,12 +28,16 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLGridTest : BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -54,7 +58,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error("Exception {0}", e); Assert.Ignore(); } } @@ -73,4 +77,4 @@ namespace OpenSim.Data.MySQL.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs index e03e38d..c7799e5 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLInventoryTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLInventoryTest : BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error("Exception {0}", e); Assert.Ignore(); } } diff --git a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs index 5cce53b..77964d3 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLRegionTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLRegionTest : BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error("Exception {0}", e); Assert.Ignore(); } } @@ -87,4 +90,4 @@ namespace OpenSim.Data.MySQL.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/MySQL/Tests/MySQLUserTest.cs b/OpenSim/Data/MySQL/Tests/MySQLUserTest.cs index b74617e..449ce4a 100644 --- a/OpenSim/Data/MySQL/Tests/MySQLUserTest.cs +++ b/OpenSim/Data/MySQL/Tests/MySQLUserTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.MySQL.Tests { [TestFixture] public class MySQLUserTest : BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public MySQLManager database; public string connect = "Server=localhost;Port=3306;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;Pooling=false;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.MySQL.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error("Exception {0}", e); Assert.Ignore(); } } @@ -78,4 +81,4 @@ namespace OpenSim.Data.MySQL.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlAssetTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlAssetTest.cs index ace7e44..2c3980b 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlAssetTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlAssetTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlAssetTest : BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -55,7 +58,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -74,4 +77,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs index a44936b..7308a0e 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlEstateTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlEstateTest : BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -55,7 +58,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlGridTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlGridTest.cs index bb62b6f..2768a9e 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlGridTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlGridTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlGridTest : BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlInventoryTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlInventoryTest.cs index 6fc8abf..41c0957 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlInventoryTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlInventoryTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlInventoryTest : BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlRegionTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlRegionTest.cs index 4d0e64d..beff3b9 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlRegionTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlRegionTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlRegionTest : BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -55,7 +58,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -74,4 +77,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlUserTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlUserTest.cs index 19fd248..b09cbe6 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlUserTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMsSqlUserTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMsSqlUserTest : BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLAssetTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLAssetTest.cs index 8bec0d3..17c65d6 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLAssetTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLAssetTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLAssetTest : BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -73,4 +76,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLGridTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLGridTest.cs index 4c966f5..6f5ed5f 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLGridTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLGridTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLGridTest : BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLInventoryTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLInventoryTest.cs index 7f2ee4a..a7f5f5a 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLInventoryTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLInventoryTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLInventoryTest : BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLRegionTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLRegionTest.cs index fa484a3..33faea6 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLRegionTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLRegionTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLRegionTest : BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -55,7 +58,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -74,4 +77,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLUserTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLUserTest.cs index c316bd4..5554229 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySQLUserTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySQLUserTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLUserTest : BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs index 939f1e9..86b9df6 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateMySqlEstateTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateMySQLEstateTest : BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "MySQL5Dialect;MySqlDataDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLAssetTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLAssetTest.cs index 6f86b0f..b51389a 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLAssetTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLAssetTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLAssetTest : BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -73,4 +76,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs index c0a76e7..1edf20a 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLEstateTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLEstateTest : BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLGridTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLGridTest.cs index 084de85..a47830d 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLGridTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLGridTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLGridTest : BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLInventoryTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLInventoryTest.cs index 869d24f..6016303 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLInventoryTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLInventoryTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLInventoryTest : BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLRegionTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLRegionTest.cs index 0e4fc82..8b4a8f5 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLRegionTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLRegionTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLRegionTest : BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -73,4 +76,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLUserTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLUserTest.cs index ffcb176..13d6c69 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLUserTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernatePostgreSQLUserTest.cs @@ -28,12 +28,15 @@ using System; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernatePostgreSQLUserTest : BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "PostgreSQLDialect;NpgsqlDriver;Server=localhost;Database=opensim-nunit;User ID=opensim-nunit;Password=opensim-nunit;"; @@ -54,7 +57,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -72,4 +75,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteAssetTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteAssetTest.cs index 1f98949..e89a14e 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteAssetTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteAssetTest.cs @@ -29,12 +29,15 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateSQLiteAssetTest : BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -56,7 +59,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -75,4 +78,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs index b51bff2..23fac9a 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteEstateTest.cs @@ -29,12 +29,15 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateSQLiteEstateTest : BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -56,7 +59,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteGridTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteGridTest.cs index b9fe8b9..2c3d4de 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteGridTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteGridTest.cs @@ -29,12 +29,15 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateSQLiteGridTest : BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; public string connect = "SQLiteDialect;SQLite20Driver;Data Source=" + Path.GetTempFileName() + ".db;Version=3"; @@ -55,7 +58,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -73,4 +76,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteInventoryTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteInventoryTest.cs index f31fc5b..adccd12 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteInventoryTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteInventoryTest.cs @@ -29,12 +29,15 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateSQLiteInventoryTest : BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -56,7 +59,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteRegionTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteRegionTest.cs index d902dfd..83f4d36 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteRegionTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteRegionTest.cs @@ -29,12 +29,15 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { [TestFixture] public class NHibernateSQLiteRegionTest : BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -56,7 +59,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -75,4 +78,4 @@ namespace OpenSim.Data.NHibernate.Tests } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteUserTest.cs b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteUserTest.cs index 78ab00f..a742c8e 100644 --- a/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteUserTest.cs +++ b/OpenSim/Data/NHibernate/Tests/NHibernateSQLiteUserTest.cs @@ -29,12 +29,16 @@ using System; using System.IO; using NUnit.Framework; using OpenSim.Data.Tests; +using log4net; +using System.Reflection; namespace OpenSim.Data.NHibernate.Tests { + [TestFixture] public class NHibernateSQLiteUserTest : BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string file; public NHibernateManager database; @@ -56,7 +60,7 @@ namespace OpenSim.Data.NHibernate.Tests } catch (Exception e) { - Console.WriteLine("Exception {0}", e); + m_log.Error(e.ToString()); Assert.Ignore(); } } @@ -74,4 +78,4 @@ namespace OpenSim.Data.NHibernate.Tests } } } -} \ No newline at end of file +} diff --git a/OpenSim/Data/Tests/BasicAssetTest.cs b/OpenSim/Data/Tests/BasicAssetTest.cs index 500b646..e7faebb 100644 --- a/OpenSim/Data/Tests/BasicAssetTest.cs +++ b/OpenSim/Data/Tests/BasicAssetTest.cs @@ -31,11 +31,14 @@ using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicAssetTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public AssetDataBase db; public UUID uuid1; public UUID uuid2; diff --git a/OpenSim/Data/Tests/BasicEstateTest.cs b/OpenSim/Data/Tests/BasicEstateTest.cs index f94ac46..f74a222 100644 --- a/OpenSim/Data/Tests/BasicEstateTest.cs +++ b/OpenSim/Data/Tests/BasicEstateTest.cs @@ -33,11 +33,14 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using System.Text; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicEstateTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public IEstateDataStore db; public IRegionDataStore regionDb; diff --git a/OpenSim/Data/Tests/BasicGridTest.cs b/OpenSim/Data/Tests/BasicGridTest.cs index e3256ff..8841bae 100644 --- a/OpenSim/Data/Tests/BasicGridTest.cs +++ b/OpenSim/Data/Tests/BasicGridTest.cs @@ -32,11 +32,14 @@ using log4net.Config; using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicGridTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public GridDataBase db; public UUID region1, region2, region3; public UUID zero = UUID.Zero; diff --git a/OpenSim/Data/Tests/BasicInventoryTest.cs b/OpenSim/Data/Tests/BasicInventoryTest.cs index 1b8a5de..e5642f1 100644 --- a/OpenSim/Data/Tests/BasicInventoryTest.cs +++ b/OpenSim/Data/Tests/BasicInventoryTest.cs @@ -31,11 +31,14 @@ using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicInventoryTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public IInventoryDataPlugin db; public UUID zero = UUID.Zero; diff --git a/OpenSim/Data/Tests/BasicRegionTest.cs b/OpenSim/Data/Tests/BasicRegionTest.cs index dfb2200..179692a 100644 --- a/OpenSim/Data/Tests/BasicRegionTest.cs +++ b/OpenSim/Data/Tests/BasicRegionTest.cs @@ -36,11 +36,14 @@ using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicRegionTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public IRegionDataStore db; public UUID zero = UUID.Zero; public UUID region1; @@ -139,7 +142,7 @@ namespace OpenSim.Data.Tests } catch (Exception e) { - Console.WriteLine("Exception in storing object {0} {1}", sog.ToString(), e); + m_log.Error(e.ToString()); Assert.Fail(); } @@ -149,7 +152,7 @@ namespace OpenSim.Data.Tests } catch (Exception e) { - Console.WriteLine("Exception in storing object {0} {1}", sog2.ToString(), e); + m_log.Error(e.ToString()); Assert.Fail(); } diff --git a/OpenSim/Data/Tests/BasicUserTest.cs b/OpenSim/Data/Tests/BasicUserTest.cs index f0a90a9..151faa2 100644 --- a/OpenSim/Data/Tests/BasicUserTest.cs +++ b/OpenSim/Data/Tests/BasicUserTest.cs @@ -35,11 +35,14 @@ using NUnit.Framework; using NUnit.Framework.SyntaxHelpers; using OpenMetaverse; using OpenSim.Framework; +using log4net; +using System.Reflection; namespace OpenSim.Data.Tests { public class BasicUserTest { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public IUserDataPlugin db; public UUID user1; public UUID user2; diff --git a/OpenSim/Framework/AgentCircuitManager.cs b/OpenSim/Framework/AgentCircuitManager.cs index cf333af..d5b33f7 100644 --- a/OpenSim/Framework/AgentCircuitManager.cs +++ b/OpenSim/Framework/AgentCircuitManager.cs @@ -122,7 +122,7 @@ namespace OpenSim.Framework AgentCircuits[(uint) agentData.circuitcode].SecureSessionID = agentData.SecureSessionID; AgentCircuits[(uint) agentData.circuitcode].SessionID = agentData.SessionID; - // Console.WriteLine("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); + // m_log.Debug("update user start pos is " + agentData.startpos.X + " , " + agentData.startpos.Y + " , " + agentData.startpos.Z); } } diff --git a/OpenSim/Framework/AvatarAppearance.cs b/OpenSim/Framework/AvatarAppearance.cs index d8fcf74..a6cec76 100644 --- a/OpenSim/Framework/AvatarAppearance.cs +++ b/OpenSim/Framework/AvatarAppearance.cs @@ -291,17 +291,17 @@ namespace OpenSim.Framework + 0.07f * (float)m_visualparams[78] / 255.0f // Shoe platform height + 0.3836f * (float)m_visualparams[125] / 255.0f // Leg length - m_avatarHeight / 2) * 0.3f - 0.04f; - //System.Console.WriteLine(">>>>>>> [APPEARANCE]: Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset); - //System.Console.WriteLine("------------- Set Appearance Texture ---------------"); + //m_log.Debug(">>>>>>> [APPEARANCE]: Height {0} Hip offset {1}", m_avatarHeight, m_hipOffset); + //m_log.Debug("------------- Set Appearance Texture ---------------"); //Primitive.TextureEntryFace[] faces = Texture.FaceTextures; //foreach (Primitive.TextureEntryFace face in faces) //{ // if (face != null) - // System.Console.WriteLine(" ++ " + face.TextureID); + // m_log.Debug(" ++ " + face.TextureID); // else - // System.Console.WriteLine(" ++ NULL "); + // m_log.Debug(" ++ NULL "); //} - //System.Console.WriteLine("----------------------------"); + //m_log.Debug("----------------------------"); } @@ -350,7 +350,7 @@ namespace OpenSim.Framework m_avatarHeight = (float)info.GetValue("m_avatarHeight", typeof(float)); - //System.Console.WriteLine("AvatarAppearance Deserialize END"); + //m_log.Debug("AvatarAppearance Deserialize END"); } // this is used for OGS1 diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 52f162e..1d015e5 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -50,7 +50,7 @@ namespace OpenSim.Framework protected AvatarWearable(SerializationInfo info, StreamingContext context) { - //System.Console.WriteLine("AvatarWearable Deserialize BGN"); + //m_log.Debug("AvatarWearable Deserialize BGN"); if (info == null) { throw new ArgumentNullException("info"); @@ -59,7 +59,7 @@ namespace OpenSim.Framework AssetID = new UUID((Guid) info.GetValue("AssetID", typeof (Guid))); ItemID = new UUID((Guid) info.GetValue("ItemID", typeof (Guid))); - //System.Console.WriteLine("AvatarWearable Deserialize END"); + //m_log.Debug("AvatarWearable Deserialize END"); } public static AvatarWearable[] DefaultWearables diff --git a/OpenSim/Framework/ChildAgentDataUpdate.cs b/OpenSim/Framework/ChildAgentDataUpdate.cs index 6752412..0060fef 100644 --- a/OpenSim/Framework/ChildAgentDataUpdate.cs +++ b/OpenSim/Framework/ChildAgentDataUpdate.cs @@ -576,10 +576,10 @@ namespace OpenSim.Framework public void Dump() { - System.Console.WriteLine("------------ AgentData ------------"); - System.Console.WriteLine("UUID: " + AgentID); - System.Console.WriteLine("Region: " + RegionHandle); - System.Console.WriteLine("Position: " + Position); + m_log.Info("------------ AgentData ------------"); + m_log.Info("UUID: " + AgentID); + m_log.Info("Region: " + RegionHandle); + m_log.Info("Position: " + Position); } } */ diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 0e1f948..2690e4e 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -510,11 +510,11 @@ namespace OpenSim.Framework.Communications.Cache //inventory asset request requestID = new UUID(transferRequest.TransferInfo.Params, 80); source = 3; - //Console.WriteLine("asset request " + requestID); + //m_log.Debug("asset request " + requestID); } //check to see if asset is in local cache, if not we need to request it from asset server. - //Console.WriteLine("asset request " + requestID); + //m_log.Debug("asset request " + requestID); if (!m_memcache.Contains(requestID)) { //not found asset diff --git a/OpenSim/Framework/Communications/Capabilities/Caps.cs b/OpenSim/Framework/Communications/Capabilities/Caps.cs index a4c847d..4ab304f 100644 --- a/OpenSim/Framework/Communications/Capabilities/Caps.cs +++ b/OpenSim/Framework/Communications/Capabilities/Caps.cs @@ -464,7 +464,7 @@ namespace OpenSim.Framework.Communications.Capabilities /// public string RequestTexture(string request, string path, string param) { - System.Console.WriteLine("texture request " + request); + m_log.Debug("texture request " + request); // Needs implementing (added to remove compiler warning) return String.Empty; } @@ -670,7 +670,7 @@ namespace OpenSim.Framework.Communications.Capabilities } } - //System.Console.WriteLine("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); + //m_log.Debug("asset upload request via CAPS" + llsdRequest.inventory_type +" , "+ llsdRequest.asset_type); string assetName = llsdRequest.name; string assetDes = llsdRequest.description; diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs index 1f88062..588a39a 100644 --- a/OpenSim/Framework/Console/ConsoleBase.cs +++ b/OpenSim/Framework/Console/ConsoleBase.cs @@ -126,7 +126,7 @@ namespace OpenSim.Framework.Console if (!dict.ContainsKey(helpPart)) break; - //System.Console.WriteLine("Found {0}", helpParts[0]); + //m_log.Debug("Found {0}", helpParts[0]); if (dict[helpPart] is Dictionary) dict = (Dictionary)dict[helpPart]; diff --git a/OpenSim/Framework/HGNetworkServersInfo.cs b/OpenSim/Framework/HGNetworkServersInfo.cs index 803c712..c4d1318 100644 --- a/OpenSim/Framework/HGNetworkServersInfo.cs +++ b/OpenSim/Framework/HGNetworkServersInfo.cs @@ -58,7 +58,7 @@ namespace OpenSim.Framework { string userServerURI = ServerURI(userserver); bool ret = (((userServerURI == null) || (userServerURI == "") || (userServerURI == LocalUserServerURI))); - //Console.WriteLine("-------------> HGNetworkServersInfo.IsLocalUser? " + ret + "(userServer=" + userServerURI + "; localuserserver=" + LocalUserServerURI + ")"); + //m_log.Debug("-------------> HGNetworkServersInfo.IsLocalUser? " + ret + "(userServer=" + userServerURI + "; localuserserver=" + LocalUserServerURI + ")"); return ret; } diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index dcac9f1..2718072 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -700,8 +700,7 @@ namespace OpenSim.Framework } catch (Exception e) { - System.Console.WriteLine(e.Message); - System.Console.WriteLine(e.StackTrace); + m_log.Error(e.ToString()); } finally { @@ -728,8 +727,7 @@ namespace OpenSim.Framework } catch (Exception e) { - System.Console.WriteLine(e.Message); - System.Console.WriteLine(e.StackTrace); + m_log.Error(e.ToString()); } finally { diff --git a/OpenSim/Framework/WearableItem.cs b/OpenSim/Framework/WearableItem.cs index 7a4b4de..6675127 100644 --- a/OpenSim/Framework/WearableItem.cs +++ b/OpenSim/Framework/WearableItem.cs @@ -264,7 +264,7 @@ namespace OpenSim.Framework foreach (string line in lines) { string trimLine = line.Trim(); - // Console.WriteLine("line : " + trimLine); + // m_log.Debug("line : " + trimLine); string[] splitLine = r.Split(trimLine); if (splitLine.Length > 1) diff --git a/OpenSim/Grid/AssetInventoryServer/Main.cs b/OpenSim/Grid/AssetInventoryServer/Main.cs index 67aaf95..598b754 100644 --- a/OpenSim/Grid/AssetInventoryServer/Main.cs +++ b/OpenSim/Grid/AssetInventoryServer/Main.cs @@ -28,11 +28,15 @@ using System; using Nini.Config; using log4net.Config; +using log4net; +using System.Reflection; namespace OpenSim.Grid.AssetInventoryServer { class MainEntry { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + static void Main(string[] args) { XmlConfigurator.Configure(); @@ -46,7 +50,7 @@ namespace OpenSim.Grid.AssetInventoryServer Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) { - Console.WriteLine("AssetInventory server is shutting down..."); + m_log.Info("AssetInventory server is shutting down..."); server.Shutdown(); Environment.Exit(0); }; diff --git a/OpenSim/Grid/GridServer/GridRestModule.cs b/OpenSim/Grid/GridServer/GridRestModule.cs index e0c1288..7d3bd18 100644 --- a/OpenSim/Grid/GridServer/GridRestModule.cs +++ b/OpenSim/Grid/GridServer/GridRestModule.cs @@ -182,7 +182,7 @@ namespace OpenSim.Grid.GridServer public string RestSetSimMethod(string request, string path, string param, OSHttpRequest httpRequest, OSHttpResponse httpResponse) { - Console.WriteLine("Processing region update via REST method"); + m_log.Info("Processing region update via REST method"); RegionProfileData theSim; theSim = m_gridDBService.GetRegion(new UUID(param)); if (theSim == null) diff --git a/OpenSim/Grid/GridServer/GridXmlRpcModule.cs b/OpenSim/Grid/GridServer/GridXmlRpcModule.cs index f320ccc..8998b55 100644 --- a/OpenSim/Grid/GridServer/GridXmlRpcModule.cs +++ b/OpenSim/Grid/GridServer/GridXmlRpcModule.cs @@ -627,7 +627,7 @@ namespace OpenSim.Grid.GridServer else if (requestData.ContainsKey("region_handle")) { //CFK: The if/else below this makes this message redundant. - //CFK: Console.WriteLine("requesting data for region " + (string) requestData["region_handle"]); + //CFK: m_log.Info("requesting data for region " + (string) requestData["region_handle"]); ulong regionHandle = Convert.ToUInt64((string)requestData["region_handle"]); simData = m_gridDBService.GetRegion(regionHandle); if (simData == null) diff --git a/OpenSim/Grid/UserServer/UserManager.cs b/OpenSim/Grid/UserServer/UserManager.cs index f3e9884..6229dec 100644 --- a/OpenSim/Grid/UserServer/UserManager.cs +++ b/OpenSim/Grid/UserServer/UserManager.cs @@ -402,7 +402,7 @@ namespace OpenSim.Grid.UserServer Hashtable requestData = (Hashtable) request.Params[0]; UserProfileData userProfile; //CFK: this clogs the UserServer log and is not necessary at this time. - //CFK: Console.WriteLine("METHOD BY UUID CALLED"); + //CFK: m_log.Debug("METHOD BY UUID CALLED"); if (requestData.Contains("avatar_uuid")) { try @@ -435,7 +435,7 @@ namespace OpenSim.Grid.UserServer Hashtable requestData = (Hashtable) request.Params[0]; UserProfileData userProfile; //CFK: this clogs the UserServer log and is not necessary at this time. - //CFK: Console.WriteLine("METHOD BY UUID CALLED"); + //CFK: m_log.Debug("METHOD BY UUID CALLED"); if (requestData.Contains("avatar_uuid")) { UUID guess; diff --git a/OpenSim/Region/Application/Application.cs b/OpenSim/Region/Application/Application.cs index b8fa786..017160a 100644 --- a/OpenSim/Region/Application/Application.cs +++ b/OpenSim/Region/Application/Application.cs @@ -55,15 +55,15 @@ namespace OpenSim XmlConfigurator.Configure(); - Console.Write("Performing compatibility checks... "); + m_log.Info("Performing compatibility checks... "); string supported = String.Empty; if (Util.IsEnvironmentSupported(ref supported)) { - Console.WriteLine(" Environment is compatible.\n"); + m_log.Info("Environment is compatible.\n"); } else { - Console.WriteLine(" Environment is unsupported (" + supported + ")\n"); + m_log.Warn("Environment is unsupported (" + supported + ")\n"); } Culture.SetCurrentCulture(); @@ -115,7 +115,7 @@ namespace OpenSim } catch (Exception e) { - Console.WriteLine("Caught exception from command: {0}", e); + m_log.Error("Caught exception from command: {0}", e); } } } diff --git a/OpenSim/Region/Application/ConfigurationLoader.cs b/OpenSim/Region/Application/ConfigurationLoader.cs index f0c57e0..f3f9f29 100644 --- a/OpenSim/Region/Application/ConfigurationLoader.cs +++ b/OpenSim/Region/Application/ConfigurationLoader.cs @@ -265,7 +265,7 @@ namespace OpenSim if (m_configSettings.StorageDll == "OpenSim.DataStore.MonoSqlite.dll") { m_configSettings.StorageDll = "OpenSim.Data.SQLite.dll"; - Console.WriteLine("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll."); + m_log.Warn("WARNING: OpenSim.DataStore.MonoSqlite.dll is deprecated. Set storage_plugin to OpenSim.Data.SQLite.dll."); Thread.Sleep(3000); } diff --git a/OpenSim/Region/Application/HGOpenSimNode.cs b/OpenSim/Region/Application/HGOpenSimNode.cs index 6ec00fe..ded6443 100644 --- a/OpenSim/Region/Application/HGOpenSimNode.cs +++ b/OpenSim/Region/Application/HGOpenSimNode.cs @@ -192,7 +192,7 @@ namespace OpenSim for (int i = 3; i < cmdparams.Count; i++) mapName += " " + cmdparams[i]; - Console.WriteLine(">> MapName: " + mapName); + m_log.Info(">> MapName: " + mapName); //internalPort = Convert.ToUInt32(cmdparams[4]); //remotingPort = Convert.ToUInt32(cmdparams[5]); } @@ -285,7 +285,7 @@ namespace OpenSim } catch (Exception e) { - Console.WriteLine(e.ToString()); + m_log.Error(e.ToString()); } } @@ -323,9 +323,9 @@ namespace OpenSim private void LinkRegionCmdUsage() { - Console.WriteLine("Usage: link-region :[:]"); - Console.WriteLine("Usage: link-region []"); - Console.WriteLine("Usage: link-region []"); + m_log.Info("Usage: link-region :[:]"); + m_log.Info("Usage: link-region []"); + m_log.Info("Usage: link-region []"); } } } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index c4b025a..e643a0e 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -1877,7 +1877,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP bulkUpdate.AgentData.TransactionID = transactionId; bulkUpdate.FolderData = folderDataBlocks.ToArray(); - //Console.WriteLine("SendBulkUpdateInventory :" + bulkUpdate); + //m_log.Debug("SendBulkUpdateInventory :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); } } @@ -1920,7 +1920,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP items.RemoveAt(items.Count - 1); } - //Console.WriteLine("SendBulkUpdateInventoryRecursive :" + bulkUpdate); + //m_log.Debug("SendBulkUpdateInventoryRecursive :" + bulkUpdate); OutPacket(bulkUpdate, ThrottleOutPacketType.Asset); folderDataBlocks = new List(); @@ -3101,7 +3101,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP packet.ParamList = returnblock; packet.Header.Reliable = false; - //System.Console.WriteLine("[ESTATE]: SIM--->" + packet.ToString()); + //m_log.Debug("[ESTATE]: SIM--->" + packet.ToString()); OutPacket(packet, ThrottleOutPacketType.Task); } @@ -3895,7 +3895,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// protected bool AgentTextureCached(IClientAPI simclient, Packet packet) { - //Console.WriteLine("texture cached: " + packet.ToString()); + //m_log.Debug("texture cached: " + packet.ToString()); AgentCachedTexturePacket cachedtex = (AgentCachedTexturePacket)packet; AgentCachedTextureResponsePacket cachedresp = (AgentCachedTextureResponsePacket)PacketPool.Instance.GetPacket(PacketType.AgentCachedTextureResponse); // TODO: don't create new blocks if recycling an old packet @@ -3924,7 +3924,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP protected bool MultipleObjUpdate(IClientAPI simClient, Packet packet) { MultipleObjectUpdatePacket multipleupdate = (MultipleObjectUpdatePacket)packet; - // Console.WriteLine("new multi update packet " + multipleupdate.ToString()); + // m_log.Debug("new multi update packet " + multipleupdate.ToString()); Scene tScene = (Scene)m_scene; for (int i = 0; i < multipleupdate.ObjectData.Length; i++) @@ -3956,7 +3956,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; if (handlerUpdatePrimSinglePosition != null) { - // Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); handlerUpdatePrimSinglePosition(localId, pos1, this); } break; @@ -3966,7 +3966,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { - //Console.WriteLine("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new tab rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimSingleRotation(localId, rot1, this); } break; @@ -3976,7 +3976,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimSingleRotation = OnUpdatePrimSingleRotation; if (handlerUpdatePrimSingleRotation != null) { - //Console.WriteLine("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new mouse rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimSingleRotation(localId, rot2, this); } break; @@ -3988,7 +3988,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale1, this); handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; @@ -4026,8 +4026,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimGroupRotation = OnUpdatePrimGroupMouseRotation; if (handlerUpdatePrimGroupRotation != null) { - //Console.WriteLine("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); - // Console.WriteLine("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); + //m_log.Debug("new rotation position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new rotation is " + rot.X + " , " + rot.Y + " , " + rot.Z + " , " + rot.W); handlerUpdatePrimGroupRotation(localId, pos3, rot4, this); } break; @@ -4038,12 +4038,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - //Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + //m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale2, this); // Change the position based on scale (for bug number 246) handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; - // Console.WriteLine("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); + // m_log.Debug("new movement position is " + pos.X + " , " + pos.Y + " , " + pos.Z); if (handlerUpdatePrimSinglePosition != null) { handlerUpdatePrimSinglePosition(localId, pos4, this); @@ -4057,7 +4057,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimGroupScale = OnUpdatePrimGroupScale; if (handlerUpdatePrimGroupScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimGroupScale(localId, scale5, this); handlerUpdateVector = OnUpdatePrimGroupPosition; @@ -4074,7 +4074,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP handlerUpdatePrimScale = OnUpdatePrimScale; if (handlerUpdatePrimScale != null) { - // Console.WriteLine("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); + // m_log.Debug("new scale is " + scale.X + " , " + scale.Y + " , " + scale.Z); handlerUpdatePrimScale(localId, scale6, this); handlerUpdatePrimSinglePosition = OnUpdatePrimSinglePosition; if (handlerUpdatePrimSinglePosition != null) @@ -4733,7 +4733,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AvatarPickerRequestPacket avRequestQuery = (AvatarPickerRequestPacket)Pack; AvatarPickerRequestPacket.AgentDataBlock Requestdata = avRequestQuery.AgentData; AvatarPickerRequestPacket.DataBlock querydata = avRequestQuery.Data; - //Console.WriteLine("Agent Sends:" + Utils.BytesToString(querydata.Name)); + //m_log.Debug("Agent Sends:" + Utils.BytesToString(querydata.Name)); handlerAvatarPickerRequest = OnAvatarPickerRequest; if (handlerAvatarPickerRequest != null) @@ -5285,7 +5285,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.RequestImage: RequestImagePacket imageRequest = (RequestImagePacket)Pack; - //Console.WriteLine("image request: " + Pack.ToString()); + //m_log.Debug("image request: " + Pack.ToString()); //handlerTextureRequest = null; @@ -5311,10 +5311,10 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case PacketType.TransferRequest: - //Console.WriteLine("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); + //m_log.Debug("ClientView.ProcessPackets.cs:ProcessInPacket() - Got transfer request"); TransferRequestPacket transfer = (TransferRequestPacket)Pack; - //Console.WriteLine("Transfer Request: " + transfer.ToString()); + //m_log.Debug("Transfer Request: " + transfer.ToString()); // Validate inventory transfers // Has to be done here, because AssetCache can't do it // @@ -5409,8 +5409,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.AssetUploadRequest: AssetUploadRequestPacket request = (AssetUploadRequestPacket)Pack; - // Console.WriteLine("upload request " + request.ToString()); - // Console.WriteLine("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); + // m_log.Debug("upload request " + request.ToString()); + // m_log.Debug("upload request was for assetid: " + request.AssetBlock.TransactionID.Combine(this.SecureSessionId).ToString()); UUID temp = UUID.Combine(request.AssetBlock.TransactionID, SecureSessionId); handlerAssetUploadRequest = OnAssetUploadRequest; @@ -5606,7 +5606,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } } } - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); /*for (int i = 0; i < update.InventoryData.Length; i++) { if (update.InventoryData[i].TransactionID != UUID.Zero) @@ -5614,7 +5614,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP AssetBase asset = m_assetCache.GetAsset(update.InventoryData[i].TransactionID.Combine(this.SecureSessionId)); if (asset != null) { - // Console.WriteLine("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache"); + // m_log.Debug("updating inventory item, found asset" + asset.FullID.ToString() + " already in cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else @@ -5622,12 +5622,12 @@ namespace OpenSim.Region.ClientStack.LindenUDP asset = this.UploadAssets.AddUploadToAssetCache(update.InventoryData[i].TransactionID); if (asset != null) { - //Console.WriteLine("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache"); + //m_log.Debug("updating inventory item, adding asset" + asset.FullID.ToString() + " to cache"); m_inventoryCache.UpdateInventoryItemAsset(this, update.InventoryData[i].ItemID, asset); } else { - //Console.WriteLine("trying to update inventory item, but asset is null"); + //m_log.Debug("trying to update inventory item, but asset is null"); } } } @@ -5778,7 +5778,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.RezScript: - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); RezScriptPacket rezScriptx = (RezScriptPacket)Pack; handlerRezScript = OnRezScript; @@ -5894,7 +5894,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.TeleportLocationRequest: TeleportLocationRequestPacket tpLocReq = (TeleportLocationRequestPacket)Pack; - // Console.WriteLine(tpLocReq.ToString()); + // m_log.Debug(tpLocReq.ToString()); handlerTeleportLocationRequest = OnTeleportLocationRequest; if (handlerTeleportLocationRequest != null) @@ -6070,7 +6070,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } break; case PacketType.ParcelObjectOwnersRequest: - //Console.WriteLine(Pack.ToString()); + //m_log.Debug(Pack.ToString()); ParcelObjectOwnersRequestPacket reqPacket = (ParcelObjectOwnersRequestPacket)Pack; handlerParcelObjectOwnerRequest = OnParcelObjectOwnerRequest; @@ -6135,7 +6135,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.EstateOwnerMessage: EstateOwnerMessagePacket messagePacket = (EstateOwnerMessagePacket)Pack; - //System.Console.WriteLine(messagePacket.ToString()); + //m_log.Debug(messagePacket.ToString()); switch (Utils.BytesToString(messagePacket.MethodData.Method)) { case "getinfo": @@ -6663,7 +6663,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP case PacketType.MapItemRequest: MapItemRequestPacket mirpk = (MapItemRequestPacket)Pack; - //System.Console.WriteLine(mirpk.ToString()); + //m_log.Debug(mirpk.ToString()); handlerMapItemRequest = OnMapItemRequest; if (handlerMapItemRequest != null) { @@ -6711,7 +6711,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP break; case PacketType.DirPlacesQuery: DirPlacesQueryPacket dirPlacesQueryPacket = (DirPlacesQueryPacket)Pack; - //Console.WriteLine(dirPlacesQueryPacket.ToString()); + //m_log.Debug(dirPlacesQueryPacket.ToString()); handlerDirPlacesQuery = OnDirPlacesQuery; if (handlerDirPlacesQuery != null) @@ -7674,7 +7674,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP public void SendAsset(AssetRequestToClient req) { - //Console.WriteLine("sending asset " + req.RequestAssetID); + //m_log.Debug("sending asset " + req.RequestAssetID); TransferInfoPacket Transfer = new TransferInfoPacket(); Transfer.TransferInfo.ChannelType = 2; Transfer.TransferInfo.Status = 0; @@ -8161,7 +8161,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP mrdata.Name = Utils.StringToBytes(replies[i].name); mirplk.Data[i] = mrdata; } - //System.Console.WriteLine(mirplk.ToString()); + //m_log.Debug(mirplk.ToString()); OutPacket(mirplk, ThrottleOutPacketType.Task); } diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs index 23ed798..0fb27d4 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLImageManager.cs @@ -32,6 +32,8 @@ using OpenMetaverse; using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; +using log4net; +using System.Reflection; namespace OpenSim.Region.ClientStack.LindenUDP { @@ -41,6 +43,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public class LLImageManager { + /// /// Priority Queue for images. Contains lots of data /// @@ -114,7 +117,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP if (m_shuttingdown) return; - //Console.WriteLine("AssetCallback for assetId" + assetID); + //m_log.Debug("AssetCallback for assetId" + assetID); if (asset == null || asset.Data == null) { @@ -249,7 +252,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP } // uncomment the following line to see the upper most asset and the priority - //Console.WriteLine(process.ToString()); + //m_log.Debug(process.ToString()); // Lower priority to give the next image a chance to bubble up pq[h] -= 50000; @@ -359,6 +362,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// public class J2KImage { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private AssetBase m_asset_ref = null; public volatile int LastPacketNum = 0; public volatile int DiscardLimit = 0; @@ -550,7 +554,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Buffer.BlockCopy(m_asset_ref.Data, 0, firstImageData, 0, FIRST_IMAGE_PACKET_SIZE); } catch (Exception) { - Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(), firstImageData.Length, FIRST_IMAGE_PACKET_SIZE)); + m_log.Error(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(), firstImageData.Length, FIRST_IMAGE_PACKET_SIZE)); //m_log.Error("Texture data copy failed on first packet for " + m_asset_ref.FullID.ToString()); //m_cancel = true; @@ -569,8 +573,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP //if (imagePacketSize > 0) // imagePacketSize = IMAGE_PACKET_SIZE; //if (imagePacketSize != 1000) - // Console.WriteLine("ENdPacket"); - //Console.WriteLine(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize)); + // m_log.Debug("ENdPacket"); + //m_log.Debug(String.Format("srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize{3}", m_asset_ref.Data.Length, CurrentBytePosition(),0, imagePacketSize)); bool atEnd = false; @@ -591,9 +595,9 @@ namespace OpenSim.Region.ClientStack.LindenUDP try { Buffer.BlockCopy(m_asset_ref.Data, CurrentBytePosition(), imageData, 0, imagePacketSize); } catch (Exception e) { - Console.WriteLine(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), + m_log.Error(String.Format("Err: srcLen:{0}, BytePos:{1}, desLen:{2}, pktsize:{3}, currpak:{4}, stoppak:{5}, totalpak:{6}", m_asset_ref.Data.Length, CurrentBytePosition(), imageData.Length, imagePacketSize, CurrentPacket, StopPacket, TexturePacketCount())); - Console.WriteLine(e.ToString()); + m_log.Error(e.ToString()); //m_log.Error("Texture data copy failed for " + m_asset_ref.FullID.ToString()); //m_cancel = true; //m_sending = false; diff --git a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs index 53506d3..9c231b5 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/Tests/TestLLUDPServer.cs @@ -57,8 +57,8 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests protected override bool EndReceive(out int numBytes, IAsyncResult result, ref EndPoint epSender) { numBytes = 0; - - //System.Console.WriteLine("Queue size " + m_chunksToLoad.Count); + + //m_log.Debug("Queue size " + m_chunksToLoad.Count); if (m_chunksToLoad.Count <= 0) return false; @@ -150,4 +150,4 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests Sender = sender; } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs index 08d74f3..4493591 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs @@ -193,7 +193,7 @@ namespace OpenSim.Region.Communications.Hypergrid { if (reg.RegionLocX != x || reg.RegionLocY != y) { - //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); + //m_log.Debug("CommsManager- RequestNeighbours() - found a different region in list, checking location"); if ((reg.RegionLocX > (x - 2)) && (reg.RegionLocX < (x + 2))) { if ((reg.RegionLocY > (y - 2)) && (reg.RegionLocY < (y + 2))) @@ -239,10 +239,10 @@ namespace OpenSim.Region.Communications.Hypergrid /// public virtual RegionInfo RequestNeighbourInfo(ulong regionHandle) { - //Console.WriteLine(" >> RequestNeighbourInfo for " + regionHandle); + //m_log.Debug(" >> RequestNeighbourInfo for " + regionHandle); foreach (RegionInfo info in m_hyperlinkRegions) { - //Console.WriteLine(" .. " + info.RegionHandle); + //m_log.Debug(" .. " + info.RegionHandle); if (info.RegionHandle == regionHandle) return info; } @@ -250,7 +250,7 @@ namespace OpenSim.Region.Communications.Hypergrid { if (info.RegionHandle == regionHandle) { - //Console.WriteLine("XXX------ known region " + info.RegionHandle); + //m_log.Debug("XXX------ known region " + info.RegionHandle); return info; } } @@ -291,7 +291,7 @@ namespace OpenSim.Region.Communications.Hypergrid map.Y = (ushort)regInfo.RegionLocY; map.WaterHeight = (byte)regInfo.RegionSettings.WaterHeight; map.MapImageId = regInfo.RegionSettings.TerrainImageID; -// Console.WriteLine("ImgID: " + map.MapImageId); + // m_log.Debug("ImgID: " + map.MapImageId); map.Agents = 1; map.RegionFlags = 72458694; map.Access = 13; @@ -312,10 +312,10 @@ namespace OpenSim.Region.Communications.Hypergrid WebClient c = new WebClient(); string uri = "http://" + info.ExternalHostName + ":" + info.HttpPort + "/index.php?method=" + regionimage; - //Console.WriteLine("JPEG: " + uri); + //m_log.Debug("JPEG: " + uri); c.DownloadFile(uri, info.RegionID.ToString() + ".jpg"); Bitmap m = new Bitmap(info.RegionID.ToString() + ".jpg"); - //Console.WriteLine("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); + //m_log.Debug("Size: " + m.PhysicalDimension.Height + "-" + m.PhysicalDimension.Width); byte[] imageData = OpenJPEG.EncodeFromImage(m, true); AssetBase ass = new AssetBase(UUID.Random(), "region " + info.RegionID.ToString()); info.RegionSettings.TerrainImageID = ass.FullID; @@ -327,7 +327,7 @@ namespace OpenSim.Region.Communications.Hypergrid } catch // LEGIT: Catching problems caused by OpenJPEG p/invoke { - Console.WriteLine("[HGrid]: Failed getting/storing map image, because it is probably already in the cache"); + m_log.Warn("[HGrid]: Failed getting/storing map image, because it is probably already in the cache"); } } @@ -435,7 +435,7 @@ namespace OpenSim.Region.Communications.Hypergrid { hash = (Hashtable)response.Value; //foreach (Object o in hash) - // Console.WriteLine(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); + // m_log.Debug(">> " + ((DictionaryEntry)o).Key + ":" + ((DictionaryEntry)o).Value); try { UUID.TryParse((string)hash["uuid"], out uuid); @@ -443,7 +443,7 @@ namespace OpenSim.Region.Communications.Hypergrid if ((string)hash["handle"] != null) { info.regionSecret = (string)hash["handle"]; - //Console.WriteLine(">> HERE: " + info.regionSecret); + //m_log.Debug(">> HERE: " + info.regionSecret); } if (hash["region_image"] != null) { @@ -454,18 +454,18 @@ namespace OpenSim.Region.Communications.Hypergrid if (hash["region_name"] != null) { info.RegionName = (string)hash["region_name"]; - //Console.WriteLine(">> " + info.RegionName); + //m_log.Debug(">> " + info.RegionName); } if (hash["internal_port"] != null) { int port = Convert.ToInt32((string)hash["internal_port"]); info.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), port); - //Console.WriteLine(">> " + info.InternalEndPoint.ToString()); + //m_log.Debug(">> " + info.InternalEndPoint.ToString()); } if (hash["remoting_port"] != null) { info.RemotingPort = Convert.ToUInt32(hash["remoting_port"]); - //Console.WriteLine(">> " + info.RemotingPort); + //m_log.Debug(">> " + info.RemotingPort); } } @@ -508,12 +508,12 @@ namespace OpenSim.Region.Communications.Hypergrid Hashtable hash = new Hashtable(); hash["uuid"] = regInfo.RegionID.ToString(); hash["handle"] = regInfo.RegionHandle.ToString(); - //Console.WriteLine(">> Here " + regInfo.RegionHandle); + //m_log.Debug(">> Here " + regInfo.RegionHandle); hash["region_image"] = regInfo.RegionSettings.TerrainImageID.ToString(); hash["region_name"] = regInfo.RegionName; hash["internal_port"] = regInfo.InternalEndPoint.Port.ToString(); hash["remoting_port"] = NetworkServersInfo.RemotingListenerPort.ToString(); - //Console.WriteLine(">> Here: " + regInfo.InternalEndPoint.Port); + //m_log.Debug(">> Here: " + regInfo.InternalEndPoint.Port); XmlRpcResponse response = new XmlRpcResponse(); @@ -553,9 +553,9 @@ namespace OpenSim.Region.Communications.Hypergrid if (u != null && u.UserProfile != null) { loginParams["region_uuid"] = u.UserProfile.HomeRegionID.ToString(); // This seems to be always Zero - //Console.WriteLine(" --------- Home Region UUID -------"); - //Console.WriteLine(" >> " + loginParams["region_uuid"] + " <<"); - //Console.WriteLine(" --------- ---------------- -------"); + //m_log.Debug(" --------- Home Region UUID -------"); + //m_log.Debug(" >> " + loginParams["region_uuid"] + " <<"); + //m_log.Debug(" --------- ---------------- -------"); string serverURI = ""; if (u.UserProfile is ForeignUserProfileData) @@ -577,7 +577,7 @@ namespace OpenSim.Region.Communications.Hypergrid if (!IsLocalUser(u)) { loginParams["regionhandle"] = rinfo.regionSecret; // user.CurrentAgent.Handle.ToString(); - //Console.WriteLine("XXX--- informregionofuser (foreign user) here handle: " + rinfo.regionSecret); + //m_log.Debug("XXX--- informregionofuser (foreign user) here handle: " + rinfo.regionSecret); loginParams["home_address"] = ((ForeignUserProfileData)(u.UserProfile)).UserHomeAddress; loginParams["home_port"] = ((ForeignUserProfileData)(u.UserProfile)).UserHomePort; @@ -585,7 +585,7 @@ namespace OpenSim.Region.Communications.Hypergrid } else { - //Console.WriteLine("XXX--- informregionofuser (local user) here handle: " + rinfo.regionSecret); + //m_log.Debug("XXX--- informregionofuser (local user) here handle: " + rinfo.regionSecret); //// local user about to jump out, let's process the name // On second thoughts, let's not do this for the *user*; let's only do it for the *agent* @@ -596,9 +596,9 @@ namespace OpenSim.Region.Communications.Hypergrid loginParams["regionhandle"] = u.UserProfile.HomeRegion.ToString(); // user.CurrentAgent.Handle.ToString(); loginParams["home_address"] = rinfo.ExternalHostName; - Console.WriteLine(" --------- Home Address -------"); - Console.WriteLine(" >> " + loginParams["home_address"] + " <<"); - Console.WriteLine(" --------- ------------ -------"); + m_log.Debug(" --------- Home Address -------"); + m_log.Debug(" >> " + loginParams["home_address"] + " <<"); + m_log.Debug(" --------- ------------ -------"); loginParams["home_port"] = rinfo.HttpPort.ToString(); loginParams["home_remoting"] = NetworkServersInfo.RemotingListenerPort.ToString(); ; } @@ -614,7 +614,7 @@ namespace OpenSim.Region.Communications.Hypergrid // Send string uri = "http://" + regInfo.ExternalHostName + ":" + regInfo.HttpPort + "/"; - //Console.WriteLine("XXX uri: " + uri); + //m_log.Debug("XXX uri: " + uri); XmlRpcRequest request = new XmlRpcRequest("expect_hg_user", SendParams); XmlRpcResponse reply; try @@ -722,7 +722,7 @@ namespace OpenSim.Region.Communications.Hypergrid else { // Finally, everything looks ok - //Console.WriteLine("XXX---- EVERYTHING OK ---XXX"); + //m_log.Debug("XXX---- EVERYTHING OK ---XXX"); // 1 - Preload the user data m_userProfileCache.PreloadUserCache(userData.ID, userData); @@ -744,7 +744,7 @@ namespace OpenSim.Region.Communications.Hypergrid rinfo.RegionLocX = 0; rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count; rinfo.regionSecret = userRegionHandle.ToString(); - //Console.WriteLine("XXX--- Here: handle = " + rinfo.regionSecret); + //m_log.Debug("XXX--- Here: handle = " + rinfo.regionSecret); try { rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); @@ -828,7 +828,7 @@ namespace OpenSim.Region.Communications.Hypergrid if ((uinfo != null) && (uinfo.UserProfile != null) && (IsLocalUser(uinfo) || !(uinfo.UserProfile is ForeignUserProfileData))) { - //Console.WriteLine("---------------> Local User!"); + //m_log.Debug("---------------> Local User!"); string[] parts = agentData.firstname.Split(new char[] { '.' }); if (parts.Length == 2) { @@ -837,7 +837,7 @@ namespace OpenSim.Region.Communications.Hypergrid } } //else - // Console.WriteLine("---------------> Foreign User!"); + // m_log.Debug("---------------> Foreign User!"); } #endregion @@ -938,31 +938,31 @@ namespace OpenSim.Region.Communications.Hypergrid private void DumpUserData(ForeignUserProfileData userData) { - Console.WriteLine(" ------------ User Data Dump ----------"); - Console.WriteLine(" >> Name: " + userData.FirstName + " " + userData.SurName); - Console.WriteLine(" >> HomeID: " + userData.HomeRegionID); - Console.WriteLine(" >> HomeHandle: " + userData.HomeRegion); - Console.WriteLine(" >> HomeX: " + userData.HomeRegionX); - Console.WriteLine(" >> HomeY: " + userData.HomeRegionY); - Console.WriteLine(" >> UserServer: " + userData.UserServerURI); - Console.WriteLine(" >> InvServer: " + userData.UserInventoryURI); - Console.WriteLine(" >> AssetServer: " + userData.UserAssetURI); - Console.WriteLine(" ------------ -------------- ----------"); + m_log.Info(" ------------ User Data Dump ----------"); + m_log.Info(" >> Name: " + userData.FirstName + " " + userData.SurName); + m_log.Info(" >> HomeID: " + userData.HomeRegionID); + m_log.Info(" >> HomeHandle: " + userData.HomeRegion); + m_log.Info(" >> HomeX: " + userData.HomeRegionX); + m_log.Info(" >> HomeY: " + userData.HomeRegionY); + m_log.Info(" >> UserServer: " + userData.UserServerURI); + m_log.Info(" >> InvServer: " + userData.UserInventoryURI); + m_log.Info(" >> AssetServer: " + userData.UserAssetURI); + m_log.Info(" ------------ -------------- ----------"); } private void DumpRegionData(RegionInfo rinfo) { - Console.WriteLine(" ------------ Region Data Dump ----------"); - Console.WriteLine(" >> handle: " + rinfo.RegionHandle); - Console.WriteLine(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY); - Console.WriteLine(" >> secret: " + rinfo.regionSecret); - Console.WriteLine(" >> remoting address: " + rinfo.RemotingAddress); - Console.WriteLine(" >> remoting port: " + rinfo.RemotingPort); - Console.WriteLine(" >> external host name: " + rinfo.ExternalHostName); - Console.WriteLine(" >> http port: " + rinfo.HttpPort); - Console.WriteLine(" >> external EP address: " + rinfo.ExternalEndPoint.Address); - Console.WriteLine(" >> external EP port: " + rinfo.ExternalEndPoint.Port); - Console.WriteLine(" ------------ -------------- ----------"); + m_log.Info(" ------------ Region Data Dump ----------"); + m_log.Info(" >> handle: " + rinfo.RegionHandle); + m_log.Info(" >> coords: " + rinfo.RegionLocX + ", " + rinfo.RegionLocY); + m_log.Info(" >> secret: " + rinfo.regionSecret); + m_log.Info(" >> remoting address: " + rinfo.RemotingAddress); + m_log.Info(" >> remoting port: " + rinfo.RemotingPort); + m_log.Info(" >> external host name: " + rinfo.ExternalHostName); + m_log.Info(" >> http port: " + rinfo.HttpPort); + m_log.Info(" >> external EP address: " + rinfo.ExternalEndPoint.Address); + m_log.Info(" >> external EP port: " + rinfo.ExternalEndPoint.Port); + m_log.Info(" ------------ -------------- ----------"); } diff --git a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs index 306ea27..33bc2fa 100644 --- a/OpenSim/Region/Communications/Local/LocalBackEndServices.cs +++ b/OpenSim/Region/Communications/Local/LocalBackEndServices.cs @@ -84,10 +84,10 @@ namespace OpenSim.Region.Communications.Local /// public RegionCommsListener RegisterRegion(RegionInfo regionInfo) { - //Console.WriteLine("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); + //m_log.Debug("CommsManager - Region " + regionInfo.RegionHandle + " , " + regionInfo.RegionLocX + " , "+ regionInfo.RegionLocY +" is registering"); if (!m_regions.ContainsKey(regionInfo.RegionHandle)) { - //Console.WriteLine("CommsManager - Adding Region " + regionInfo.RegionHandle); + //m_log.Debug("CommsManager - Adding Region " + regionInfo.RegionHandle); m_regions.Add(regionInfo.RegionHandle, regionInfo); RegionCommsListener regionHost = new RegionCommsListener(); @@ -145,15 +145,15 @@ namespace OpenSim.Region.Communications.Local /// public List RequestNeighbours(uint x, uint y) { - // Console.WriteLine("Finding Neighbours to " + regionInfo.RegionHandle); + // m_log.Debug("Finding Neighbours to " + regionInfo.RegionHandle); List neighbours = new List(); foreach (RegionInfo reg in m_regions.Values) { - // Console.WriteLine("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); + // m_log.Debug("CommsManager- RequestNeighbours() checking region " + reg.RegionLocX + " , "+ reg.RegionLocY); if (reg.RegionLocX != x || reg.RegionLocY != y) { - //Console.WriteLine("CommsManager- RequestNeighbours() - found a different region in list, checking location"); + //m_log.Debug("CommsManager- RequestNeighbours() - found a different region in list, checking location"); if ((reg.RegionLocX > (x - 2)) && (reg.RegionLocX < (x + 2))) { if ((reg.RegionLocY > (y - 2)) && (reg.RegionLocY < (y + 2))) diff --git a/OpenSim/Region/Communications/Local/LocalUserServices.cs b/OpenSim/Region/Communications/Local/LocalUserServices.cs index f4fe686..a239033 100644 --- a/OpenSim/Region/Communications/Local/LocalUserServices.cs +++ b/OpenSim/Region/Communications/Local/LocalUserServices.cs @@ -29,11 +29,14 @@ using System; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Framework.Communications; +using log4net; +using System.Reflection; namespace OpenSim.Region.Communications.Local { public class LocalUserServices : UserManagerBase { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private readonly uint m_defaultHomeX; private readonly uint m_defaultHomeY; @@ -64,7 +67,7 @@ namespace OpenSim.Region.Communications.Local return profile; } - Console.WriteLine("Unknown Master User. Sandbox Mode: Creating Account"); + m_log.Debug("Unknown Master User. Sandbox Mode: Creating Account"); AddUser(firstName, lastName, password, "", m_defaultHomeX, m_defaultHomeY); return GetUserProfile(firstName, lastName); } diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs index 3c24b05..312c434 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AgentAssetTransactionsManager.cs @@ -176,7 +176,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction public void HandleUDPUploadRequest(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile) { - //System.Console.WriteLine("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile); + //m_log.Debug("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile); if (((AssetType)type == AssetType.Texture || (AssetType)type == AssetType.Sound || (AssetType)type == AssetType.TextureTGA || @@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } } - //Console.WriteLine("asset upload of " + assetID); + //m_log.Debug("asset upload of " + assetID); AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); AssetXferUploader uploader = transactions.RequestXferUploader(transaction); @@ -216,7 +216,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) { - //System.Console.WriteLine("xferID: " + xferID + " packetID: " + packetID + " data!"); + //m_log.Debug("xferID: " + xferID + " packetID: " + packetID + " data!"); AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); transactions.HandleXfer(xferID, packetID, data); diff --git a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs index 3fd4a70..0adafd3 100644 --- a/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs +++ b/OpenSim/Region/CoreModules/Agent/AssetTransaction/AssetTransactionModule.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction public AssetTransactionModule() { - // System.Console.WriteLine("creating AgentAssetTransactionModule"); + //m_log.Debug("creating AgentAssetTransactionModule"); } #region IRegionModule Members @@ -64,7 +64,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction { if (!RegisteredScenes.ContainsKey(scene.RegionInfo.RegionID)) { - // System.Console.WriteLine("initialising AgentAssetTransactionModule"); + // m_log.Debug("initialising AgentAssetTransactionModule"); RegisteredScenes.Add(scene.RegionInfo.RegionID, scene); scene.RegisterModuleInterface(this); @@ -237,7 +237,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction public void HandleUDPUploadRequest(IClientAPI remoteClient, UUID assetID, UUID transaction, sbyte type, byte[] data, bool storeLocal, bool tempFile) { - //System.Console.WriteLine("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile); + //m_log.Debug("HandleUDPUploadRequest - assetID: " + assetID.ToString() + " transaction: " + transaction.ToString() + " type: " + type.ToString() + " storelocal: " + storeLocal + " tempFile: " + tempFile); if (((AssetType)type == AssetType.Texture || (AssetType)type == AssetType.Sound || (AssetType)type == AssetType.TextureTGA || @@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction } } - //Console.WriteLine("asset upload of " + assetID); + //m_log.Debug("asset upload of " + assetID); AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); AssetXferUploader uploader = transactions.RequestXferUploader(transaction); @@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.Agent.AssetTransaction /// public void HandleXfer(IClientAPI remoteClient, ulong xferID, uint packetID, byte[] data) { - //System.Console.WriteLine("xferID: " + xferID + " packetID: " + packetID + " data!"); + //m_log.Debug("xferID: " + xferID + " packetID: " + packetID + " data!"); AgentAssetTransactions transactions = GetUserTransactions(remoteClient.AgentId); transactions.HandleXfer(xferID, packetID, data); diff --git a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs index 2c6b51d..39dd84f 100644 --- a/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs +++ b/OpenSim/Region/CoreModules/Agent/Capabilities/CapabilitiesModule.cs @@ -188,21 +188,21 @@ namespace OpenSim.Region.CoreModules.Agent.Capabilities public void SetChildrenSeed(UUID agentID, Dictionary seeds) { - //Console.WriteLine(" !!! Setting child seeds in {0} to {1}", RegionInfo.RegionName, value.Count); + //m_log.Debug(" !!! Setting child seeds in {0} to {1}", RegionInfo.RegionName, value.Count); childrenSeeds[agentID] = seeds; } public void DumpChildrenSeeds(UUID agentID) { - Console.WriteLine("================ ChildrenSeed {0} ================", m_scene.RegionInfo.RegionName); + m_log.Info("================ ChildrenSeed "+m_scene.RegionInfo.RegionName+" ================"); foreach (KeyValuePair kvp in childrenSeeds[agentID]) { uint x, y; Utils.LongToUInts(kvp.Key, out x, out y); x = x / Constants.RegionSize; y = y / Constants.RegionSize; - Console.WriteLine(" >> {0}, {1}: {2}", x, y, kvp.Value); + m_log.Info(" >> "+x+", "+y+": "+kvp.Value); } } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs index 4bfa18f..124f0f6 100644 --- a/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs +++ b/OpenSim/Region/CoreModules/Agent/TextureDownload/TextureDownloadModule.cs @@ -72,7 +72,7 @@ namespace OpenSim.Region.CoreModules.Agent.TextureDownload { if (m_scene == null) { - //Console.WriteLine("Creating Texture download module"); + //m_log.Debug("Creating Texture download module"); m_scene = scene; m_thread = new Thread(new ThreadStart(ProcessTextureSenders)); m_thread.Name = "ProcessTextureSenderThread"; diff --git a/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs b/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs index 317a935..aa33982 100644 --- a/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs +++ b/OpenSim/Region/CoreModules/Communications/Local/LocalInterregionComms.cs @@ -168,7 +168,7 @@ namespace OpenSim.Region.CoreModules.Communications.Local //Utils.LongToUInts(regionHandle, out x, out y); //x = x / Constants.RegionSize; //y = y / Constants.RegionSize; - //Console.WriteLine("\n >>> Local SendReleaseAgent " + x + "-" + y); + //m_log.Debug("\n >>> Local SendReleaseAgent " + x + "-" + y); foreach (Scene s in m_sceneList) { if (s.RegionInfo.RegionHandle == regionHandle) @@ -187,7 +187,7 @@ namespace OpenSim.Region.CoreModules.Communications.Local //Utils.LongToUInts(regionHandle, out x, out y); //x = x / Constants.RegionSize; //y = y / Constants.RegionSize; - //Console.WriteLine("\n >>> Local SendCloseAgent " + x + "-" + y); + //m_log.Debug("\n >>> Local SendCloseAgent " + x + "-" + y); foreach (Scene s in m_sceneList) { if (s.RegionInfo.RegionHandle == regionHandle) diff --git a/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs index 593d621..b19f0fa 100644 --- a/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/Communications/REST/RESTInterregionComms.cs @@ -273,7 +273,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST { // Eventually, we want to use a caps url instead of the agentID string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + aCircuit.AgentID + "/"; - //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); + //m_log.Debug(" >>> DoCreateChildAgentCall <<< " + uri); WebRequest AgentCreateRequest = WebRequest.Create(uri); AgentCreateRequest.Method = "POST"; @@ -358,7 +358,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST { // Eventually, we want to use a caps url instead of the agentID string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + cAgentData.AgentID + "/"; - //Console.WriteLine(" >>> DoChildAgentUpdateCall <<< " + uri); + //m_log.Debug(" >>> DoChildAgentUpdateCall <<< " + uri); WebRequest ChildUpdateRequest = WebRequest.Create(uri); ChildUpdateRequest.Method = "PUT"; @@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST protected bool DoReleaseAgentCall(ulong regionHandle, UUID id, string uri) { - //Console.WriteLine(" >>> DoReleaseAgentCall <<< " + uri); + //m_log.Debug(" >>> DoReleaseAgentCall <<< " + uri); WebRequest request = WebRequest.Create(uri); request.Method = "DELETE"; @@ -474,7 +474,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST { string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/agent/" + id + "/" + region.RegionHandle.ToString() +"/"; - //Console.WriteLine(" >>> DoCloseAgentCall <<< " + uri); + //m_log.Debug(" >>> DoCloseAgentCall <<< " + uri); WebRequest request = WebRequest.Create(uri); request.Method = "DELETE"; @@ -508,7 +508,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST { ulong regionHandle = GetRegionHandle(region.RegionHandle); string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + sog.UUID + "/" + regionHandle.ToString() + "/"; - //Console.WriteLine(" >>> DoCreateChildAgentCall <<< " + uri); + //m_log.Debug(" >>> DoCreateChildAgentCall <<< " + uri); WebRequest ObjectCreateRequest = WebRequest.Create(uri); ObjectCreateRequest.Method = "POST"; @@ -588,7 +588,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST protected bool DoHelloNeighbourCall(RegionInfo region, RegionInfo thisRegion) { string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; - //Console.WriteLine(" >>> DoHelloNeighbourCall <<< " + uri); + //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); WebRequest HelloNeighbourRequest = WebRequest.Create(uri); HelloNeighbourRequest.Method = "POST"; @@ -681,11 +681,11 @@ namespace OpenSim.Region.CoreModules.Communications.REST { //m_log.Debug("[CONNECTION DEBUGGING]: AgentHandler Called"); - //Console.WriteLine("---------------------------"); - //Console.WriteLine(" >> uri=" + request["uri"]); - //Console.WriteLine(" >> content-type=" + request["content-type"]); - //Console.WriteLine(" >> http-method=" + request["http-method"]); - //Console.WriteLine("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -833,7 +833,7 @@ namespace OpenSim.Region.CoreModules.Communications.REST protected virtual void DoAgentDelete(Hashtable request, Hashtable responsedata, UUID id, string action, ulong regionHandle) { - //Console.WriteLine(" >>> DoDelete action:" + action + "; regionHandle:" + regionHandle); + //m_log.Debug(" >>> DoDelete action:" + action + "; regionHandle:" + regionHandle); if (action.Equals("release")) m_localBackend.SendReleaseAgent(regionHandle, id, ""); @@ -852,11 +852,11 @@ namespace OpenSim.Region.CoreModules.Communications.REST { //m_log.Debug("[CONNECTION DEBUGGING]: ObjectHandler Called"); - //Console.WriteLine("---------------------------"); - //Console.WriteLine(" >> uri=" + request["uri"]); - //Console.WriteLine(" >> content-type=" + request["content-type"]); - //Console.WriteLine(" >> http-method=" + request["http-method"]); - //Console.WriteLine("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; @@ -964,11 +964,11 @@ namespace OpenSim.Region.CoreModules.Communications.REST { //m_log.Debug("[CONNECTION DEBUGGING]: RegionHandler Called"); - //Console.WriteLine("---------------------------"); - //Console.WriteLine(" >> uri=" + request["uri"]); - //Console.WriteLine(" >> content-type=" + request["content-type"]); - //Console.WriteLine(" >> http-method=" + request["http-method"]); - //Console.WriteLine("---------------------------\n"); + //m_log.Debug("---------------------------"); + //m_log.Debug(" >> uri=" + request["uri"]); + //m_log.Debug(" >> content-type=" + request["content-type"]); + //m_log.Debug(" >> http-method=" + request["http-method"]); + //m_log.Debug("---------------------------\n"); Hashtable responsedata = new Hashtable(); responsedata["content_type"] = "text/html"; diff --git a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs index c1fe5c7..203ab32 100644 --- a/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs +++ b/OpenSim/Region/CoreModules/Hypergrid/HGWorldMapModule.cs @@ -94,7 +94,7 @@ namespace OpenSim.Region.CoreModules.Hypergrid //m_scene.ForEachScenePresence(delegate (ScenePresence sp) { // if (!sp.IsChildAgent && sp.UUID == remoteClient.AgentId) // { - // Console.WriteLine("XXX Root agent"); + // m_log.Debug("XXX Root agent"); // DoRequestMapBlocks(remoteClient, minX, minY, maxX, maxY, flag); // } //}; diff --git a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs index c9a63bd..8065f42 100644 --- a/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs +++ b/OpenSim/Region/CoreModules/InterGrid/OpenGridProtocolModule.cs @@ -375,7 +375,7 @@ namespace OpenSim.Region.CoreModules.InterGrid public OSD RequestRezAvatarMethod(string path, OSD request) { - //System.Console.WriteLine("[REQUESTREZAVATAR]: " + request.ToString()); + //m_log.Debug("[REQUESTREZAVATAR]: " + request.ToString()); OSDMap requestMap = (OSDMap)request; @@ -602,7 +602,7 @@ namespace OpenSim.Region.CoreModules.InterGrid } } - //System.Console.WriteLine("Response:" + responseMap.ToString()); + //m_log.Debug("Response:" + responseMap.ToString()); return responseMap; } diff --git a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs index ab404bd..b4ec7ae 100644 --- a/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/DynamicTexture/DynamicTextureModule.cs @@ -35,6 +35,8 @@ using OpenMetaverse.Imaging; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using log4net; +using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { @@ -86,7 +88,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture { if (RenderPlugins.ContainsKey(contentType)) { - //Console.WriteLine("dynamic texture being created: " + url + " of type " + contentType); + //m_log.Debug("dynamic texture being created: " + url + " of type " + contentType); DynamicTextureUpdater updater = new DynamicTextureUpdater(); updater.SimUUID = simID; @@ -192,6 +194,8 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture public class DynamicTextureUpdater { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public bool BlendWithOldTexture = false; public string BodyData; public string ContentType; @@ -302,8 +306,7 @@ namespace OpenSim.Region.CoreModules.Scripting.DynamicTexture } catch (Exception) { - Console.WriteLine( - "[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); + m_log.Error("[DYNAMICTEXTUREMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } return result; diff --git a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs index 96618e0..4abc55d 100644 --- a/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/LoadImageURL/LoadImageURLModule.cs @@ -34,11 +34,15 @@ using OpenMetaverse; using OpenMetaverse.Imaging; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using log4net; +using System.Reflection; namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL { public class LoadImageURLModule : IRegionModule, IDynamicTextureRender { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private string m_name = "LoadImageURL"; private Scene m_scene; private IDynamicTextureManager m_textureManager; @@ -203,8 +207,7 @@ namespace OpenSim.Region.CoreModules.Scripting.LoadImageURL } catch (Exception) { - Console.WriteLine( - "[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); + m_log.Error("[LOADIMAGEURLMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } m_textureManager.ReturnData(state.RequestID, imageJ2000); diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs index e7fabbe..4fb500e 100644 --- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs @@ -36,6 +36,8 @@ using OpenMetaverse; using OpenMetaverse.Imaging; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using log4net; +using System.Reflection; //using Cairo; @@ -43,6 +45,8 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender { public class VectorRenderModule : IRegionModule, IDynamicTextureRender { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private string m_name = "VectorRenderModule"; private Scene m_scene; private IDynamicTextureManager m_textureManager; @@ -317,7 +321,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender } catch (Exception) { - Console.WriteLine( + m_log.Error( "[VECTORRENDERMODULE]: OpenJpeg Encode Failed. Empty byte data returned!"); } m_textureManager.ReturnData(id, imageJ2000); @@ -333,7 +337,7 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender catch (Exception) { //Ckrinke: Add a WriteLine to remove the warning about 'e' defined but not used - // Console.WriteLine("Problem with Draw. Please verify parameters." + e.ToString()); + // m_log.Debug("Problem with Draw. Please verify parameters." + e.ToString()); parsed = -1; } diff --git a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs index 38cb502..d917adc 100644 --- a/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs +++ b/OpenSim/Region/CoreModules/Scripting/XMLRPC/XMLRPCModule.cs @@ -333,7 +333,7 @@ namespace OpenSim.Region.CoreModules.Scripting.XMLRPC } else { - Console.WriteLine("UNABLE TO REMOVE COMPLETED REQUEST"); + m_log.Error("UNABLE TO REMOVE COMPLETED REQUEST"); } } } diff --git a/OpenSim/Region/CoreModules/World/Terrain/Effects/CookieCutter.cs b/OpenSim/Region/CoreModules/World/Terrain/Effects/CookieCutter.cs index 1824231..58b02f9 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Effects/CookieCutter.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Effects/CookieCutter.cs @@ -28,11 +28,15 @@ using System; using OpenSim.Region.CoreModules.World.Terrain.PaintBrushes; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; +using log4net; +using System.Reflection; namespace OpenSim.Region.CoreModules.World.Terrain.Effects { internal class CookieCutter : ITerrainEffect { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + #region ITerrainEffect Members public void RunEffect(ITerrainChannel map) @@ -44,7 +48,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Effects bool[,] smoothMask = new bool[map.Width,map.Height]; bool[,] allowMask = new bool[map.Width,map.Height]; - Console.WriteLine("S1"); + m_log.Info("S1"); // Step one, generate rough mask int x, y; @@ -52,7 +56,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Effects { for (y = 0; y < map.Height; y++) { - Console.Write("."); + m_log.Info("."); smoothMask[x, y] = true; allowMask[x,y] = true; @@ -71,10 +75,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.Effects } } - Console.WriteLine("S2"); + m_log.Info("S2"); //smooth.FloodEffect(map, smoothMask, 4.0); - Console.WriteLine("S3"); + m_log.Info("S3"); for (x = 0; x < map.Width; x++) { for (y = 0; y < map.Height; y++) diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs index b091c60..5b28430 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapImageModule.cs @@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap } catch (Exception e) // LEGIT: Catching problems caused by OpenJPEG p/invoke { - Console.WriteLine("Failed generating terrain map: " + e); + m_log.Error("Failed generating terrain map: " + e); } return imageData; diff --git a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs index 8f61af7..1ab8e26 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/TexturedMapTileRenderer.cs @@ -40,6 +40,8 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { // Hue, Saturation, Value; used for color-interpolation struct HSV { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + public float h; public float s; public float v; @@ -76,10 +78,10 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // (for info about algorithm, see http://en.wikipedia.org/wiki/HSL_and_HSV) public Color toColor() { - if (s < 0f) Console.WriteLine("S < 0: " + s); - else if (s > 1f) Console.WriteLine("S > 1: " + s); - if (v < 0f) Console.WriteLine("V < 0: " + v); - else if (v > 1f) Console.WriteLine("V > 1: " + v); + if (s < 0f) m_log.Debug("S < 0: " + s); + else if (s > 1f) m_log.Debug("S > 1: " + s); + if (v < 0f) m_log.Debug("V < 0: " + v); + else if (v > 1f) m_log.Debug("V > 1: " + v); float f = h / 60f; int sector = (int)f % 6; diff --git a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs index 6bfa73b..38eceb1 100644 --- a/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs +++ b/OpenSim/Region/Framework/Scenes/ChildAgentDataUpdate.cs @@ -31,6 +31,8 @@ using System.Collections.Generic; using OpenSim.Framework; using OpenMetaverse; using OpenMetaverse.StructuredData; +using log4net; +using System.Reflection; namespace OpenSim.Region.Framework.Scenes { @@ -240,6 +242,7 @@ namespace OpenSim.Region.Framework.Scenes public class AgentData : IAgentData { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private UUID m_id; public UUID AgentID { @@ -496,10 +499,10 @@ namespace OpenSim.Region.Framework.Scenes public void Dump() { - System.Console.WriteLine("------------ AgentData ------------"); - System.Console.WriteLine("UUID: " + AgentID); - System.Console.WriteLine("Region: " + RegionHandle); - System.Console.WriteLine("Position: " + Position); + m_log.Info("------------ AgentData ------------"); + m_log.Info("UUID: " + AgentID); + m_log.Info("Region: " + RegionHandle); + m_log.Info("Position: " + Position); } } diff --git a/OpenSim/Region/Framework/Scenes/EntityBase.cs b/OpenSim/Region/Framework/Scenes/EntityBase.cs index 5055e44..fb5c0d1 100644 --- a/OpenSim/Region/Framework/Scenes/EntityBase.cs +++ b/OpenSim/Region/Framework/Scenes/EntityBase.cs @@ -150,7 +150,7 @@ namespace OpenSim.Region.Framework.Scenes protected EntityBase(SerializationInfo info, StreamingContext context) { - //System.Console.WriteLine("EntityBase Deserialize BGN"); + //m_log.Debug("EntityBase Deserialize BGN"); if (info == null) { @@ -187,7 +187,7 @@ namespace OpenSim.Region.Framework.Scenes m_localId = (uint)info.GetValue("m_localId", typeof(uint)); - //System.Console.WriteLine("EntityBase Deserialize END"); + //m_log.Debug("EntityBase Deserialize END"); } [SecurityPermission(SecurityAction.LinkDemand, diff --git a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs index 0faeef1..67cc1a1 100644 --- a/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/Hypergrid/HGSceneCommunicationService.cs @@ -126,7 +126,7 @@ namespace OpenSim.Region.Framework.Scenes.Hypergrid { isHomeUser = HGNetworkServersInfo.Singleton.IsLocalUser(uinfo.UserProfile); realHandle = m_hg.FindRegionHandle(regionHandle); - Console.WriteLine("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); + m_log.Debug("XXX ---- home user? " + isHomeUser + " --- hyperlink? " + isHyperLink + " --- real handle: " + realHandle.ToString()); } /// /// Hypergrid mod stop diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs index 039b81b..db322b4 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs @@ -358,7 +358,7 @@ namespace OpenSim.Region.Framework.Scenes { if (ownerID == CommsManager.UserProfileCacheService.LibraryRoot.Owner) { - //Console.WriteLine("request info for library item"); + //m_log.Debug("request info for library item"); return; } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 659aaa6..2a3f068 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1538,7 +1538,7 @@ namespace OpenSim.Region.Framework.Scenes /// public bool CrossPrimGroupIntoNewRegion(ulong newRegionHandle, SceneObjectGroup grp, bool silent) { - //Console.WriteLine(" >>> CrossPrimGroupIntoNewRegion <<<"); + //m_log.Debug(" >>> CrossPrimGroupIntoNewRegion <<<"); bool successYN = false; grp.RootPart.UpdateFlag = 0; @@ -1695,7 +1695,7 @@ namespace OpenSim.Region.Framework.Scenes public bool IncomingCreateObject(ISceneObject sog) { - //Console.WriteLine(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); + //m_log.Debug(" >>> IncomingCreateObject <<< " + ((SceneObjectGroup)sog).AbsolutePosition + " deleted? " + ((SceneObjectGroup)sog).IsDeleted); SceneObjectGroup newObject; try { @@ -2482,7 +2482,7 @@ namespace OpenSim.Region.Framework.Scenes public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData) { - //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); + //m_log.Debug(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName); ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); if (childAgentUpdate != null) { @@ -2924,7 +2924,7 @@ namespace OpenSim.Region.Framework.Scenes /// public void HandleEditCommand(string[] cmdparams) { - Console.WriteLine("Searching for Primitive: '" + cmdparams[2] + "'"); + m_log.Debug("Searching for Primitive: '" + cmdparams[2] + "'"); List EntityList = GetEntities(); @@ -2941,7 +2941,7 @@ namespace OpenSim.Region.Framework.Scenes new Vector3(Convert.ToSingle(cmdparams[3]), Convert.ToSingle(cmdparams[4]), Convert.ToSingle(cmdparams[5]))); - Console.WriteLine("Edited scale of Primitive: " + part.Name); + m_log.Debug("Edited scale of Primitive: " + part.Name); } } } @@ -3414,7 +3414,7 @@ namespace OpenSim.Region.Framework.Scenes public void TerrainUnAcked(IClientAPI client, int patchX, int patchY) { - //Console.WriteLine("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); + //m_log.Debug("Terrain packet unacked, resending patch: " + patchX + " , " + patchY); client.SendLayerData(patchX, patchY, Heightmap.GetFloatsSerialised()); } diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 9a6bd87..c3b60f8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -372,7 +372,7 @@ namespace OpenSim.Region.Framework.Scenes Dictionary seeds = new Dictionary(avatar.Scene.CapsModule.GetChildrenSeeds(avatar.UUID)); - //Console.WriteLine(" !!! No. of seeds: " + seeds.Count); + //m_log.Debug(" !!! No. of seeds: " + seeds.Count); if (!seeds.ContainsKey(avatar.Scene.RegionInfo.RegionHandle)) seeds.Add(avatar.Scene.RegionInfo.RegionHandle, avatar.ControllingClient.RequestClientInfo().CapsPath); @@ -954,7 +954,7 @@ namespace OpenSim.Region.Framework.Scenes int count = 20; while (m_agentsInTransit.Contains(id) && count-- > 0) { - //Console.WriteLine(" >>> Waiting... " + count); + //m_log.Debug(" >>> Waiting... " + count); Thread.Sleep(1000); } @@ -966,7 +966,7 @@ namespace OpenSim.Region.Framework.Scenes public bool ReleaseAgent(UUID id) { - //Console.WriteLine(" >>> ReleaseAgent called <<< "); + //m_log.Debug(" >>> ReleaseAgent called <<< "); return ResetFromTransit(id); } @@ -1104,7 +1104,7 @@ namespace OpenSim.Region.Framework.Scenes //AgentCircuitData circuitdata = m_controllingClient.RequestClientInfo(); agent.ControllingClient.RequestClientInfo(); - //Console.WriteLine("BEFORE CROSS"); + //m_log.Debug("BEFORE CROSS"); //Scene.DumpChildrenSeeds(UUID); //DumpKnownRegions(); string agentcaps; @@ -1162,7 +1162,7 @@ namespace OpenSim.Region.Framework.Scenes } } - //Console.WriteLine("AFTER CROSS"); + //m_log.Debug("AFTER CROSS"); //Scene.DumpChildrenSeeds(UUID); //DumpKnownRegions(); return agent; @@ -1252,14 +1252,14 @@ namespace OpenSim.Region.Framework.Scenes // private void Dump(string msg, List handles) // { -// Console.WriteLine("-------------- HANDLE DUMP ({0}) ---------", msg); +// m_log.Info"-------------- HANDLE DUMP ({0}) ---------", msg); // foreach (ulong handle in handles) // { // uint x, y; // Utils.LongToUInts(handle, out x, out y); // x = x / Constants.RegionSize; // y = y / Constants.RegionSize; -// Console.WriteLine("({0}, {1})", x, y); +// m_log.Info("({0}, {1})", x, y); // } // } } diff --git a/OpenSim/Region/Framework/Scenes/SceneManager.cs b/OpenSim/Region/Framework/Scenes/SceneManager.cs index 00b49a1..07c77aa 100644 --- a/OpenSim/Region/Framework/Scenes/SceneManager.cs +++ b/OpenSim/Region/Framework/Scenes/SceneManager.cs @@ -322,7 +322,7 @@ namespace OpenSim.Region.Framework.Scenes public bool TrySetCurrentScene(UUID regionID) { - Console.WriteLine("Searching for Region: '{0}'", regionID.ToString()); + m_log.Debug("Searching for Region: '" + regionID + "'"); foreach (Scene scene in m_localScenes) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs index 7d36a63..5c47710 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.Inventory.cs @@ -309,7 +309,7 @@ namespace OpenSim.Region.Framework.Scenes public string GetStateSnapshot() { - //Console.WriteLine(" >>> GetStateSnapshot <<<"); + //m_log.Debug(" >>> GetStateSnapshot <<<"); List assemblies = new List(); Dictionary states = new Dictionary(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 69bc554..d1aef1c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -526,7 +526,7 @@ namespace OpenSim.Region.Framework.Scenes } else { - Console.WriteLine("found unexpected element: " + reader.Name); + m_log.Warn("found unexpected element: " + reader.Name); reader.Read(); } break; diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 27c22eb..1470191 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -320,7 +320,7 @@ namespace OpenSim.Region.Framework.Scenes protected SceneObjectPart(SerializationInfo info, StreamingContext context) { - //System.Console.WriteLine("SceneObjectPart Deserialize BGN"); + //m_log.Debug("SceneObjectPart Deserialize BGN"); m_TextureAnimation = new byte[0]; m_particleSystem = new byte[0]; if (info == null) @@ -333,7 +333,7 @@ namespace OpenSim.Region.Framework.Scenes m_ids = (List)info.GetValue("m_ids", typeof(List)); */ - //System.Console.WriteLine("SceneObjectPart Deserialize END"); + //m_log.Debug("SceneObjectPart Deserialize END"); Rezzed = DateTime.Now; m_inventory = new SceneObjectPartInventory(this); @@ -534,7 +534,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - Console.WriteLine("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); + m_log.Error("[SCENEOBJECTPART]: GROUP POSITION. " + e.Message); } } @@ -619,7 +619,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception ex) { - Console.WriteLine("[SCENEOBJECTPART]: ROTATIONOFFSET" + ex.Message); + m_log.Error("[SCENEOBJECTPART]: ROTATIONOFFSET" + ex.Message); } } @@ -1121,13 +1121,13 @@ if (m_shape != null) { // PrimFlags prevflag = Flags; if ((ObjectFlags & (uint) flag) == 0) { - //Console.WriteLine("Adding flag: " + ((PrimFlags) flag).ToString()); + //m_log.Debug("Adding flag: " + ((PrimFlags) flag).ToString()); _flags |= flag; if (flag == PrimFlags.TemporaryOnRez) ResetExpire(); } - // System.Console.WriteLine("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString()); + // m_log.Debug("Aprev: " + prevflag.ToString() + " curr: " + Flags.ToString()); } /// @@ -2197,10 +2197,10 @@ if (m_shape != null) { // PrimFlags prevflag = Flags; if ((ObjectFlags & (uint) flag) != 0) { - //Console.WriteLine("Removing flag: " + ((PrimFlags)flag).ToString()); + //m_log.Debug("Removing flag: " + ((PrimFlags)flag).ToString()); _flags &= ~flag; } - //System.Console.WriteLine("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); + //m_log.Debug("prev: " + prevflag.ToString() + " curr: " + Flags.ToString()); //ScheduleFullUpdate(); } @@ -3552,7 +3552,7 @@ if (m_shape != null) { { RemFlag(PrimFlags.TemporaryOnRez); } - // System.Console.WriteLine("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); + // m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); ParentGroup.HasGroupChanged = true; ScheduleFullUpdate(); diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index c625a72..9666525 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs @@ -666,7 +666,7 @@ namespace OpenSim.Region.Framework.Scenes fileData = Utils.StringToBytes(invString.BuildString); - //Console.WriteLine(Utils.BytesToString(fileData)); + //m_log.Debug(Utils.BytesToString(fileData)); //m_log.Debug("[PRIM INVENTORY]: RequestInventoryFile fileData: " + Utils.BytesToString(fileData)); if (fileData.Length > 2) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 429b615..dd8c719 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -71,7 +71,7 @@ namespace OpenSim.Region.Framework.Scenes { // ~ScenePresence() // { -// System.Console.WriteLine("[ScenePresence] Destructor called"); +// m_log.Debug("[ScenePresence] Destructor called"); // } private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -409,7 +409,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - Console.WriteLine("[SCENEPRESENCE]: ABSOLUTE POSITION " + e.Message); + m_log.Error("[SCENEPRESENCE]: ABSOLUTE POSITION " + e.Message); } } @@ -449,7 +449,7 @@ namespace OpenSim.Region.Framework.Scenes } catch (Exception e) { - Console.WriteLine("[SCENEPRESENCE]: VELOCITY " + e.Message); + m_log.Error("[SCENEPRESENCE]: VELOCITY " + e.Message); } } @@ -525,20 +525,20 @@ namespace OpenSim.Region.Framework.Scenes DropOldNeighbours(old); Scene.CapsModule.SetChildrenSeed(UUID, seeds); KnownRegions = seeds; - //Console.WriteLine(" ++++++++++AFTER+++++++++++++ "); + //m_log.Debug(" ++++++++++AFTER+++++++++++++ "); //DumpKnownRegions(); } public void DumpKnownRegions() { - Console.WriteLine("================ KnownRegions {0} ================", Scene.RegionInfo.RegionName); + m_log.Info("================ KnownRegions "+Scene.RegionInfo.RegionName+" ================"); foreach (KeyValuePair kvp in KnownRegions) { uint x, y; Utils.LongToUInts(kvp.Key, out x, out y); x = x / Constants.RegionSize; y = y / Constants.RegionSize; - Console.WriteLine(" >> {0}, {1}: {2}", x, y, kvp.Value); + m_log.Info(" >> "+x+", "+y+": "+kvp.Value); } } @@ -991,7 +991,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_knownChildRegions.ContainsKey(regionHandle)) { m_knownChildRegions.Remove(regionHandle); - //Console.WriteLine(" !!! removing known region {0} in {1}. Count = {2}", regionHandle, Scene.RegionInfo.RegionName, m_knownChildRegions.Count); + //m_log.Debug(" !!! removing known region {0} in {1}. Count = {2}", regionHandle, Scene.RegionInfo.RegionName, m_knownChildRegions.Count); } } } @@ -1066,7 +1066,7 @@ namespace OpenSim.Region.Framework.Scenes { //if (m_isChildAgent) //{ - // // Console.WriteLine("DEBUG: HandleAgentUpdate: child agent"); + // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); // return; //} @@ -1406,7 +1406,7 @@ namespace OpenSim.Region.Framework.Scenes catch (Exception ex) { //Why did I get this error? - Console.WriteLine("[SCENEPRESENCE]: DoMoveToPosition" + ex.ToString()); + m_log.Error("[SCENEPRESENCE]: DoMoveToPosition" + ex.ToString()); } } @@ -1923,7 +1923,7 @@ namespace OpenSim.Region.Framework.Scenes { if (m_isChildAgent) { - Console.WriteLine("DEBUG: AddNewMovement: child agent"); + m_log.Debug("DEBUG: AddNewMovement: child agent"); return; } @@ -2507,8 +2507,8 @@ namespace OpenSim.Region.Framework.Scenes x = x / Constants.RegionSize; y = y / Constants.RegionSize; - //Console.WriteLine("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); - //Console.WriteLine("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); + //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); + //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); if (Util.IsOutsideView(x, newRegionX, y, newRegionY)) { byebyeRegions.Add(handle); @@ -2561,7 +2561,7 @@ namespace OpenSim.Region.Framework.Scenes public void ChildAgentDataUpdate(AgentData cAgentData) { - //Console.WriteLine(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); + //m_log.Debug(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); if (!IsChildAgent) return; @@ -2577,7 +2577,7 @@ namespace OpenSim.Region.Framework.Scenes if (!IsChildAgent) return; - //Console.WriteLine(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); + //m_log.Debug(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; @@ -2816,7 +2816,7 @@ namespace OpenSim.Region.Framework.Scenes protected ScenePartUpdate(SerializationInfo info, StreamingContext context) { - //System.Console.WriteLine("ScenePartUpdate Deserialize BGN"); + //m_log.Debug("ScenePartUpdate Deserialize BGN"); if (info == null) { @@ -2827,7 +2827,7 @@ namespace OpenSim.Region.Framework.Scenes LastFullUpdateTime = (uint)info.GetValue("LastFullUpdateTime", typeof(uint)); LastTerseUpdateTime = (uint)info.GetValue("LastTerseUpdateTime", typeof(uint)); - //System.Console.WriteLine("ScenePartUpdate Deserialize END"); + //m_log.Debug("ScenePartUpdate Deserialize END"); } [SecurityPermission(SecurityAction.LinkDemand, @@ -3084,7 +3084,7 @@ namespace OpenSim.Region.Framework.Scenes protected ScenePresence(SerializationInfo info, StreamingContext context) : base (info, context) { - //System.Console.WriteLine("ScenePresence Deserialize BGN"); + //m_log.Debug("ScenePresence Deserialize BGN"); if (info == null) { @@ -3239,7 +3239,7 @@ namespace OpenSim.Region.Framework.Scenes m_state = (byte)info.GetValue("m_state", typeof(byte)); - //System.Console.WriteLine("ScenePresence Deserialize END"); + //m_log.Debug("ScenePresence Deserialize END"); } [SecurityPermission(SecurityAction.LinkDemand, diff --git a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs b/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs index fd7ff96..93bbf32 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs +++ b/OpenSim/Region/Framework/Scenes/Scripting/NullScriptHost.cs @@ -27,11 +27,15 @@ using System; using OpenMetaverse; +using log4net; +using System.Reflection; namespace OpenSim.Region.Framework.Scenes.Scripting { public class NullScriptHost : IScriptHost { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Vector3 m_pos = new Vector3(128, 128, 30); public string Name @@ -80,7 +84,7 @@ namespace OpenSim.Region.Framework.Scenes.Scripting public void SetText(string text, Vector3 color, double alpha) { - Console.WriteLine("Tried to SetText [{0}] on NullScriptHost", text); + m_log.Warn("Tried to SetText "+text+" on NullScriptHost"); } } } diff --git a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs index 58228cc..79ffe44 100644 --- a/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs +++ b/OpenSim/Region/Framework/Scenes/Scripting/ScriptEngineLoader.cs @@ -87,10 +87,10 @@ namespace OpenSim.Region.Framework.Scenes.Scripting //} - //Console.WriteLine("Loading: " + FileName); + //m_log.Debug("Loading: " + FileName); //foreach (Type _t in a.GetTypes()) //{ - // Console.WriteLine("Type: " + _t.ToString()); + // m_log.Debug("Type: " + _t.ToString()); //} Type t; diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs index b2cea5d..039e9a7 100644 --- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs +++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs @@ -144,7 +144,7 @@ namespace OpenSim.Region.Framework.Scenes SimStatsPacket.RegionBlock rb = new SimStatsPacket.RegionBlock(); // Know what's not thread safe in Mono... modifying timers. - // System.Console.WriteLine("Firing Stats Heart Beat"); + // m_log.Debug("Firing Stats Heart Beat"); lock (m_report) { uint regionFlags = 0; diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs index 096b2cb..c984c7d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectBasicTests.cs @@ -55,7 +55,7 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests SceneObjectPart part = SceneSetupHelpers.AddSceneObject(scene); SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId); - //System.Console.WriteLine("retrievedPart : {0}", retrievedPart); + //m_log.Debug("retrievedPart : {0}", retrievedPart); // If the parts have the same UUID then we will consider them as one and the same Assert.That(retrievedPart.UUID, Is.EqualTo(part.UUID)); } @@ -136,4 +136,4 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests Assert.That(retrievedPart, Is.Null); } } -} \ No newline at end of file +} diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs index 3e0f48f..b5dbb38 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectLinkingTests.cs @@ -36,6 +36,8 @@ using OpenSim.Region.Communications.Local; using OpenSim.Region.Framework.Scenes; using OpenSim.Tests.Common.Mock; using OpenSim.Tests.Common.Setup; +using log4net; +using System.Reflection; namespace OpenSim.Region.CoreModules.Scenes.Tests { @@ -45,6 +47,8 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests [TestFixture] public class SceneObjectLinkingTests { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + [Test] public void TestLinkDelink2SceneObjects() { @@ -80,10 +84,10 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests if (debugtest) { - System.Console.WriteLine("parts: {0}", grp1.Children.Count); - System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); - System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); - System.Console.WriteLine("Group1: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.OffsetPosition, part2.RotationOffset); + m_log.Debug("parts: " + grp1.Children.Count); + m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); + m_log.Debug("Group1: Prim1: OffsetPosition:"+ part1.OffsetPosition+", OffsetRotation:"+part1.RotationOffset); + m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+part2.RotationOffset); } // root part should have no offset position or rotation @@ -101,13 +105,13 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); if (debugtest) - System.Console.WriteLine(rotEuler1); + m_log.Debug(rotEuler1); part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); if (debugtest) - System.Console.WriteLine(rotEuler2); + m_log.Debug(rotEuler2); Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); @@ -115,7 +119,7 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests grp1.DelinkFromGroup(part2.LocalId); if (debugtest) - System.Console.WriteLine("Group2: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); + m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset); Assert.That(grp1.Children.Count, Is.EqualTo(1), "Group 1 still contained part2 after delink."); Assert.That(part2.AbsolutePosition == Vector3.Zero); @@ -175,16 +179,16 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests if (debugtest) { - System.Console.WriteLine("--------After Link-------"); - System.Console.WriteLine("Group1: parts: {0}", grp1.Children.Count); - System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); - System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); - System.Console.WriteLine("Group1: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part2.OffsetPosition, part2.RotationOffset); + m_log.Debug("--------After Link-------"); + m_log.Debug("Group1: parts:" + grp1.Children.Count); + m_log.Debug("Group1: Pos:"+grp1.AbsolutePosition+", Rot:"+grp1.Rotation); + m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); + m_log.Debug("Group1: Prim2: OffsetPosition:"+part2.OffsetPosition+", OffsetRotation:"+ part2.RotationOffset); - System.Console.WriteLine("Group3: parts: {0}", grp3.Children.Count); - System.Console.WriteLine("Group3: Pos:{0}, Rot:{1}", grp3.AbsolutePosition, grp3.Rotation); - System.Console.WriteLine("Group3: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part3.OffsetPosition, part3.RotationOffset); - System.Console.WriteLine("Group3: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part4.OffsetPosition, part4.RotationOffset); + m_log.Debug("Group3: parts:"+grp3.Children.Count); + m_log.Debug("Group3: Pos:"+grp3.AbsolutePosition+", Rot:"+grp3.Rotation); + m_log.Debug("Group3: Prim1: OffsetPosition:"+part3.OffsetPosition+", OffsetRotation:"+part3.RotationOffset); + m_log.Debug("Group3: Prim2: OffsetPosition:"+part4.OffsetPosition+", OffsetRotation:"+part4.RotationOffset); } // Required for linking @@ -206,13 +210,13 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests Vector3 rotEuler1 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); if (debugtest) - System.Console.WriteLine(rotEuler1); + m_log.Debug(rotEuler1); part2.RotationOffset.GetEulerAngles(out roll, out pitch, out yaw); Vector3 rotEuler2 = new Vector3(roll * Utils.RAD_TO_DEG, pitch * Utils.RAD_TO_DEG, yaw * Utils.RAD_TO_DEG); if (debugtest) - System.Console.WriteLine(rotEuler2); + m_log.Debug(rotEuler2); Assert.That(rotEuler2.ApproxEquals(new Vector3(-180, 0, 0), 0.001f) || rotEuler2.ApproxEquals(new Vector3(180, 0, 0), 0.001f)); @@ -225,16 +229,16 @@ namespace OpenSim.Region.CoreModules.Scenes.Tests if (debugtest) { - System.Console.WriteLine("--------After De-Link-------"); - System.Console.WriteLine("Group1: parts: {0}", grp1.Children.Count); - System.Console.WriteLine("Group1: Pos:{0}, Rot:{1}", grp1.AbsolutePosition, grp1.Rotation); - System.Console.WriteLine("Group1: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part1.OffsetPosition, part1.RotationOffset); - System.Console.WriteLine("NoGroup: Prim2: AbsolutePosition:{0}, OffsetRotation:{1}", part2.AbsolutePosition, part2.RotationOffset); - - System.Console.WriteLine("Group3: parts: {0}", grp3.Children.Count); - System.Console.WriteLine("Group3: Pos:{0}, Rot:{1}", grp3.AbsolutePosition, grp3.Rotation); - System.Console.WriteLine("Group3: Prim1: OffsetPosition:{0}, OffsetRotation:{1}", part3.OffsetPosition, part3.RotationOffset); - System.Console.WriteLine("Group3: Prim2: OffsetPosition:{0}, OffsetRotation:{1}", part4.OffsetPosition, part4.RotationOffset); + m_log.Debug("--------After De-Link-------"); + m_log.Debug("Group1: parts:" + grp1.Children.Count); + m_log.Debug("Group1: Pos:" + grp1.AbsolutePosition + ", Rot:" + grp1.Rotation); + m_log.Debug("Group1: Prim1: OffsetPosition:" + part1.OffsetPosition + ", OffsetRotation:" + part1.RotationOffset); + m_log.Debug("Group1: Prim2: OffsetPosition:" + part2.OffsetPosition + ", OffsetRotation:" + part2.RotationOffset); + + m_log.Debug("Group3: parts:" + grp3.Children.Count); + m_log.Debug("Group3: Pos:" + grp3.AbsolutePosition + ", Rot:" + grp3.Rotation); + m_log.Debug("Group3: Prim1: OffsetPosition:" + part3.OffsetPosition + ", OffsetRotation:" + part3.RotationOffset); + m_log.Debug("Group3: Prim2: OffsetPosition:" + part4.OffsetPosition + ", OffsetRotation:" + part4.RotationOffset); } Assert.That(part2.AbsolutePosition == Vector3.Zero); diff --git a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs b/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs index 9fbbb15..f23fc06 100644 --- a/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs +++ b/OpenSim/Region/Framework/Scenes/Types/BasicQuadTreeNode.cs @@ -53,7 +53,7 @@ namespace OpenSim.Region.Framework.Scenes.Types m_leftY = leftY; m_width = width; m_height = height; - // Console.WriteLine("creating quadtree node " + m_quadID); + // m_log.Debug("creating quadtree node " + m_quadID); } public void AddObject(SceneObjectGroup obj) diff --git a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs index 452ada9..2b7611f 100644 --- a/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs +++ b/OpenSim/Region/Framework/Scenes/Types/UpdateQueue.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Framework.Scenes.Types protected UpdateQueue(SerializationInfo info, StreamingContext context) { - //System.Console.WriteLine("UpdateQueue Deserialize BGN"); + //m_log.Debug("UpdateQueue Deserialize BGN"); if (info == null) { @@ -107,7 +107,7 @@ namespace OpenSim.Region.Framework.Scenes.Types m_ids.Add(new UUID(guid)); } - //System.Console.WriteLine("UpdateQueue Deserialize END"); + //m_log.Debug("UpdateQueue Deserialize END"); } [SecurityPermission(SecurityAction.LinkDemand, diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs index 72575e5..72dc70f 100644 --- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs +++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs @@ -35,6 +35,8 @@ using OpenMetaverse.Imaging; using System.Drawing; using System.Drawing.Imaging; using PrimMesher; +using log4net; +using System.Reflection; namespace OpenSim.Region.Physics.Meshing { @@ -57,6 +59,7 @@ namespace OpenSim.Region.Physics.Meshing public class Meshmerizer : IMesher { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); //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 @@ -155,9 +158,9 @@ namespace OpenSim.Region.Physics.Meshing private void ReportPrimError(string message, string primName, PrimMesh primMesh) { - Console.WriteLine(message); - Console.WriteLine("\nPrim Name: " + primName); - Console.WriteLine("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString()); + m_log.Error(message); + m_log.Error("\nPrim Name: " + primName); + m_log.Error("****** PrimMesh Parameters ******\n" + primMesh.ParamsToDisplayString()); } @@ -185,17 +188,17 @@ namespace OpenSim.Region.Physics.Meshing } catch (DllNotFoundException) { - System.Console.WriteLine("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!"); + m_log.Error("[PHYSICS]: OpenJpeg is not installed correctly on this system. Physics Proxy generation failed. Often times this is because of an old version of GLIBC. You must have version 2.4 or above!"); return null; } catch (IndexOutOfRangeException) { - System.Console.WriteLine("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed"); + m_log.Error("[PHYSICS]: OpenJpeg was unable to decode this. Physics Proxy generation failed"); return null; } catch (Exception) { - System.Console.WriteLine("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed!"); + m_log.Error("[PHYSICS]: Unable to generate a Sculpty physics proxy. Sculpty texture decode failed!"); return null; } @@ -285,7 +288,7 @@ namespace OpenSim.Region.Physics.Meshing if (profileEnd > 1.0f) profileEnd = 1.0f; } #if SPAM - Console.WriteLine("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString()); + m_log.Debug("****** PrimMesh Parameters (Linear) ******\n" + primMesh.ParamsToDisplayString()); #endif try { @@ -316,7 +319,7 @@ namespace OpenSim.Region.Physics.Meshing if (profileEnd > 1.0f) profileEnd = 1.0f; } #if SPAM - Console.WriteLine("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString()); + m_log.Debug("****** PrimMesh Parameters (Circular) ******\n" + primMesh.ParamsToDisplayString()); #endif try { @@ -378,7 +381,7 @@ namespace OpenSim.Region.Physics.Meshing if ((!isPhysical) && size.X < minSizeForComplexMesh && size.Y < minSizeForComplexMesh && size.Z < minSizeForComplexMesh) { #if SPAM - Console.WriteLine("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + + m_log.Debug("Meshmerizer: prim " + primName + " has a size of " + size.ToString() + " which is below threshold of " + minSizeForComplexMesh.ToString() + " - creating simple bounding box" ); #endif diff --git a/OpenSim/Region/Physics/Meshing/PrimMesher.cs b/OpenSim/Region/Physics/Meshing/PrimMesher.cs index c28577d..86c9c08 100644 --- a/OpenSim/Region/Physics/Meshing/PrimMesher.cs +++ b/OpenSim/Region/Physics/Meshing/PrimMesher.cs @@ -29,6 +29,8 @@ using System; using System.Collections.Generic; using System.Text; using System.IO; +using log4net; +using System.Reflection; namespace PrimMesher { @@ -576,6 +578,7 @@ namespace PrimMesher /// internal class Profile { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private const float twoPi = 2.0f * (float)Math.PI; internal List coords; @@ -643,8 +646,8 @@ namespace PrimMesher try { angles.makeAngles(sides, startAngle, stopAngle); } catch (Exception ex) { - Console.WriteLine("makeAngles failed: Exception: " + ex.ToString()); - Console.WriteLine("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + m_log.Error("makeAngles failed: Exception: " + ex.ToString()); + m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); return; } @@ -663,8 +666,8 @@ namespace PrimMesher try { hollowAngles.makeAngles(hollowSides, startAngle, stopAngle); } catch (Exception ex) { - Console.WriteLine("makeAngles failed: Exception: " + ex.ToString()); - Console.WriteLine("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); + m_log.Error("makeAngles failed: Exception: " + ex.ToString()); + m_log.Error("sides: " + sides.ToString() + " startAngle: " + startAngle.ToString() + " stopAngle: " + stopAngle.ToString()); return; } } diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 16e0efe..9991ab1 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -669,7 +669,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_pidControllerActive = false; force *= 100f; doForce(force); - //System.Console.WriteLine("Push!"); + //m_log.Debug("Push!"); //_target_velocity.X += force.X; // _target_velocity.Y += force.Y; //_target_velocity.Z += force.Z; diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index bfb9b1a..6d07b92 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -2507,7 +2507,7 @@ namespace OpenSim.Region.Physics.OdePlugin } else { - //System.Console.WriteLine(Math.Abs(m_lastposition.X - l_position.X).ToString()); + //m_log.Debug(Math.Abs(m_lastposition.X - l_position.X).ToString()); _zeroFlag = false; } @@ -2569,7 +2569,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_rotationalVelocity.setValues(rotvel.X, rotvel.Y, rotvel.Z); } - //System.Console.WriteLine("ODE: " + m_rotationalVelocity.ToString()); + //m_log.Debug("ODE: " + m_rotationalVelocity.ToString()); _orientation.X = ori.X; _orientation.Y = ori.Y; _orientation.Z = ori.Z; diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs index c913639..6ee23db 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs @@ -31,12 +31,16 @@ using NUnit.Framework; using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Physics.Manager; +using log4net; +using System.Reflection; namespace OpenSim.Region.Physics.OdePlugin { [TestFixture] public class ODETestClass { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private OdePlugin cbt; private PhysicsScene ps; private IMeshingPlugin imp; @@ -92,18 +96,18 @@ namespace OpenSim.Region.Physics.OdePlugin Assert.That(oprim.m_targetSpace != (IntPtr)0); //Assert.That(oprim.m_targetSpace == pscene.space); - Console.WriteLine("TargetSpace: " + oprim.m_targetSpace + " - SceneMainSpace: " + pscene.space); + m_log.Info("TargetSpace: " + oprim.m_targetSpace + " - SceneMainSpace: " + pscene.space); Assert.That(!oprim.m_taintadd); - Console.WriteLine("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); + m_log.Info("Prim Position (" + oprim.m_localID + "): " + prim.Position.ToString()); // Make sure we're above the ground //Assert.That(prim.Position.Z > 20f); - //Console.WriteLine("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); + //m_log.Info("PrimCollisionScore (" + oprim.m_localID + "): " + oprim.m_collisionscore); // Make sure we've got a Body Assert.That(oprim.Body != (IntPtr)0); - //Console.WriteLine( + //m_log.Info( } // Make sure we're not somewhere above the ground diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f30de4d..359e7b3 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -579,7 +579,7 @@ namespace OpenSim.Region.Physics.OdePlugin //if (id == d.GeomClassId.TriMeshClass) //{ // m_log.InfoFormat("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); + //m_log.Debug("near: A collision was detected between {1} and {2}", 0, name1, name2); //} // Figure out how many contact points we have @@ -945,8 +945,8 @@ namespace OpenSim.Region.Physics.OdePlugin // so lets throttle them and send them again after it's somewhat sorted out. p2.ThrottleUpdates = true; } - //System.Console.WriteLine(count.ToString()); - //System.Console.WriteLine("near: A collision was detected between {1} and {2}", 0, name1, name2); + //m_log.Debug(count.ToString()); + //m_log.Debug("near: A collision was detected between {1} and {2}", 0, name1, name2); } } @@ -2095,7 +2095,7 @@ namespace OpenSim.Region.Physics.OdePlugin // convenient place to do it for now... // //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f) - // //Console.WriteLine("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString()); + // //m_log.Debug("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString()); int iPropertiesNotSupportedDefault = 0; if (pbs.SculptEntry && !meshSculptedPrim) diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 18935fb..5579848 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs @@ -32,6 +32,8 @@ using OpenSim.Framework; using OpenSim.Region.Physics.Manager; using PhysXWrapper; using Quaternion=OpenMetaverse.Quaternion; +using System.Reflection; +using log4net; namespace OpenSim.Region.Physics.PhysXPlugin { @@ -40,6 +42,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin /// public class PhysXPlugin : IPhysicsPlugin { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private PhysXScene _mScene; public PhysXPlugin() @@ -72,6 +75,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin public class PhysXScene : PhysicsScene { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private List _characters = new List(); private List _prims = new List(); private float[] _heightMap = null; @@ -84,7 +88,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin //sceneIdentifier = _sceneIdentifier; mySdk = NxPhysicsSDK.CreateSDK(); - Console.WriteLine("Sdk created - now creating scene"); + m_log.Info("Sdk created - now creating scene"); scene = mySdk.CreateScene(); } @@ -174,7 +178,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin } catch (Exception e) { - Console.WriteLine(e.Message); + m_log.Error(e.Message); } return fps; } @@ -193,7 +197,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin { if (_heightMap != null) { - Console.WriteLine("PhysX - deleting old terrain"); + m_log.Debug("PhysX - deleting old terrain"); scene.DeleteTerrain(); } _heightMap = heightMap; diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs index 31c0d4d..2ebc8b7 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/EventQueueManager.cs @@ -314,7 +314,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine // Do we have any scripts in this object at all? If not, return if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) { - //Console.WriteLine("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); + //m_log.Debug("Event \String.Empty + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); return false; } diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/MaintenanceThread.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/MaintenanceThread.cs index c157509..d1d9027 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/MaintenanceThread.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/MaintenanceThread.cs @@ -181,7 +181,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine if (DateTime.Now.Ticks - Last_ReReadConfigFilens > m_ScriptEngine.RefreshConfigFilens) { - //Console.WriteLine("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens); + //m_log.Debug("Time passed: " + (DateTime.Now.Ticks - Last_ReReadConfigFilens) + ">" + m_ScriptEngine.RefreshConfigFilens); // Its time to re-read config file m_ScriptEngine.ReadConfig(); Last_ReReadConfigFilens = DateTime.Now.Ticks; // Reset time diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index c1902ba..bdf80c6 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs @@ -45,9 +45,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine [Serializable] public class ScriptEngine : IRegionModule, IScriptEngine, IScriptModule { - private static readonly ILog m_log = - LogManager.GetLogger( - MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static List ScriptEngines = new List(); @@ -265,7 +263,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine } catch (AppDomainUnloadedException) { - Console.WriteLine("[SCRIPT]: state change called when "+ + m_log.Error("[SCRIPT]: state change called when "+ "script was unloaded. Nothing to worry about, "+ "but noting the occurance"); } @@ -285,7 +283,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine } catch (AppDomainUnloadedException) { - Console.WriteLine("[SCRIPT]: state change called when "+ + m_log.Error("[SCRIPT]: state change called when "+ "script was unloaded. Nothing to worry about, but "+ "noting the occurance"); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 5455b53..bc113db 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -58,6 +58,7 @@ using LSL_List = OpenSim.Region.ScriptEngine.Shared.LSL_Types.list; using LSL_Rotation = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Quaternion; using LSL_String = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLString; using LSL_Vector = OpenSim.Region.ScriptEngine.Shared.LSL_Types.Vector3; +using System.Reflection; namespace OpenSim.Region.ScriptEngine.Shared.Api { @@ -66,6 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api /// public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); protected IScriptEngine m_ScriptEngine; protected SceneObjectPart m_host; protected uint m_localID; @@ -1135,7 +1137,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api public LSL_Integer llGetStatus(int status) { m_host.AddScriptLPS(1); - // Console.WriteLine(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); + // m_log.Debug(m_host.ToString() + " status is " + m_host.GetEffectiveObjectFlags().ToString()); switch (status) { case ScriptBaseClass.STATUS_PHYSICS: @@ -2706,8 +2708,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api msg.fromAgentID = new Guid(m_host.UUID.ToString()); // fromAgentID.Guid; msg.toAgentID = new Guid(user); // toAgentID.Guid; msg.imSessionID = new Guid(friendTransactionID.ToString()); // This is the item we're mucking with here -// Console.WriteLine("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); -// Console.WriteLine("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); +// m_log.Debug("[Scripting IM]: From:" + msg.fromAgentID.ToString() + " To: " + msg.toAgentID.ToString() + " Session:" + msg.imSessionID.ToString() + " Message:" + message); +// m_log.Debug("[Scripting IM]: Filling Session: " + msg.imSessionID.ToString()); msg.timestamp = (uint)Util.UnixTimeSinceEpoch();// timestamp; //if (client != null) //{ @@ -7882,7 +7884,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api } catch(Exception e) { - Console.WriteLine("[LSL_API]: llRequestSimulatorData" + e.ToString()); + m_log.Error("[LSL_API]: llRequestSimulatorData" + e.ToString()); return UUID.Zero.ToString(); } } @@ -9068,7 +9070,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); string data = enc.GetString(a.Data); - //Console.WriteLine(data); + //m_log.Debug(data); NotecardCache.Cache(id, data); AsyncCommands. DataserverPlugin.DataserverReply(id.ToString(), @@ -9114,7 +9116,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding(); string data = enc.GetString(a.Data); - //Console.WriteLine(data); + //m_log.Debug(data); NotecardCache.Cache(id, data); AsyncCommands. DataserverPlugin.DataserverReply(id.ToString(), diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 597592d..7834a83 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs @@ -842,7 +842,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api for (i=0;i /// Contains the script to execute functions in. /// @@ -92,7 +95,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase /// public override Object InitializeLifetimeService() { - //Console.WriteLine("Executor: InitializeLifetimeService()"); + //m_log.Debug("Executor: InitializeLifetimeService()"); // return null; ILease lease = (ILease)base.InitializeLifetimeService(); @@ -108,7 +111,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase public scriptEvents GetStateEventFlags(string state) { - //Console.WriteLine("Get event flags for " + state); + //m_log.Debug("Get event flags for " + state); // Check to see if we've already computed the flags for this state scriptEvents eventFlags = scriptEvents.None; @@ -124,19 +127,19 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase foreach (KeyValuePair kvp in m_eventFlagsMap) { string evname = state + "_event_" + kvp.Key; - //Console.WriteLine("Trying event "+evname); + //m_log.Debug("Trying event "+evname); try { MethodInfo mi = type.GetMethod(evname); if (mi != null) { - //Console.WriteLine("Found handler for " + kvp.Key); + //m_log.Debug("Found handler for " + kvp.Key); eventFlags |= kvp.Value; } } catch(Exception) { - //Console.WriteLine("Exeption in GetMethod:\n"+e.ToString()); + //m_log.Debug("Exeption in GetMethod:\n"+e.ToString()); } } @@ -144,7 +147,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase if (eventFlags != 0) m_stateEvents.Add(state, eventFlags); - //Console.WriteLine("Returning {0:x}", eventFlags); + //m_log.Debug("Returning {0:x}", eventFlags); return (eventFlags); } @@ -156,7 +159,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase string EventName = state + "_event_" + FunctionName; //#if DEBUG - //Console.WriteLine("ScriptEngine: Script event function name: " + EventName); + //m_log.Debug("ScriptEngine: Script event function name: " + EventName); //#endif if (Events.ContainsKey(EventName) == false) @@ -170,7 +173,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase } catch { - Console.WriteLine("Event {0}not found", EventName); + m_log.Error("Event "+EventName+" not found."); // Event name not found, cache it as not found Events.Add(EventName, null); } @@ -182,13 +185,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase if (ev == null) // No event by that name! { - //Console.WriteLine("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty); + //m_log.Debug("ScriptEngine Can not find any event named: \String.Empty + EventName + "\String.Empty); return; } //cfk 2-7-08 dont need this right now and the default Linux build has DEBUG defined #if DEBUG - //Console.WriteLine("ScriptEngine: Executing function name: " + EventName); + //m_log.Debug("ScriptEngine: Executing function name: " + EventName); #endif // Found try diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs index 5a9b0aa..9cdffaa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/YieldProlog/YP.cs @@ -36,6 +36,7 @@ using System.Reflection; using System.Net.Sockets; using System.Text; using System.Text.RegularExpressions; +using log4net; namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog { @@ -45,6 +46,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog /// public class YP { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static Fail _fail = new Fail(); private static Repeat _repeat = new Repeat(); private static Dictionary> _predicatesStore = @@ -2341,7 +2343,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog string results = ""; for (Match m = Regex.Match(inData,inPattern); m.Success; m=m.NextMatch()) { - //Console.WriteLine( m ); + //m_log.Debug( m ); results += presep+ m + postsep; } return results; @@ -2359,7 +2361,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog } catch { - Console.WriteLine("Failed to connect to server at {0}:999", "localhost"); + m_log.Error("Failed to connect to server at localhost:999"); return ""; } @@ -2379,16 +2381,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.YieldProlog streamWriter.Flush(); cycOutputString = streamReader.ReadLine(); - Console.WriteLine("Cycoutput:" + cycOutputString); + m_log.Debug("Cycoutput:" + cycOutputString); //streamWriter.WriteLine("Client Message"); - //Console.WriteLine("Client Message"); + //m_log.Debug("Client Message"); streamWriter.Flush(); } } catch { - Console.WriteLine("Exception reading from Server"); + m_log.Error("Exception reading from Server"); return ""; } // tidy up diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs index a7cf369..f07512c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/YP2CSConverter.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools YP.see(myCode_SR); YP.tell(myCS_SW); - //Console.WriteLine("Mycode\n ===================================\n" + myCode+"\n"); + //m_log.Debug("Mycode\n ===================================\n" + myCode+"\n"); // disable warning: don't see how we can code this differently short // of rewriting the whole thing @@ -78,9 +78,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools foreach (bool l2 in YPCompiler.makeFunctionPseudoCode(TermList, FunctionCode)) { // ListPair VFC = new ListPair(FunctionCode, new Variable()); - //Console.WriteLine("-------------------------") - //Console.WriteLine(FunctionCode.ToString()) - //Console.WriteLine("-------------------------") + //m_log.Debug("-------------------------") + //m_log.Debug(FunctionCode.ToString()) + //m_log.Debug("-------------------------") YPCompiler.convertFunctionCSharp(FunctionCode); //YPCompiler.convertStringCodesCSharp(VFC); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index c1d6f8e..bcd4ccd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs @@ -451,11 +451,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance public void VarDump(Dictionary vars) { - Console.WriteLine("Variable dump for script {0}", m_ItemID.ToString()); + m_log.Info("Variable dump for script "+ m_ItemID.ToString()); foreach (KeyValuePair v in vars) { - Console.WriteLine("Variable: {0} = '{1}'", v. Key, - v.Value.ToString()); + m_log.Info("Variable: "+v.Key+" = "+v.Value.ToString()); } } @@ -881,7 +880,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance } catch(Exception e) { - Console.WriteLine("Unable to save xml\n"+e.ToString()); + m_log.Error("Unable to save xml\n"+e.ToString()); } if (!File.Exists(Path.Combine(Path.GetDirectoryName(assembly), m_ItemID.ToString() + ".state"))) { diff --git a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs index b1b82e5..770c546 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/EventManager.cs @@ -83,7 +83,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine if (part == null) return; - Console.WriteLine("Paid: {0} from {1}, amount {2}", objectID,agentID,amount); + m_log.Debug("Paid: " + objectID + " from " + agentID + ", amount " + amount); if (part.ParentGroup != null) part = part.ParentGroup.RootPart; diff --git a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs index 93f29d7..3259686 100644 --- a/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs +++ b/OpenSim/ScriptEngine/Components/DotNetEngine/Scheduler/BaseClassFactory.cs @@ -108,7 +108,7 @@ namespace OpenSim.ScriptEngine.Components.DotNetEngine.Scheduler // ilgen.Emit(OpCodes.Call, typeof(string).GetMethod //("Format", new Type[] { typeof(string), typeof(object) })); - // // Console.WriteLine("Hello, World!"); + // // m_log.Debug("Hello, World!"); // // // ilgen.Emit(OpCodes.Call, typeof(Console).GetMethod // ("WriteLine", new Type[] { typeof(string) })); @@ -237,4 +237,4 @@ namespace OpenSim.ScriptEngine.Components.DotNetEngine.Scheduler //string a = ""; } } -} \ No newline at end of file +} diff --git a/OpenSim/ScriptEngine/Shared/EventParams.cs b/OpenSim/ScriptEngine/Shared/EventParams.cs index 0962aec..28eaa58 100644 --- a/OpenSim/ScriptEngine/Shared/EventParams.cs +++ b/OpenSim/ScriptEngine/Shared/EventParams.cs @@ -30,6 +30,8 @@ using System.Collections.Generic; using System.Text; using OpenMetaverse; using OpenSim.Region.ScriptEngine.Shared; +using log4net; +using System.Reflection; namespace OpenSim.ScriptEngine.Shared { @@ -38,6 +40,7 @@ namespace OpenSim.ScriptEngine.Shared /// public class EventParams { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public string EventName; public Object[] Params; public Region.ScriptEngine.Shared.DetectParams[] DetectParams; @@ -66,9 +69,14 @@ namespace OpenSim.ScriptEngine.Shared } public void test2(string functionName, params object[] args) { - System.Console.WriteLine(functionName, args); + String logMessage = functionName; + foreach (object arg in args) + { + logMessage +=", "+arg; + } + m_log.Debug(logMessage); } } -} \ No newline at end of file +} -- cgit v1.1