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. --- .../AssetLoader/Filesystem/AssetLoaderFileSystem.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'OpenSim/Framework/AssetLoader/Filesystem') diff --git a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs index 59db3d6..9026331 100644 --- a/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs +++ b/OpenSim/Framework/AssetLoader/Filesystem/AssetLoaderFileSystem.cs @@ -44,6 +44,8 @@ namespace OpenSim.Framework.AssetLoader.Filesystem { public class AssetLoaderFileSystem : IAssetLoader { + private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); + protected AssetBase CreateAsset(string assetIdStr, string name, string path, bool isImage) { AssetBase asset = new AssetBase( @@ -53,13 +55,13 @@ namespace OpenSim.Framework.AssetLoader.Filesystem if (!String.IsNullOrEmpty(path)) { - MainLog.Instance.Verbose("ASSETS", "Loading: [{0}][{1}]", name, path); + m_log.Info(String.Format("[ASSETS]: Loading: [{0}][{1}]", name, path)); LoadAsset(asset, isImage, path); } else { - MainLog.Instance.Verbose("ASSETS", "Instantiated: [{0}]", name); + m_log.Info(String.Format("[ASSETS]: Instantiated: [{0}]", name)); } return asset; @@ -106,14 +108,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem } catch (XmlException e) { - MainLog.Instance.Error("ASSETS", "Error loading {0} : {1}", assetSetPath, e); + m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e)); } } else { - MainLog.Instance.Error( - "ASSETS", - "Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); + m_log.Error("[ASSETS]: Asset set control file assets/AssetSets.xml does not exist! No assets loaded."); } assets.ForEach(action); @@ -126,7 +126,7 @@ namespace OpenSim.Framework.AssetLoader.Filesystem /// protected void LoadXmlAssetSet(string assetSetPath, List assets) { - MainLog.Instance.Verbose("ASSETS", "Loading asset set {0}", assetSetPath); + m_log.Info(String.Format("[ASSETS]: Loading asset set {0}", assetSetPath)); if (File.Exists(assetSetPath)) { @@ -152,12 +152,12 @@ namespace OpenSim.Framework.AssetLoader.Filesystem } catch (XmlException e) { - MainLog.Instance.Error("ASSETS", "Error loading {0} : {1}", assetSetPath, e); + m_log.Error(String.Format("[ASSETS]: Error loading {0} : {1}", assetSetPath, e)); } } else { - MainLog.Instance.Error("ASSETS", "Asset set file {0} does not exist!", assetSetPath); + m_log.Error(String.Format("[ASSETS]: Asset set file {0} does not exist!", assetSetPath)); } } } -- cgit v1.1