From 6ed5283bc06a62f38eb517e67b975832b603bf61 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 5 Feb 2008 19:44:27 +0000 Subject: Converted logging to use log4net. Changed LogBase to ConsoleBase, which handles console I/O. This is mostly an in-place conversion, so lots of refactoring can still be done. --- .../Scenes/SceneObjectPart.Inventory.cs | 62 +++++++++++----------- 1 file changed, 32 insertions(+), 30 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs') diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs index d4e2102..d9ee94c 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.Inventory.cs @@ -41,6 +41,8 @@ namespace OpenSim.Region.Environment.Scenes { public partial class SceneObjectPart : IScriptHost { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + private string m_inventoryFileName = String.Empty; /// @@ -131,10 +133,10 @@ namespace OpenSim.Region.Environment.Scenes /// public void StartScript(TaskInventoryItem item) { -// MainLog.Instance.Verbose( -// "PRIMINVENTORY", -// "Starting script {0}, {1} in prim {2}, {3}", -// item.Name, item.ItemID, Name, UUID); +// m_log.Info(String.Format( +// "[PRIMINVENTORY]: " + +// "Starting script {0}, {1} in prim {2}, {3}", +// item.Name, item.ItemID, Name, UUID)); AssetBase rezAsset = m_parentGroup.Scene.AssetCache.GetAsset(item.AssetID, false); @@ -145,10 +147,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Couldn't start script {0}, {1} since asset ID {2} could not be found", - item.Name, item.ItemID, item.AssetID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Couldn't start script {0}, {1} since asset ID {2} could not be found", + item.Name, item.ItemID, item.AssetID)); } } @@ -168,10 +170,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}", - itemId, Name, UUID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Couldn't start script with ID {0} since it couldn't be found for prim {1}, {2}", + itemId, Name, UUID)); } } } @@ -188,10 +190,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", - itemId, Name, UUID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Couldn't stop script with ID {0} since it couldn't be found for prim {1}, {2}", + itemId, Name, UUID)); } } @@ -251,10 +253,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", - itemID, Name, UUID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", + itemID, Name, UUID)); } } @@ -283,10 +285,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", - item.ItemID, Name, UUID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Tried to retrieve item ID {0} from prim {1}, {2} but the item does not exist in this inventory", + item.ItemID, Name, UUID)); } } @@ -316,10 +318,10 @@ namespace OpenSim.Region.Environment.Scenes } else { - MainLog.Instance.Error( - "PRIMINVENTORY", - "Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory", - itemID, Name, UUID); + m_log.Error(String.Format( + "[PRIMINVENTORY]: " + + "Tried to remove item ID {0} from prim {1}, {2} but the item does not exist in this inventory", + itemID, Name, UUID)); } } @@ -384,8 +386,8 @@ namespace OpenSim.Region.Environment.Scenes fileData = Helpers.StringToField(invString.BuildString); -// MainLog.Instance.Verbose( -// "PRIMINVENTORY", "RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData)); +// m_log.Info(String.Format( +// "[PRIMINVENTORY]: RequestInventoryFile fileData: {0}", Helpers.FieldToUTF8String(fileData))); if (fileData.Length > 2) { -- cgit v1.1