Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Update logger names and debug messages to use new lambda expression
Browse files Browse the repository at this point in the history
  • Loading branch information
thomast74 committed Sep 2, 2012
1 parent 6f4e7fa commit 4e2e9b7
Show file tree
Hide file tree
Showing 4 changed files with 507 additions and 543 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public abstract class AssemblyTypeScanner : IAssemblyTypeScanner
/// <summary>
/// Logger Instance.
/// </summary>
protected static ILog Logger = LogManager.GetLogger(typeof(AssemblyTypeScanner));
protected static readonly ILog Logger = LogManager.GetLogger<AssemblyTypeScanner>();

/// <summary>
/// Names of Assemblies to exclude from being loaded for scanning.
Expand Down Expand Up @@ -185,11 +185,8 @@ private List<string> GetAllAssembliesInPath()
assemblies.AddRange(DiscoverAssemblies(folderPath, "*.dll"));
assemblies.AddRange(DiscoverAssemblies(folderPath, "*.exe"));


if (Logger.IsDebugEnabled)
{
Logger.Debug(string.Format("Assemblies to be scanned: {0}", StringUtils.ArrayToCommaDelimitedString(assemblies.ToArray())));
}
Logger.Debug(m => m("Assemblies to be scanned: {0}", StringUtils.ArrayToCommaDelimitedString(assemblies.ToArray())));

return assemblies;
}

Expand Down Expand Up @@ -226,9 +223,7 @@ private Assembly TryLoadAssemblyFromPath(string filename)
catch (Exception ex)
{
//log and swallow everything that might go wrong here...
if (Logger.IsDebugEnabled)
Logger.Debug(
string.Format("Failed to load assembly {0} to inspect for [Configuration] types!", filename), ex);
Logger.Debug(m => m("Failed to load assembly {0} to inspect for [Configuration] types!", filename), ex);
}

return assembly;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
using Spring.Objects.Factory.Config;
using Spring.Util;
using Spring.Proxy;
using Common.Logging;

namespace Spring.Context.Attributes
{
Expand Down Expand Up @@ -86,7 +87,7 @@ private sealed class ConfigurationClassInterceptor : IConfigurationClassIntercep
{
#region Logging

private static readonly Common.Logging.ILog LOG = Common.Logging.LogManager.GetLogger(typeof(ConfigurationClassInterceptor));
private static readonly ILog Logger = LogManager.GetLogger<ConfigurationClassInterceptor>();

#endregion

Expand Down Expand Up @@ -116,25 +117,12 @@ public bool ProcessDefinition(MethodInfo method, out object instance)

if (this._configurableListableObjectFactory.IsCurrentlyInCreation(objectName))
{
#region Logging

if (LOG.IsDebugEnabled)
{
LOG.Debug(String.Format("Object '{0}' currently in creation, created one", objectName));
}

#endregion
Logger.Debug(m => m("Object '{0}' currently in creation, created one", objectName));

return false;
}
#region Logging

if (LOG.IsDebugEnabled)
{
LOG.Debug(String.Format("Object '{0}' not in creation, asked the application context for one", objectName));
}

#endregion
Logger.Debug(m => m("Object '{0}' not in creation, asked the application context for one", objectName));

instance = this._configurableListableObjectFactory.GetObject(objectName);
return true;
Expand Down
Loading

0 comments on commit 4e2e9b7

Please sign in to comment.