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. --- .../Communications/InventoryServiceBase.cs | 24 ++++++++++++---------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'OpenSim/Framework/Communications/InventoryServiceBase.cs') diff --git a/OpenSim/Framework/Communications/InventoryServiceBase.cs b/OpenSim/Framework/Communications/InventoryServiceBase.cs index a48988d..897aa9a 100644 --- a/OpenSim/Framework/Communications/InventoryServiceBase.cs +++ b/OpenSim/Framework/Communications/InventoryServiceBase.cs @@ -36,6 +36,8 @@ namespace OpenSim.Framework.Communications { public abstract class InventoryServiceBase : IInventoryServices { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + protected Dictionary m_plugins = new Dictionary(); //protected IAssetServer m_assetServer; @@ -52,7 +54,7 @@ namespace OpenSim.Framework.Communications { if (!String.IsNullOrEmpty(FileName)) { - MainLog.Instance.Verbose("AGENTINVENTORY", "Inventorystorage: Attempting to load " + FileName); + m_log.Info("[AGENTINVENTORY]: Inventorystorage: Attempting to load " + FileName); Assembly pluginAssembly = Assembly.LoadFrom(FileName); foreach (Type pluginType in pluginAssembly.GetTypes()) @@ -67,7 +69,7 @@ namespace OpenSim.Framework.Communications (IInventoryData) Activator.CreateInstance(pluginAssembly.GetType(pluginType.ToString())); plug.Initialise(); m_plugins.Add(plug.getName(), plug); - MainLog.Instance.Verbose("AGENTINVENTORY", "Added IInventoryData Interface"); + m_log.Info("[AGENTINVENTORY]: Added IInventoryData Interface"); } } } @@ -95,9 +97,8 @@ namespace OpenSim.Framework.Communications rootFolder = plugin.Value.getUserRootFolder(userID); if (rootFolder != null) { - MainLog.Instance.Verbose( - "INVENTORY", - "Found root folder for user with ID " + userID + ". Retrieving inventory contents."); + m_log.Info( + "[INVENTORY]: Found root folder for user with ID " + userID + ". Retrieving inventory contents."); inventoryList = plugin.Value.getInventoryFolders(rootFolder.folderID); inventoryList.Insert(0, rootFolder); @@ -105,8 +106,8 @@ namespace OpenSim.Framework.Communications } } - MainLog.Instance.Warn( - "INVENTORY", "Could not find a root folder belonging to user with ID " + userID); + m_log.Warn( + "[INVENTORY]: Could not find a root folder belonging to user with ID " + userID); return inventoryList; } @@ -226,10 +227,10 @@ namespace OpenSim.Framework.Communications if (null != existingRootFolder) { - MainLog.Instance.Error( - "AGENTINVENTORY", - "Did not create a new inventory for user {0} since they already have " - + "a root inventory folder with id {1}", user, existingRootFolder); + m_log.Error( + String.Format("[AGENTINVENTORY]: " + + "Did not create a new inventory for user {0} since they already have " + + "a root inventory folder with id {1}", user, existingRootFolder)); } else { @@ -251,6 +252,7 @@ namespace OpenSim.Framework.Communications public virtual void CreateNewInventorySet(LLUUID user) { InventoryFolderBase folder = new InventoryFolderBase(); + folder.parentID = LLUUID.Zero; folder.agentID = user; folder.folderID = LLUUID.Random(); -- cgit v1.1