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. --- .../Framework/Communications/Cache/AssetServerBase.cs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework/Communications/Cache/AssetServerBase.cs') diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index 09f8a0c..1d8f6ba 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -37,6 +37,8 @@ namespace OpenSim.Framework.Communications.Cache { public abstract class AssetServerBase : IAssetServer { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + protected IAssetReceiver m_receiver; protected BlockingQueue m_assetRequests; protected Thread m_localAssetServerThread; @@ -68,15 +70,15 @@ namespace OpenSim.Framework.Communications.Cache if (asset != null) { - //MainLog.Instance.Verbose( - // "ASSET", "Asset {0} received from asset server", req.AssetID); + //m_log.Info( + // String.Format("[ASSET]: Asset {0} received from asset server", req.AssetID)); m_receiver.AssetReceived(asset, req.IsTexture); } else { - MainLog.Instance.Error( - "ASSET", "Asset {0} not found by asset server", req.AssetID); + m_log.Error( + String.Format("[ASSET]: Asset {0} not found by asset server", req.AssetID)); m_receiver.AssetNotFound(req.AssetID); } @@ -84,7 +86,7 @@ namespace OpenSim.Framework.Communications.Cache public virtual void LoadDefaultAssets() { - MainLog.Instance.Verbose("ASSETSERVER", "Setting up asset database"); + m_log.Info("[ASSETSERVER]: Setting up asset database"); assetLoader.ForEachDefaultXmlAsset(StoreAsset); @@ -94,7 +96,7 @@ namespace OpenSim.Framework.Communications.Cache public AssetServerBase() { - MainLog.Instance.Verbose("ASSETSERVER", "Starting asset storage system"); + m_log.Info("[ASSETSERVER]: Starting asset storage system"); m_assetRequests = new BlockingQueue(); m_localAssetServerThread = new Thread(RunRequests); @@ -114,7 +116,7 @@ namespace OpenSim.Framework.Communications.Cache } catch (Exception e) { - MainLog.Instance.Error("ASSETSERVER", e.Message); + m_log.Error("[ASSETSERVER]: " + e.Message); } } } @@ -131,7 +133,7 @@ namespace OpenSim.Framework.Communications.Cache req.IsTexture = isTexture; m_assetRequests.Enqueue(req); - MainLog.Instance.Verbose("ASSET", "Added {0} to request queue", assetID); + m_log.Info(String.Format("[ASSET]: Added {0} to request queue", assetID)); } public virtual void UpdateAsset(AssetBase asset) -- cgit v1.1