aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Communications/Cache/AssetCache.cs
diff options
context:
space:
mode:
authorJeff Ames2008-02-05 19:44:27 +0000
committerJeff Ames2008-02-05 19:44:27 +0000
commit6ed5283bc06a62f38eb517e67b975832b603bf61 (patch)
treee5f635018789b73a99ddeca0883a68368fa5eece /OpenSim/Framework/Communications/Cache/AssetCache.cs
parentCut down on the number of packets sent during terraforming. Terraforming shou... (diff)
downloadopensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.zip
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.gz
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.bz2
opensim-SC_OLD-6ed5283bc06a62f38eb517e67b975832b603bf61.tar.xz
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.
Diffstat (limited to 'OpenSim/Framework/Communications/Cache/AssetCache.cs')
-rw-r--r--OpenSim/Framework/Communications/Cache/AssetCache.cs21
1 files changed, 10 insertions, 11 deletions
diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs
index db2d2fe..84713b9 100644
--- a/OpenSim/Framework/Communications/Cache/AssetCache.cs
+++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs
@@ -44,6 +44,8 @@ namespace OpenSim.Framework.Communications.Cache
44 /// </summary> 44 /// </summary>
45 public class AssetCache : IAssetReceiver 45 public class AssetCache : IAssetReceiver
46 { 46 {
47 private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
48
47 public Dictionary<LLUUID, AssetInfo> Assets; 49 public Dictionary<LLUUID, AssetInfo> Assets;
48 public Dictionary<LLUUID, TextureImage> Textures; 50 public Dictionary<LLUUID, TextureImage> Textures;
49 51
@@ -61,14 +63,13 @@ namespace OpenSim.Framework.Communications.Cache
61 private readonly IAssetServer m_assetServer; 63 private readonly IAssetServer m_assetServer;
62 64
63 private readonly Thread m_assetCacheThread; 65 private readonly Thread m_assetCacheThread;
64 private readonly LogBase m_log;
65 66
66 /// <summary> 67 /// <summary>
67 /// 68 ///
68 /// </summary> 69 /// </summary>
69 public AssetCache(IAssetServer assetServer, LogBase log) 70 public AssetCache(IAssetServer assetServer)
70 { 71 {
71 log.Verbose("ASSETSTORAGE", "Creating Asset cache"); 72 m_log.Info("[ASSETSTORAGE]: Creating Asset cache");
72 m_assetServer = assetServer; 73 m_assetServer = assetServer;
73 m_assetServer.SetReceiver(this); 74 m_assetServer.SetReceiver(this);
74 Assets = new Dictionary<LLUUID, AssetInfo>(); 75 Assets = new Dictionary<LLUUID, AssetInfo>();
@@ -76,8 +77,6 @@ namespace OpenSim.Framework.Communications.Cache
76 m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager)); 77 m_assetCacheThread = new Thread(new ThreadStart(RunAssetManager));
77 m_assetCacheThread.IsBackground = true; 78 m_assetCacheThread.IsBackground = true;
78 m_assetCacheThread.Start(); 79 m_assetCacheThread.Start();
79
80 m_log = log;
81 } 80 }
82 81
83 /// <summary> 82 /// <summary>
@@ -94,7 +93,7 @@ namespace OpenSim.Framework.Communications.Cache
94 } 93 }
95 catch (Exception e) 94 catch (Exception e)
96 { 95 {
97 m_log.Error("ASSETCACHE", e.ToString()); 96 m_log.Error("[ASSETCACHE]: " + e.ToString());
98 } 97 }
99 } 98 }
100 } 99 }
@@ -198,8 +197,8 @@ namespace OpenSim.Framework.Communications.Cache
198 } 197 }
199 } while (--maxPolls > 0); 198 } while (--maxPolls > 0);
200 199
201 MainLog.Instance.Warn( 200 m_log.Warn(
202 "ASSETCACHE", "Asset {0} was not received before the retrieval timeout was reached"); 201 String.Format("[ASSETCACHE]: Asset {0} was not received before the retrieval timeout was reached"));
203 202
204 return null; 203 return null;
205 } 204 }
@@ -266,7 +265,7 @@ namespace OpenSim.Framework.Communications.Cache
266 } 265 }
267 } 266 }
268 267
269 m_log.Verbose("ASSETCACHE", "Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); 268 m_log.Info(String.Format("[ASSETCACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result));
270 } 269 }
271 270
272 public void DeleteAsset(LLUUID assetID) 271 public void DeleteAsset(LLUUID assetID)
@@ -362,7 +361,7 @@ namespace OpenSim.Framework.Communications.Cache
362 { 361 {
363 //if (this.RequestedTextures.ContainsKey(assetID)) 362 //if (this.RequestedTextures.ContainsKey(assetID))
364 //{ 363 //{
365 // MainLog.Instance.Warn("ASSET CACHE", "sending image not found for {0}", assetID); 364 // m_log.Warn(String.Format("[ASSET CACHE]: sending image not found for {0}", assetID));
366 // AssetRequest req = this.RequestedTextures[assetID]; 365 // AssetRequest req = this.RequestedTextures[assetID];
367 // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket(); 366 // ImageNotInDatabasePacket notFound = new ImageNotInDatabasePacket();
368 // notFound.ImageID.ID = assetID; 367 // notFound.ImageID.ID = assetID;
@@ -371,7 +370,7 @@ namespace OpenSim.Framework.Communications.Cache
371 //} 370 //}
372 //else 371 //else
373 //{ 372 //{
374 // MainLog.Instance.Error("ASSET CACHE", "Cound not send image not found for {0}", assetID); 373 // m_log.Error(String.Format("[ASSET CACHE]: Cound not send image not found for {0}", assetID));
375 //} 374 //}
376 } 375 }
377 376