From fed46ba6a72b5df424909cbc8eff9c6134da3ac1 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 22 Feb 2008 22:54:50 +0000 Subject: * Winnow the debug and info messages associated with stat fetching * As such, only a request for a non cached asset, the response and failures show up now. * I know lbsa71 only put these in not long ago, so if they are really still required, I think we should think whether we can move the default log4net level off 'Debug' --- .../Framework/Communications/Cache/AssetCache.cs | 23 ++++++++++++++++------ .../Communications/Cache/AssetServerBase.cs | 2 ++ .../Communications/Cache/GridAssetClient.cs | 18 +++++++++-------- 3 files changed, 29 insertions(+), 14 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/Cache/AssetCache.cs b/OpenSim/Framework/Communications/Cache/AssetCache.cs index 15b52b0..c1f6719 100644 --- a/OpenSim/Framework/Communications/Cache/AssetCache.cs +++ b/OpenSim/Framework/Communications/Cache/AssetCache.cs @@ -250,7 +250,9 @@ namespace OpenSim.Framework.Communications.Cache } else { - m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: Adding request for {0} {1}", isTexture ? "texture" : "asset", assetId); + #endif NewAssetRequest req = new NewAssetRequest(assetId, callback); @@ -384,14 +386,17 @@ namespace OpenSim.Framework.Communications.Cache } } } - - m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: Adding {0} {1} [{2}]: {3}.", temporary, type, asset.FullID, result); + #endif } // See IAssetReceiver public void AssetReceived(AssetBase asset, bool IsTexture) { + #if DEBUG m_log.DebugFormat("[ASSET CACHE]: Recieved {0} [{1}]", IsTexture ? "texture" : "asset", asset.FullID); + #endif if (asset.FullID != LLUUID.Zero) // if it is set to zero then the asset wasn't found by the server { @@ -405,7 +410,9 @@ namespace OpenSim.Framework.Communications.Cache TextureImage image = new TextureImage(asset); if (Textures.ContainsKey(image.FullID)) { - m_log.DebugFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID); + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: There's already an texture {0} in memory. Skipping.", asset.FullID); + #endif } else { @@ -422,7 +429,9 @@ namespace OpenSim.Framework.Communications.Cache AssetInfo assetInf = new AssetInfo(asset); if (Assets.ContainsKey(assetInf.FullID)) { - m_log.DebugFormat("[ASSET CACHE]: There's already an asset {0} in memory. Skipping.", asset.FullID); + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: There's already an asset {0} in memory. Skipping.", asset.FullID); + #endif } else { @@ -435,7 +444,9 @@ namespace OpenSim.Framework.Communications.Cache if (RequestedAssets.ContainsKey(assetInf.FullID)) { - m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); + #if DEBUG + //m_log.DebugFormat("[ASSET CACHE]: Moving {0} from RequestedAssets to AssetRequests", asset.FullID); + #endif AssetRequest req = RequestedAssets[assetInf.FullID]; req.AssetInf = assetInf; diff --git a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs index cae4231..4b5df5c 100644 --- a/OpenSim/Framework/Communications/Cache/AssetServerBase.cs +++ b/OpenSim/Framework/Communications/Cache/AssetServerBase.cs @@ -137,7 +137,9 @@ namespace OpenSim.Framework.Communications.Cache req.IsTexture = isTexture; m_assetRequests.Enqueue(req); + #if DEBUG m_log.InfoFormat("[ASSET SERVER]: Added {0} to request queue", assetID); + #endif } public virtual void UpdateAsset(AssetBase asset) diff --git a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs index 8114eb0..baa6058 100644 --- a/OpenSim/Framework/Communications/Cache/GridAssetClient.cs +++ b/OpenSim/Framework/Communications/Cache/GridAssetClient.cs @@ -52,7 +52,9 @@ namespace OpenSim.Framework.Communications.Cache Stream s = null; try { - m_log.DebugFormat("[ASSETCACHE]: Querying for {0}", req.AssetID.ToString()); + #if DEBUG + //m_log.DebugFormat("[GRID ASSET CLIENT]: Querying for {0}", req.AssetID.ToString()); + #endif RestClient rc = new RestClient(_assetServerUrl); rc.AddResourcePath("assets"); @@ -72,9 +74,9 @@ namespace OpenSim.Framework.Communications.Cache } catch (Exception e) { - m_log.Error("[ASSETCACHE]: " + e.Message); - m_log.DebugFormat("[ASSETCACHE]: Getting asset {0}", req.AssetID.ToString()); - m_log.Error("[ASSETCACHE]: " + e.StackTrace); + m_log.Error("[GRID ASSET CLIENT]: " + e.Message); + m_log.DebugFormat("[GRID ASSET CLIENT]: Getting asset {0}", req.AssetID.ToString()); + m_log.Error("[GRID ASSET CLIENT]: " + e.StackTrace); } return null; @@ -95,19 +97,19 @@ namespace OpenSim.Framework.Communications.Cache // XmlSerializer xs = new XmlSerializer(typeof(AssetBase)); // xs.Serialize(s, asset); // RestClient rc = new RestClient(_assetServerUrl); - m_log.Info("[ASSET]: Storing asset"); + m_log.Info("[GRID ASSET CLIENT]: Storing asset"); //rc.AddResourcePath("assets"); // rc.RequestMethod = "POST"; // rc.Request(s); //m_log.InfoFormat("[ASSET]: Stored {0}", rc); - m_log.Info("[ASSET]: Sending to " + _assetServerUrl + "/assets/"); + m_log.Info("[GRID ASSET CLIENT]: Sending to " + _assetServerUrl + "/assets/"); RestObjectPoster.BeginPostObject(_assetServerUrl + "/assets/", asset); } catch (Exception e) { - m_log.Error("[ASSETS]: " + e.Message); + m_log.Error("[GRID ASSET CLIENT]: " + e.Message); } } @@ -122,4 +124,4 @@ namespace OpenSim.Framework.Communications.Cache #endregion } -} \ No newline at end of file +} -- cgit v1.1