* 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'
afrisby-rexmerge
Justin Clarke Casey 2008-02-22 22:54:50 +00:00
parent 46cfc475aa
commit fed46ba6a7
3 changed files with 29 additions and 14 deletions

View File

@ -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;

View File

@ -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)

View File

@ -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<AssetBase>(_assetServerUrl + "/assets/", asset);
}
catch (Exception e)
{
m_log.Error("[ASSETS]: " + e.Message);
m_log.Error("[GRID ASSET CLIENT]: " + e.Message);
}
}