summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/DotNetOpenAuth.Core/App_Packages/LibLog.2.0/LibLog.cs1467
-rw-r--r--src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj15
-rw-r--r--src/DotNetOpenAuth.Core/Logger.cs9
-rw-r--r--src/DotNetOpenAuth.Core/Loggers/ILog.cs851
-rw-r--r--src/DotNetOpenAuth.Core/Loggers/Log4NetLogger.cs219
-rw-r--r--src/DotNetOpenAuth.Core/Loggers/NLogLogger.cs222
-rw-r--r--src/DotNetOpenAuth.Core/Loggers/NoOpLogger.cs159
-rw-r--r--src/DotNetOpenAuth.Core/Loggers/TraceLogger.cs357
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Bindings/StandardReplayProtectionBindingElement.cs3
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Channel.cs10
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs2
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/ErrorUtilities.cs5
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs2
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/Reflection/MessageDescription.cs3
-rw-r--r--src/DotNetOpenAuth.Core/Messaging/StandardMessageFactory.cs6
-rw-r--r--src/DotNetOpenAuth.Core/Reporting.cs7
-rw-r--r--src/DotNetOpenAuth.Core/packages.config3
-rw-r--r--src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/RsaSha1ServiceProviderSigningBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/TokenHandlingBindingElement.cs1
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs4
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/PlaintextSigningBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs1
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs1
-rw-r--r--src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs2
-rw-r--r--src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/ChannelElements/ProviderSigningBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Messages/AssociateRequestProviderTools.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/GsaIcamProfile.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/PpidGeneration.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs3
-rw-r--r--src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/ProviderAssociationHandleEncoder.cs3
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/Messages/AssociateRequestRelyingParty.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs7
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Behaviors/GsaIcamProfile.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/ExtensionsInteropHelper.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAnonymousResponse.cs4
-rw-r--r--src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId.UI/XrdsPublisher.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs5
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SkipSecurityBindingElement.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/AXUtilities.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchRequest.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchResponse.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/ProviderAuthenticationPolicy/DateTimeEncoder.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsRequest.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/IdentifierDiscoveryServices.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/OpenIdUtilities.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs1
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/UriDiscoveryService.cs6
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs2
-rw-r--r--src/DotNetOpenAuth.OpenId/OpenIdXrdsHelperRelyingParty.cs6
-rw-r--r--src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs1
-rw-r--r--src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj1
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs3
-rw-r--r--src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs8
-rw-r--r--src/DotNetOpenAuth.Test/OAuth/ServiceProviderTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs1
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs2
-rw-r--r--src/DotNetOpenAuth.Test/Performance/HighPerformance.cs8
-rw-r--r--src/DotNetOpenAuth.Test/Performance/PerformanceTestUtilities.cs2
-rw-r--r--src/DotNetOpenAuth.Test/TestBase.cs6
-rw-r--r--src/DotNetOpenAuth.Test/TestUtilities.cs18
-rw-r--r--src/DotNetOpenAuth.sln47
-rw-r--r--src/DotNetOpenAuth.sln.DotSettings5
-rw-r--r--src/packages/repositories.config1
88 files changed, 1655 insertions, 1912 deletions
diff --git a/src/DotNetOpenAuth.Core/App_Packages/LibLog.2.0/LibLog.cs b/src/DotNetOpenAuth.Core/App_Packages/LibLog.2.0/LibLog.cs
new file mode 100644
index 0000000..5c5d1d2
--- /dev/null
+++ b/src/DotNetOpenAuth.Core/App_Packages/LibLog.2.0/LibLog.cs
@@ -0,0 +1,1467 @@
+//===============================================================================
+// LibLog
+//
+// https://github.com/damianh/LibLog
+//===============================================================================
+// Copyright © 2011-2014 Damian Hickey. All rights reserved.
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+//===============================================================================
+
+#pragma warning disable 1591
+
+namespace DotNetOpenAuth.Logging
+{
+ using System.Collections.Generic;
+ using DotNetOpenAuth.Logging.LogProviders;
+ using System;
+ using System.Diagnostics;
+ using System.Globalization;
+
+ /// <summary>
+ /// Simple interface that represent a logger.
+ /// </summary>
+ public interface ILog
+ {
+ /// <summary>
+ /// Log a message the specified log level.
+ /// </summary>
+ /// <param name="logLevel">The log level.</param>
+ /// <param name="messageFunc">The message function.</param>
+ /// <param name="exception">An optional exception.</param>
+ /// <returns>true if the message was logged. Otherwise false.</returns>
+ /// <remarks>
+ /// Note to implementers: the message func should not be called if the loglevel is not enabled
+ /// so as not to incur performance penalties.
+ ///
+ /// To check IsEnabled call Log with only LogLevel and check the return value, no event will be written
+ /// </remarks>
+ bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception = null);
+ }
+
+ /// <summary>
+ /// The log level.
+ /// </summary>
+ public enum LogLevel
+ {
+ Trace,
+ Debug,
+ Info,
+ Warn,
+ Error,
+ Fatal
+ }
+
+ public static class LogExtensions
+ {
+ public static bool IsDebugEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Debug, null);
+ }
+
+ public static bool IsErrorEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Error, null);
+ }
+
+ public static bool IsFatalEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Fatal, null);
+ }
+
+ public static bool IsInfoEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Info, null);
+ }
+
+ public static bool IsTraceEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Trace, null);
+ }
+
+ public static bool IsWarnEnabled(this ILog logger)
+ {
+ GuardAgainstNullLogger(logger);
+ return logger.Log(LogLevel.Warn, null);
+ }
+
+ public static void Debug(this ILog logger, Func<string> messageFunc)
+ {
+ GuardAgainstNullLogger(logger);
+ logger.Log(LogLevel.Debug, messageFunc);
+ }
+
+ public static void Debug(this ILog logger, string message)
+ {
+ if (logger.IsDebugEnabled())
+ {
+ logger.Log(LogLevel.Debug, message.AsFunc());
+ }
+ }
+
+ public static void DebugFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsDebugEnabled())
+ {
+ logger.LogFormat(LogLevel.Debug, message, args);
+ }
+ }
+
+ public static void DebugException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsDebugEnabled())
+ {
+ logger.Log(LogLevel.Debug, message.AsFunc(), exception);
+ }
+ }
+
+ public static void Error(this ILog logger, Func<string> messageFunc)
+ {
+ logger.Log(LogLevel.Error, messageFunc);
+ }
+
+ public static void Error(this ILog logger, string message)
+ {
+ if (logger.IsErrorEnabled())
+ {
+ logger.Log(LogLevel.Error, message.AsFunc());
+ }
+ }
+
+ public static void ErrorFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsErrorEnabled())
+ {
+ logger.LogFormat(LogLevel.Error, message, args);
+ }
+ }
+
+ public static void ErrorException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsErrorEnabled())
+ {
+ logger.Log(LogLevel.Error, message.AsFunc(), exception);
+ }
+ }
+
+ public static void Fatal(this ILog logger, Func<string> messageFunc)
+ {
+ logger.Log(LogLevel.Fatal, messageFunc);
+ }
+
+ public static void Fatal(this ILog logger, string message)
+ {
+ if (logger.IsFatalEnabled())
+ {
+ logger.Log(LogLevel.Fatal, message.AsFunc());
+ }
+ }
+
+ public static void FatalFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsFatalEnabled())
+ {
+ logger.LogFormat(LogLevel.Fatal, message, args);
+ }
+ }
+
+ public static void FatalException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsFatalEnabled())
+ {
+ logger.Log(LogLevel.Fatal, message.AsFunc(), exception);
+ }
+ }
+
+ public static void Info(this ILog logger, Func<string> messageFunc)
+ {
+ GuardAgainstNullLogger(logger);
+ logger.Log(LogLevel.Info, messageFunc);
+ }
+
+ public static void Info(this ILog logger, string message)
+ {
+ if (logger.IsInfoEnabled())
+ {
+ logger.Log(LogLevel.Info, message.AsFunc());
+ }
+ }
+
+ public static void InfoFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsInfoEnabled())
+ {
+ logger.LogFormat(LogLevel.Info, message, args);
+ }
+ }
+
+ public static void InfoException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsInfoEnabled())
+ {
+ logger.Log(LogLevel.Info, message.AsFunc(), exception);
+ }
+ }
+
+ public static void Trace(this ILog logger, Func<string> messageFunc)
+ {
+ GuardAgainstNullLogger(logger);
+ logger.Log(LogLevel.Trace, messageFunc);
+ }
+
+ public static void Trace(this ILog logger, string message)
+ {
+ if (logger.IsTraceEnabled())
+ {
+ logger.Log(LogLevel.Trace, message.AsFunc());
+ }
+ }
+
+ public static void TraceFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsTraceEnabled())
+ {
+ logger.LogFormat(LogLevel.Trace, message, args);
+ }
+ }
+
+ public static void TraceException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsTraceEnabled())
+ {
+ logger.Log(LogLevel.Trace, message.AsFunc(), exception);
+ }
+ }
+
+ public static void Warn(this ILog logger, Func<string> messageFunc)
+ {
+ GuardAgainstNullLogger(logger);
+ logger.Log(LogLevel.Warn, messageFunc);
+ }
+
+ public static void Warn(this ILog logger, string message)
+ {
+ if (logger.IsWarnEnabled())
+ {
+ logger.Log(LogLevel.Warn, message.AsFunc());
+ }
+ }
+
+ public static void WarnFormat(this ILog logger, string message, params object[] args)
+ {
+ if (logger.IsWarnEnabled())
+ {
+ logger.LogFormat(LogLevel.Warn, message, args);
+ }
+ }
+
+ public static void WarnException(this ILog logger, string message, Exception exception)
+ {
+ if (logger.IsWarnEnabled())
+ {
+ logger.Log(LogLevel.Warn, message.AsFunc(), exception);
+ }
+ }
+
+ private static void GuardAgainstNullLogger(ILog logger)
+ {
+ if (logger == null)
+ {
+ throw new ArgumentNullException("logger");
+ }
+ }
+
+ private static void LogFormat(this ILog logger, LogLevel logLevel, string message, params object[] args)
+ {
+ var result = string.Format(CultureInfo.InvariantCulture, message, args);
+ logger.Log(logLevel, result.AsFunc());
+ }
+
+ // Avoid the closure allocation, see https://gist.github.com/AArnott/d285feef75c18f6ecd2b
+ private static Func<T> AsFunc<T>(this T value) where T : class
+ {
+ return value.Return;
+ }
+
+ private static T Return<T>(this T value)
+ {
+ return value;
+ }
+ }
+
+ /// <summary>
+ /// Represents a way to get a <see cref="ILog"/>
+ /// </summary>
+ public interface ILogProvider
+ {
+ ILog GetLogger(string name);
+ }
+
+
+ /// <summary>
+ /// Provides a mechanism to create instances of <see cref="ILog" /> objects.
+ /// </summary>
+ public static class LogProvider
+ {
+ private static ILogProvider _currentLogProvider;
+
+ /// <summary>
+ /// Gets a logger for the specified type.
+ /// </summary>
+ /// <typeparam name="T">The type whose name will be used for the logger.</typeparam>
+ /// <returns>An instance of <see cref="ILog"/></returns>
+ public static ILog For<T>()
+ {
+ return GetLogger(typeof(T));
+ }
+
+ /// <summary>
+ /// Gets a logger for the current class.
+ /// </summary>
+ /// <returns>An instance of <see cref="ILog"/></returns>
+ public static ILog GetCurrentClassLogger()
+ {
+ var stackFrame = new StackFrame(1, false);
+ return GetLogger(stackFrame.GetMethod().DeclaringType);
+ }
+
+ /// <summary>
+ /// Gets a logger for the specified type.
+ /// </summary>
+ /// <param name="type">The type whose name will be used for the logger.</param>
+ /// <returns>An instance of <see cref="ILog"/></returns>
+ public static ILog GetLogger(Type type)
+ {
+ return GetLogger(type.FullName);
+ }
+
+ /// <summary>
+ /// Gets a logger with the specified name.
+ /// </summary>
+ /// <param name="name">The name.</param>
+ /// <returns>An instance of <see cref="ILog"/></returns>
+ public static ILog GetLogger(string name)
+ {
+ ILogProvider logProvider = _currentLogProvider ?? ResolveLogProvider();
+ return logProvider == null ? new NoOpLogger() : (ILog)new LoggerExecutionWrapper(logProvider.GetLogger(name));
+ }
+
+ /// <summary>
+ /// Sets the current log provider.
+ /// </summary>
+ /// <param name="logProvider">The log provider.</param>
+ public static void SetCurrentLogProvider(ILogProvider logProvider)
+ {
+ _currentLogProvider = logProvider;
+ }
+
+ public delegate bool IsLoggerAvailable();
+
+ public delegate ILogProvider CreateLogProvider();
+
+ public static readonly List<Tuple<IsLoggerAvailable, CreateLogProvider>> LogProviderResolvers =
+ new List<Tuple<IsLoggerAvailable, CreateLogProvider>>
+ {
+ new Tuple<IsLoggerAvailable, CreateLogProvider>(SerilogLogProvider.IsLoggerAvailable, () => new SerilogLogProvider()),
+ new Tuple<IsLoggerAvailable, CreateLogProvider>(NLogLogProvider.IsLoggerAvailable, () => new NLogLogProvider()),
+ new Tuple<IsLoggerAvailable, CreateLogProvider>(Log4NetLogProvider.IsLoggerAvailable, () => new Log4NetLogProvider()),
+ new Tuple<IsLoggerAvailable, CreateLogProvider>(EntLibLogProvider.IsLoggerAvailable, () => new EntLibLogProvider()),
+ new Tuple<IsLoggerAvailable, CreateLogProvider>(LoupeLogProvider.IsLoggerAvailable, () => new LoupeLogProvider())
+ };
+
+ private static ILogProvider ResolveLogProvider()
+ {
+ try
+ {
+ foreach(var providerResolver in LogProviderResolvers)
+ {
+ if(providerResolver.Item1())
+ {
+ return providerResolver.Item2();
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ Console.WriteLine(
+ "Exception occured resolving a log provider. Logging for this assembly {0} is disabled. {1}",
+ typeof(LogProvider).Assembly.FullName,
+ ex);
+ }
+ return null;
+ }
+
+ public class NoOpLogger : ILog
+ {
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ return false;
+ }
+ }
+ }
+
+ public class LoggerExecutionWrapper : ILog
+ {
+ private readonly ILog _logger;
+ public const string FailedToGenerateLogMessage = "Failed to generate log message";
+
+ public ILog WrappedLogger
+ {
+ get { return _logger; }
+ }
+
+ public LoggerExecutionWrapper(ILog logger)
+ {
+ _logger = logger;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception = null)
+ {
+ if (messageFunc == null)
+ {
+ return _logger.Log(logLevel, null);
+ }
+
+ Func<string> wrappedMessageFunc = () =>
+ {
+ try
+ {
+ return messageFunc();
+ }
+ catch (Exception ex)
+ {
+ Log(LogLevel.Error, () => FailedToGenerateLogMessage, ex);
+ }
+ return null;
+ };
+ return _logger.Log(logLevel, wrappedMessageFunc, exception);
+ }
+ }
+}
+
+namespace DotNetOpenAuth.Logging.LogProviders
+{
+ using System;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using System.Globalization;
+ using System.Linq.Expressions;
+ using System.Reflection;
+ using System.Text;
+ using System.Threading;
+
+ public class NLogLogProvider : ILogProvider
+ {
+ private readonly Func<string, object> _getLoggerByNameDelegate;
+ private static bool _providerIsAvailableOverride = true;
+
+ public NLogLogProvider()
+ {
+ if (!IsLoggerAvailable())
+ {
+ throw new InvalidOperationException("NLog.LogManager not found");
+ }
+ _getLoggerByNameDelegate = GetGetLoggerMethodCall();
+ }
+
+ public static bool ProviderIsAvailableOverride
+ {
+ get { return _providerIsAvailableOverride; }
+ set { _providerIsAvailableOverride = value; }
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new NLogLogger(_getLoggerByNameDelegate(name));
+ }
+
+ public static bool IsLoggerAvailable()
+ {
+ return ProviderIsAvailableOverride && GetLogManagerType() != null;
+ }
+
+ private static Type GetLogManagerType()
+ {
+ return Type.GetType("NLog.LogManager, NLog");
+ }
+
+ private static Func<string, object> GetGetLoggerMethodCall()
+ {
+ Type logManagerType = GetLogManagerType();
+ MethodInfo method = logManagerType.GetMethod("GetLogger", new[] { typeof(string) });
+ ParameterExpression nameParam = Expression.Parameter(typeof(string), "name");
+ MethodCallExpression methodCall = Expression.Call(null, method, new Expression[] { nameParam });
+ return Expression.Lambda<Func<string, object>>(methodCall, new[] { nameParam }).Compile();
+ }
+
+ public class NLogLogger : ILog
+ {
+ private readonly dynamic _logger;
+
+ internal NLogLogger(dynamic logger)
+ {
+ _logger = logger;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ if (messageFunc == null)
+ {
+ return IsLogLevelEnable(logLevel);
+ }
+ if(exception != null)
+ {
+ return LogException(logLevel, messageFunc, exception);
+ }
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ if (_logger.IsDebugEnabled)
+ {
+ _logger.Debug(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Info:
+ if (_logger.IsInfoEnabled)
+ {
+ _logger.Info(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (_logger.IsWarnEnabled)
+ {
+ _logger.Warn(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (_logger.IsErrorEnabled)
+ {
+ _logger.Error(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (_logger.IsFatalEnabled)
+ {
+ _logger.Fatal(messageFunc());
+ return true;
+ }
+ break;
+ default:
+ if (_logger.IsTraceEnabled)
+ {
+ _logger.Trace(messageFunc());
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ private bool LogException(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ if (_logger.IsDebugEnabled)
+ {
+ _logger.DebugException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Info:
+ if (_logger.IsInfoEnabled)
+ {
+ _logger.InfoException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (_logger.IsWarnEnabled)
+ {
+ _logger.WarnException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (_logger.IsErrorEnabled)
+ {
+ _logger.ErrorException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (_logger.IsFatalEnabled)
+ {
+ _logger.FatalException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ default:
+ if (_logger.IsTraceEnabled)
+ {
+ _logger.TraceException(messageFunc(), exception);
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ private bool IsLogLevelEnable(LogLevel logLevel)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ return _logger.IsDebugEnabled;
+ case LogLevel.Info:
+ return _logger.IsInfoEnabled;
+ case LogLevel.Warn:
+ return _logger.IsWarnEnabled;
+ case LogLevel.Error:
+ return _logger.IsErrorEnabled;
+ case LogLevel.Fatal:
+ return _logger.IsFatalEnabled;
+ default:
+ return _logger.IsTraceEnabled;
+ }
+ }
+ }
+ }
+
+ public class Log4NetLogProvider : ILogProvider
+ {
+ private readonly Func<string, object> _getLoggerByNameDelegate;
+ private static bool _providerIsAvailableOverride = true;
+
+ public Log4NetLogProvider()
+ {
+ if (!IsLoggerAvailable())
+ {
+ throw new InvalidOperationException("log4net.LogManager not found");
+ }
+ _getLoggerByNameDelegate = GetGetLoggerMethodCall();
+ }
+
+ public static bool ProviderIsAvailableOverride
+ {
+ get { return _providerIsAvailableOverride; }
+ set { _providerIsAvailableOverride = value; }
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new Log4NetLogger(_getLoggerByNameDelegate(name));
+ }
+
+ public static bool IsLoggerAvailable()
+ {
+ return ProviderIsAvailableOverride && GetLogManagerType() != null;
+ }
+
+ private static Type GetLogManagerType()
+ {
+ return Type.GetType("log4net.LogManager, log4net");
+ }
+
+ private static Func<string, object> GetGetLoggerMethodCall()
+ {
+ Type logManagerType = GetLogManagerType();
+ MethodInfo method = logManagerType.GetMethod("GetLogger", new[] { typeof(string) });
+ ParameterExpression nameParam = Expression.Parameter(typeof(string), "name");
+ MethodCallExpression methodCall = Expression.Call(null, method, new Expression[] { nameParam });
+ return Expression.Lambda<Func<string, object>>(methodCall, new[] { nameParam }).Compile();
+ }
+
+ public class Log4NetLogger : ILog
+ {
+ private readonly dynamic _logger;
+
+ internal Log4NetLogger(dynamic logger)
+ {
+ _logger = logger;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ if (messageFunc == null)
+ {
+ return IsLogLevelEnable(logLevel);
+ }
+ if (exception != null)
+ {
+ return LogException(logLevel, messageFunc, exception);
+ }
+ switch (logLevel)
+ {
+ case LogLevel.Info:
+ if (_logger.IsInfoEnabled)
+ {
+ _logger.Info(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (_logger.IsWarnEnabled)
+ {
+ _logger.Warn(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (_logger.IsErrorEnabled)
+ {
+ _logger.Error(messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (_logger.IsFatalEnabled)
+ {
+ _logger.Fatal(messageFunc());
+ return true;
+ }
+ break;
+ default:
+ if (_logger.IsDebugEnabled)
+ {
+ _logger.Debug(messageFunc()); // Log4Net doesn't have a 'Trace' level, so all Trace messages are written as 'Debug'
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ private bool LogException(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Info:
+ if (_logger.IsDebugEnabled)
+ {
+ _logger.Info(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (_logger.IsWarnEnabled)
+ {
+ _logger.Warn(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (_logger.IsErrorEnabled)
+ {
+ _logger.Error(messageFunc(), exception);
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (_logger.IsFatalEnabled)
+ {
+ _logger.Fatal(messageFunc(), exception);
+ return true;
+ }
+ break;
+ default:
+ if (_logger.IsDebugEnabled)
+ {
+ _logger.Debug(messageFunc(), exception);
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ private bool IsLogLevelEnable(LogLevel logLevel)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ return _logger.IsDebugEnabled;
+ case LogLevel.Info:
+ return _logger.IsInfoEnabled;
+ case LogLevel.Warn:
+ return _logger.IsWarnEnabled;
+ case LogLevel.Error:
+ return _logger.IsErrorEnabled;
+ case LogLevel.Fatal:
+ return _logger.IsFatalEnabled;
+ default:
+ return _logger.IsDebugEnabled;
+ }
+ }
+ }
+ }
+
+ public class EntLibLogProvider : ILogProvider
+ {
+ private const string TypeTemplate = "Microsoft.Practices.EnterpriseLibrary.Logging.{0}, Microsoft.Practices.EnterpriseLibrary.Logging";
+ private static bool _providerIsAvailableOverride = true;
+ private static readonly Type LogEntryType;
+ private static readonly Type LoggerType;
+ private static readonly Action<string, string, TraceEventType> WriteLogEntry;
+ private static Func<string, TraceEventType, bool> ShouldLogEntry;
+
+ static EntLibLogProvider()
+ {
+ LogEntryType = Type.GetType(string.Format(TypeTemplate, "LogEntry"));
+ LoggerType = Type.GetType(string.Format(TypeTemplate, "Logger"));
+ if (LogEntryType == null || LoggerType == null)
+ {
+ return;
+ }
+ WriteLogEntry = GetWriteLogEntry();
+ ShouldLogEntry = GetShouldLogEntry();
+ }
+
+ public EntLibLogProvider()
+ {
+ if (!IsLoggerAvailable())
+ {
+ throw new InvalidOperationException("Microsoft.Practices.EnterpriseLibrary.Logging.Logger not found");
+ }
+ }
+
+ public static bool ProviderIsAvailableOverride
+ {
+ get { return _providerIsAvailableOverride; }
+ set { _providerIsAvailableOverride = value; }
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new EntLibLogger(name, WriteLogEntry, ShouldLogEntry);
+ }
+
+ public static bool IsLoggerAvailable()
+ {
+ return ProviderIsAvailableOverride && LogEntryType != null;
+ }
+
+ private static Action<string, string, TraceEventType> GetWriteLogEntry()
+ {
+ // new LogEntry(...)
+ var logNameParameter = Expression.Parameter(typeof(string), "logName");
+ var messageParameter = Expression.Parameter(typeof(string), "message");
+ var severityParameter = Expression.Parameter(typeof(TraceEventType), "severity");
+
+ MemberInitExpression memberInit = GetWriteLogExpression(messageParameter, severityParameter, logNameParameter);
+
+ //Logger.Write(new LogEntry(....));
+ MethodInfo writeLogEntryMethod = LoggerType.GetMethod("Write", new[] { LogEntryType });
+ var writeLogEntryExpression = Expression.Call(writeLogEntryMethod, memberInit);
+
+ return Expression.Lambda<Action<string, string, TraceEventType>>(
+ writeLogEntryExpression,
+ logNameParameter,
+ messageParameter,
+ severityParameter).Compile();
+ }
+
+ private static Func<string, TraceEventType, bool> GetShouldLogEntry()
+ {
+ // new LogEntry(...)
+ var logNameParameter = Expression.Parameter(typeof(string), "logName");
+ var severityParameter = Expression.Parameter(typeof(TraceEventType), "severity");
+
+ MemberInitExpression memberInit = GetWriteLogExpression(Expression.Constant("***dummy***"), severityParameter, logNameParameter);
+
+ //Logger.Write(new LogEntry(....));
+ MethodInfo writeLogEntryMethod = LoggerType.GetMethod("ShouldLog", new[] { LogEntryType });
+ var writeLogEntryExpression = Expression.Call(writeLogEntryMethod, memberInit);
+
+ return Expression.Lambda<Func<string, TraceEventType, bool>>(
+ writeLogEntryExpression,
+ logNameParameter,
+ severityParameter).Compile();
+ }
+
+ private static MemberInitExpression GetWriteLogExpression(Expression message,
+ ParameterExpression severityParameter, ParameterExpression logNameParameter)
+ {
+ var entryType = LogEntryType;
+ MemberInitExpression memberInit = Expression.MemberInit(Expression.New(entryType), new MemberBinding[]
+ {
+ Expression.Bind(entryType.GetProperty("Message"), message),
+ Expression.Bind(entryType.GetProperty("Severity"), severityParameter),
+ Expression.Bind(entryType.GetProperty("TimeStamp"),
+ Expression.Property(null, typeof (DateTime).GetProperty("UtcNow"))),
+ Expression.Bind(entryType.GetProperty("Categories"),
+ Expression.ListInit(
+ Expression.New(typeof (List<string>)),
+ typeof (List<string>).GetMethod("Add", new[] {typeof (string)}),
+ logNameParameter))
+ });
+ return memberInit;
+ }
+
+ public class EntLibLogger : ILog
+ {
+ private readonly string _loggerName;
+ private readonly Action<string, string, TraceEventType> _writeLog;
+ private readonly Func<string, TraceEventType, bool> _shouldLog;
+
+ internal EntLibLogger(string loggerName, Action<string, string, TraceEventType> writeLog, Func<string, TraceEventType, bool> shouldLog)
+ {
+ _loggerName = loggerName;
+ _writeLog = writeLog;
+ _shouldLog = shouldLog;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ var severity = MapSeverity(logLevel);
+ if (messageFunc == null)
+ {
+ return _shouldLog(_loggerName, severity);
+ }
+ if (exception != null)
+ {
+ return LogException(logLevel, messageFunc, exception);
+ }
+ _writeLog(_loggerName, messageFunc(), severity);
+ return true;
+ }
+
+ public bool LogException(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ var severity = MapSeverity(logLevel);
+ var message = messageFunc() + Environment.NewLine + exception;
+ _writeLog(_loggerName, message, severity);
+ return true;
+ }
+
+ private static TraceEventType MapSeverity(LogLevel logLevel)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Fatal:
+ return TraceEventType.Critical;
+ case LogLevel.Error:
+ return TraceEventType.Error;
+ case LogLevel.Warn:
+ return TraceEventType.Warning;
+ case LogLevel.Info:
+ return TraceEventType.Information;
+ default:
+ return TraceEventType.Verbose;
+ }
+ }
+ }
+ }
+
+ public class SerilogLogProvider : ILogProvider
+ {
+ private readonly Func<string, object> _getLoggerByNameDelegate;
+ private static bool _providerIsAvailableOverride = true;
+
+ public SerilogLogProvider()
+ {
+ if (!IsLoggerAvailable())
+ {
+ throw new InvalidOperationException("Serilog.Log not found");
+ }
+ _getLoggerByNameDelegate = GetForContextMethodCall();
+ }
+
+ public static bool ProviderIsAvailableOverride
+ {
+ get { return _providerIsAvailableOverride; }
+ set { _providerIsAvailableOverride = value; }
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new SerilogLogger(_getLoggerByNameDelegate(name));
+ }
+
+ public static bool IsLoggerAvailable()
+ {
+ return ProviderIsAvailableOverride && GetLogManagerType() != null;
+ }
+
+ private static Type GetLogManagerType()
+ {
+ return Type.GetType("Serilog.Log, Serilog");
+ }
+
+ private static Func<string, object> GetForContextMethodCall()
+ {
+ Type logManagerType = GetLogManagerType();
+ MethodInfo method = logManagerType.GetMethod("ForContext", new[] { typeof(string), typeof(object), typeof(bool) });
+ ParameterExpression propertyNameParam = Expression.Parameter(typeof(string), "propertyName");
+ ParameterExpression valueParam = Expression.Parameter(typeof(object), "value");
+ ParameterExpression destructureObjectsParam = Expression.Parameter(typeof(bool), "destructureObjects");
+ MethodCallExpression methodCall = Expression.Call(null, method, new Expression[]
+ {
+ propertyNameParam,
+ valueParam,
+ destructureObjectsParam
+ });
+ var func = Expression.Lambda<Func<string, object, bool, object>>(methodCall, new[]
+ {
+ propertyNameParam,
+ valueParam,
+ destructureObjectsParam
+ }).Compile();
+ return name => func("Name", name, false);
+ }
+
+ public class SerilogLogger : ILog
+ {
+ private readonly object _logger;
+ private static readonly object DebugLevel;
+ private static readonly object ErrorLevel;
+ private static readonly object FatalLevel;
+ private static readonly object InformationLevel;
+ private static readonly object VerboseLevel;
+ private static readonly object WarningLevel;
+ private static readonly Func<object, object, bool> IsEnabled;
+ private static readonly Action<object, object, string> Write;
+ private static readonly Action<object, object, Exception, string> WriteException;
+
+ static SerilogLogger()
+ {
+ var logEventTypeType = Type.GetType("Serilog.Events.LogEventLevel, Serilog");
+ DebugLevel = Enum.Parse(logEventTypeType, "Debug");
+ ErrorLevel = Enum.Parse(logEventTypeType, "Error");
+ FatalLevel = Enum.Parse(logEventTypeType, "Fatal");
+ InformationLevel = Enum.Parse(logEventTypeType, "Information");
+ VerboseLevel = Enum.Parse(logEventTypeType, "Verbose");
+ WarningLevel = Enum.Parse(logEventTypeType, "Warning");
+
+ // Func<object, object, bool> isEnabled = (logger, level) => { return ((SeriLog.ILogger)logger).IsEnabled(level); }
+ var loggerType = Type.GetType("Serilog.ILogger, Serilog");
+ MethodInfo isEnabledMethodInfo = loggerType.GetMethod("IsEnabled");
+ ParameterExpression instanceParam = Expression.Parameter(typeof(object));
+ UnaryExpression instanceCast = Expression.Convert(instanceParam, loggerType);
+ ParameterExpression levelParam = Expression.Parameter(typeof(object));
+ UnaryExpression levelCast = Expression.Convert(levelParam, logEventTypeType);
+ MethodCallExpression isEnabledMethodCall = Expression.Call(instanceCast, isEnabledMethodInfo, levelCast);
+ IsEnabled = Expression.Lambda<Func<object, object, bool>>(isEnabledMethodCall, new[]
+ {
+ instanceParam,
+ levelParam
+ }).Compile();
+
+ // Action<object, object, string> Write =
+ // (logger, level, message) => { ((SeriLog.ILoggerILogger)logger).Write(level, message, new object[]); }
+ MethodInfo writeMethodInfo = loggerType.GetMethod("Write", new[] { logEventTypeType, typeof(string), typeof(object[]) });
+ ParameterExpression messageParam = Expression.Parameter(typeof(string));
+ ConstantExpression propertyValuesParam = Expression.Constant(new object[0]);
+ MethodCallExpression writeMethodExp = Expression.Call(instanceCast, writeMethodInfo, levelCast, messageParam, propertyValuesParam);
+ Write = Expression.Lambda<Action<object, object, string>>(writeMethodExp, new[]
+ {
+ instanceParam,
+ levelParam,
+ messageParam
+ }).Compile();
+
+ // Action<object, object, string, Exception> WriteException =
+ // (logger, level, exception, message) => { ((ILogger)logger).Write(level, exception, message, new object[]); }
+ MethodInfo writeExceptionMethodInfo = loggerType.GetMethod("Write", new[]
+ {
+ logEventTypeType,
+ typeof(Exception),
+ typeof(string),
+ typeof(object[])
+ });
+ ParameterExpression exceptionParam = Expression.Parameter(typeof(Exception));
+ writeMethodExp = Expression.Call(
+ instanceCast,
+ writeExceptionMethodInfo,
+ levelCast,
+ exceptionParam,
+ messageParam,
+ propertyValuesParam);
+ WriteException = Expression.Lambda<Action<object, object, Exception, string>>(writeMethodExp, new[]
+ {
+ instanceParam,
+ levelParam,
+ exceptionParam,
+ messageParam,
+ }).Compile();
+ }
+
+ internal SerilogLogger(object logger)
+ {
+ _logger = logger;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ if (messageFunc == null)
+ {
+ return IsEnabled(_logger, logLevel);
+ }
+ if (exception != null)
+ {
+ return LogException(logLevel, messageFunc, exception);
+ }
+
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ if (IsEnabled(_logger, DebugLevel))
+ {
+ Write(_logger, DebugLevel, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Info:
+ if (IsEnabled(_logger, InformationLevel))
+ {
+ Write(_logger, InformationLevel, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (IsEnabled(_logger, WarningLevel))
+ {
+ Write(_logger, WarningLevel, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (IsEnabled(_logger, ErrorLevel))
+ {
+ Write(_logger, ErrorLevel, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (IsEnabled(_logger, FatalLevel))
+ {
+ Write(_logger, FatalLevel, messageFunc());
+ return true;
+ }
+ break;
+ default:
+ if (IsEnabled(_logger, VerboseLevel))
+ {
+ Write(_logger, VerboseLevel, messageFunc());
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+
+ private bool LogException(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Debug:
+ if (IsEnabled(_logger, DebugLevel))
+ {
+ WriteException(_logger, DebugLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Info:
+ if (IsEnabled(_logger, InformationLevel))
+ {
+ WriteException(_logger, InformationLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Warn:
+ if (IsEnabled(_logger, WarningLevel))
+ {
+ WriteException(_logger, WarningLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Error:
+ if (IsEnabled(_logger, ErrorLevel))
+ {
+ WriteException(_logger, ErrorLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ case LogLevel.Fatal:
+ if (IsEnabled(_logger, FatalLevel))
+ {
+ WriteException(_logger, FatalLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ default:
+ if (IsEnabled(_logger, VerboseLevel))
+ {
+ WriteException(_logger, VerboseLevel, exception, messageFunc());
+ return true;
+ }
+ break;
+ }
+ return false;
+ }
+ }
+ }
+
+ public class LoupeLogProvider : ILogProvider
+ {
+ private static bool _providerIsAvailableOverride = true;
+ private readonly WriteDelegate _logWriteDelegate;
+
+ public LoupeLogProvider()
+ {
+ if (!IsLoggerAvailable())
+ {
+ throw new InvalidOperationException("Gibraltar.Agent.Log (Loupe) not found");
+ }
+
+ _logWriteDelegate = GetLogWriteDelegate();
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether [provider is available override]. Used in tests.
+ /// </summary>
+ /// <value>
+ /// <c>true</c> if [provider is available override]; otherwise, <c>false</c>.
+ /// </value>
+ public static bool ProviderIsAvailableOverride
+ {
+ get { return _providerIsAvailableOverride; }
+ set { _providerIsAvailableOverride = value; }
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new LoupeLogger(name, _logWriteDelegate);
+ }
+
+ public static bool IsLoggerAvailable()
+ {
+ return ProviderIsAvailableOverride && GetLogManagerType() != null;
+ }
+
+ private static Type GetLogManagerType()
+ {
+ return Type.GetType("Gibraltar.Agent.Log, Gibraltar.Agent");
+ }
+
+ private static WriteDelegate GetLogWriteDelegate()
+ {
+ Type logManagerType = GetLogManagerType();
+ Type logMessageSeverityType = Type.GetType("Gibraltar.Agent.LogMessageSeverity, Gibraltar.Agent");
+ Type logWriteModeType = Type.GetType("Gibraltar.Agent.LogWriteMode, Gibraltar.Agent");
+
+ MethodInfo method = logManagerType.GetMethod("Write", new[]
+ {
+ logMessageSeverityType, typeof(string), typeof(int), typeof(Exception), typeof(bool),
+ logWriteModeType, typeof(string), typeof(string), typeof(string), typeof(string), typeof(object[])
+ });
+
+ var callDelegate = (WriteDelegate)Delegate.CreateDelegate(typeof(WriteDelegate), method);
+ return callDelegate;
+ }
+
+ public class LoupeLogger : ILog
+ {
+ private const string LogSystem = "LibLog";
+
+ private readonly string _category;
+ private readonly WriteDelegate _logWriteDelegate;
+ private readonly int _skipLevel;
+
+ internal LoupeLogger(string category, WriteDelegate logWriteDelegate)
+ {
+ _category = category;
+ _logWriteDelegate = logWriteDelegate;
+ _skipLevel = 1;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ if (messageFunc == null)
+ {
+ //nothing to log..
+ return true;
+ }
+
+ _logWriteDelegate((int)ToLogMessageSeverity(logLevel), LogSystem, _skipLevel, exception, true, 0, null,
+ _category, null, messageFunc.Invoke());
+
+ return true;
+ }
+
+ public TraceEventType ToLogMessageSeverity(LogLevel logLevel)
+ {
+ switch (logLevel)
+ {
+ case LogLevel.Trace:
+ return TraceEventType.Verbose;
+ case LogLevel.Debug:
+ return TraceEventType.Verbose;
+ case LogLevel.Info:
+ return TraceEventType.Information;
+ case LogLevel.Warn:
+ return TraceEventType.Warning;
+ case LogLevel.Error:
+ return TraceEventType.Error;
+ case LogLevel.Fatal:
+ return TraceEventType.Critical;
+ default:
+ throw new ArgumentOutOfRangeException("logLevel");
+ }
+ }
+ }
+
+ /// <summary>
+ /// The form of the Loupe Log.Write method we're using
+ /// </summary>
+ internal delegate void WriteDelegate(
+ int severity,
+ string logSystem,
+ int skipFrames,
+ Exception exception,
+ bool attributeToException,
+ int writeMode,
+ string detailsXml,
+ string category,
+ string caption,
+ string description,
+ params object[] args
+ );
+ }
+
+ public class ColouredConsoleLogProvider : ILogProvider
+ {
+ static ColouredConsoleLogProvider()
+ {
+ MessageFormatter = DefaultMessageFormatter;
+ Colors = new Dictionary<LogLevel, ConsoleColor> {
+ { LogLevel.Fatal, ConsoleColor.Red },
+ { LogLevel.Error, ConsoleColor.Yellow },
+ { LogLevel.Warn, ConsoleColor.Magenta },
+ { LogLevel.Info, ConsoleColor.White },
+ { LogLevel.Debug, ConsoleColor.Gray },
+ { LogLevel.Trace, ConsoleColor.DarkGray },
+ };
+ }
+
+ public ILog GetLogger(string name)
+ {
+ return new ColouredConsoleLogger(name);
+ }
+
+ /// <summary>
+ /// A delegate returning a formatted log message
+ /// </summary>
+ /// <param name="loggerName">The name of the Logger</param>
+ /// <param name="level">The Log Level</param>
+ /// <param name="message">The Log Message</param>
+ /// <param name="e">The Exception, if there is one</param>
+ /// <returns>A formatted Log Message string.</returns>
+ public delegate string MessageFormatterDelegate(
+ string loggerName,
+ LogLevel level,
+ object message,
+ Exception e);
+
+ public static Dictionary<LogLevel, ConsoleColor> Colors { get; set; }
+
+ public static MessageFormatterDelegate MessageFormatter { get; set; }
+
+ protected static string DefaultMessageFormatter(string loggerName, LogLevel level, object message, Exception e)
+ {
+ var stringBuilder = new StringBuilder();
+
+ stringBuilder.Append(DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss", CultureInfo.InvariantCulture));
+
+ stringBuilder.Append(" ");
+
+ // Append a readable representation of the log level
+ stringBuilder.Append(("[" + level.ToString().ToUpper() + "]").PadRight(8));
+
+ stringBuilder.Append("(" + loggerName + ") ");
+
+ // Append the message
+ stringBuilder.Append(message);
+
+ // Append stack trace if there is an exception
+ if (e != null)
+ {
+ stringBuilder.Append(Environment.NewLine).Append(e.GetType());
+ stringBuilder.Append(Environment.NewLine).Append(e.Message);
+ stringBuilder.Append(Environment.NewLine).Append(e.StackTrace);
+ }
+
+ return stringBuilder.ToString();
+ }
+
+ public class ColouredConsoleLogger : ILog
+ {
+ private readonly string _name;
+
+ public ColouredConsoleLogger(string name)
+ {
+ _name = name;
+ }
+
+ public bool Log(LogLevel logLevel, Func<string> messageFunc, Exception exception)
+ {
+ if (messageFunc == null)
+ {
+ return true;
+ }
+
+ Write(logLevel, messageFunc(), exception);
+ return true;
+ }
+
+ protected void Write(LogLevel logLevel, string message, Exception e = null)
+ {
+ var formattedMessage = MessageFormatter(this._name, logLevel, message, e);
+ ConsoleColor color;
+
+ if (Colors.TryGetValue(logLevel, out color))
+ {
+ var originalColor = Console.ForegroundColor;
+ try
+ {
+ Console.ForegroundColor = color;
+ Console.Out.WriteLine(formattedMessage);
+ }
+ finally
+ {
+ Console.ForegroundColor = originalColor;
+ }
+ }
+ else
+ {
+ Console.Out.WriteLine(formattedMessage);
+ }
+ }
+ }
+ }
+}
diff --git a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
index 0781b76..77d767b 100644
--- a/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
+++ b/src/DotNetOpenAuth.Core/DotNetOpenAuth.Core.csproj
@@ -19,6 +19,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
</PropertyGroup>
<ItemGroup>
+ <Compile Include="App_Packages\LibLog.2.0\LibLog.cs" />
<Compile Include="Assumes.cs" />
<Compile Include="IHostFactories.cs" />
<Compile Include="IRequireHostFactories.cs" />
@@ -128,11 +129,6 @@
<Compile Include="Configuration\HostNameElement.cs" />
<Compile Include="IEmbeddedResourceRetrieval.cs" />
<Compile Include="Logger.cs" />
- <Compile Include="Loggers\ILog.cs" />
- <Compile Include="Loggers\Log4NetLogger.cs" />
- <Compile Include="Loggers\NLogLogger.cs" />
- <Compile Include="Loggers\NoOpLogger.cs" />
- <Compile Include="Loggers\TraceLogger.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Messaging\ReadOnlyDictionary.cs" />
<Compile Include="Reporting.cs" />
@@ -169,14 +165,7 @@
<EmbeddedResource Include="Messaging\MessagingStrings.sr.resx" />
</ItemGroup>
<ItemGroup>
- <Reference Include="log4net, Version=1.2.12.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.dll</HintPath>
- </Reference>
- <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\NLog.2.1.0\lib\net45\NLog.dll</HintPath>
- </Reference>
+ <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Net.Http.Extensions">
<HintPath>..\packages\Microsoft.Net.Http.2.2.15\lib\net45\System.Net.Http.Extensions.dll</HintPath>
diff --git a/src/DotNetOpenAuth.Core/Logger.cs b/src/DotNetOpenAuth.Core/Logger.cs
index a8b977e..f82b2e6 100644
--- a/src/DotNetOpenAuth.Core/Logger.cs
+++ b/src/DotNetOpenAuth.Core/Logger.cs
@@ -7,12 +7,12 @@
namespace DotNetOpenAuth {
using System;
using System.Globalization;
- using DotNetOpenAuth.Loggers;
+ using DotNetOpenAuth.Logging;
+ using DotNetOpenAuth.Logging.LogProviders;
using DotNetOpenAuth.Messaging;
- using log4net.Core;
using Validation;
- /// <summary>
+ /// <summary>
/// A general logger for the entire DotNetOpenAuth library.
/// </summary>
/// <remarks>
@@ -167,8 +167,7 @@ namespace DotNetOpenAuth {
/// <param name="name">The name of the log to initialize.</param>
/// <returns>The <see cref="ILog"/> instance of the logger to use.</returns>
private static ILog InitializeFacade(string name) {
- ILog result = Log4NetLogger.Initialize(name) ?? NLogLogger.Initialize(name) ?? TraceLogger.Initialize(name) ?? NoOpLogger.Initialize();
- return result;
+ return LogProvider.GetLogger(name);
}
}
}
diff --git a/src/DotNetOpenAuth.Core/Loggers/ILog.cs b/src/DotNetOpenAuth.Core/Loggers/ILog.cs
deleted file mode 100644
index e801b2a..0000000
--- a/src/DotNetOpenAuth.Core/Loggers/ILog.cs
+++ /dev/null
@@ -1,851 +0,0 @@
-// <auto-generated />
-
-#region Copyright & License
-//
-// Copyright 2001-2006 The Apache Software Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-#endregion
-
-// This interface is designed to look like log4net's ILog interface.
-// We have this as a facade in front of it to avoid crashing if the
-// hosting web site chooses not to deploy log4net.dll along with
-// DotNetOpenAuth.dll.
-
-namespace DotNetOpenAuth.Loggers
-{
- using System;
- using System.Reflection;
- using log4net;
- using log4net.Core;
-
- /// <summary>
- /// The ILog interface is use by application to log messages into
- /// the log4net framework.
- /// </summary>
- /// <remarks>
- /// <para>
- /// Use the <see cref="LogManager"/> to obtain logger instances
- /// that implement this interface. The <see cref="LogManager.GetLogger(Assembly,Type)"/>
- /// static method is used to get logger instances.
- /// </para>
- /// <para>
- /// This class contains methods for logging at different levels and also
- /// has properties for determining if those logging levels are
- /// enabled in the current configuration.
- /// </para>
- /// <para>
- /// This interface can be implemented in different ways. This documentation
- /// specifies reasonable behavior that a caller can expect from the actual
- /// implementation, however different implementations reserve the right to
- /// do things differently.
- /// </para>
- /// </remarks>
- /// <example>Simple example of logging messages
- /// <code lang="C#">
- /// ILog log = LogManager.GetLogger("application-log");
- ///
- /// log.Info("Application Start");
- /// log.Debug("This is a debug message");
- ///
- /// if (log.IsDebugEnabled)
- /// {
- /// log.Debug("This is another debug message");
- /// }
- /// </code>
- /// </example>
- /// <seealso cref="LogManager"/>
- /// <seealso cref="LogManager.GetLogger(Assembly, Type)"/>
- /// <author>Nicko Cadell</author>
- /// <author>Gert Driesen</author>
- interface ILog
- {
- /// <overloads>Log a message object with the <see cref="Level.Debug"/> level.</overloads>
- /// <summary>
- /// Log a message object with the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <remarks>
- /// <para>
- /// This method first checks if this logger is <c>DEBUG</c>
- /// enabled by comparing the level of this logger with the
- /// <see cref="Level.Debug"/> level. If this logger is
- /// <c>DEBUG</c> enabled, then it converts the message object
- /// (passed as parameter) to a string by invoking the appropriate
- /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
- /// proceeds to call all the registered appenders in this logger
- /// and also higher in the hierarchy depending on the value of
- /// the additivity flag.
- /// </para>
- /// <para><b>WARNING</b> Note that passing an <see cref="Exception"/>
- /// to this method will print the name of the <see cref="Exception"/>
- /// but no stack trace. To print a stack trace use the
- /// <see cref="Debug(object,Exception)"/> form instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object,Exception)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void Debug(object message);
-
- /// <summary>
- /// Log a message object with the <see cref="Level.Debug"/> level including
- /// the stack trace of the <see cref="Exception"/> passed
- /// as a parameter.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <param name="exception">The exception to log, including its stack trace.</param>
- /// <remarks>
- /// <para>
- /// See the <see cref="Debug(object)"/> form for more detailed information.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void Debug(object message, Exception exception);
-
- /// <overloads>Log a formatted string with the <see cref="Level.Debug"/> level.</overloads>
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="args">An Object array containing zero or more objects to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void DebugFormat(string format, params object[] args);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void DebugFormat(string format, object arg0);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void DebugFormat(string format, object arg0, object arg1);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <param name="arg2">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Debug(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- /// <seealso cref="IsDebugEnabled"/>
- void DebugFormat(string format, object arg0, object arg1, object arg2);
-
- /// <overloads>Log a message object with the <see cref="Level.Info"/> level.</overloads>
- /// <summary>
- /// Logs a message object with the <see cref="Level.Info"/> level.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This method first checks if this logger is <c>INFO</c>
- /// enabled by comparing the level of this logger with the
- /// <see cref="Level.Info"/> level. If this logger is
- /// <c>INFO</c> enabled, then it converts the message object
- /// (passed as parameter) to a string by invoking the appropriate
- /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
- /// proceeds to call all the registered appenders in this logger
- /// and also higher in the hierarchy depending on the value of the
- /// additivity flag.
- /// </para>
- /// <para><b>WARNING</b> Note that passing an <see cref="Exception"/>
- /// to this method will print the name of the <see cref="Exception"/>
- /// but no stack trace. To print a stack trace use the
- /// <see cref="Info(object,Exception)"/> form instead.
- /// </para>
- /// </remarks>
- /// <param name="message">The message object to log.</param>
- /// <seealso cref="Info(object,Exception)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void Info(object message);
-
- /// <summary>
- /// Logs a message object with the <c>INFO</c> level including
- /// the stack trace of the <see cref="Exception"/> passed
- /// as a parameter.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <param name="exception">The exception to log, including its stack trace.</param>
- /// <remarks>
- /// <para>
- /// See the <see cref="Info(object)"/> form for more detailed information.
- /// </para>
- /// </remarks>
- /// <seealso cref="Info(object)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void Info(object message, Exception exception);
-
- /// <overloads>Log a formatted message string with the <see cref="Level.Info"/> level.</overloads>
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Info"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="args">An Object array containing zero or more objects to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Info(object,Exception)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void InfoFormat(string format, params object[] args);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Info"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Info(object)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void InfoFormat(string format, object arg0);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Info"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Info(object)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void InfoFormat(string format, object arg0, object arg1);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Info"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <param name="arg2">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Info(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Info(object)"/>
- /// <seealso cref="IsInfoEnabled"/>
- void InfoFormat(string format, object arg0, object arg1, object arg2);
-
- /// <overloads>Log a message object with the <see cref="Level.Warn"/> level.</overloads>
- /// <summary>
- /// Log a message object with the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This method first checks if this logger is <c>WARN</c>
- /// enabled by comparing the level of this logger with the
- /// <see cref="Level.Warn"/> level. If this logger is
- /// <c>WARN</c> enabled, then it converts the message object
- /// (passed as parameter) to a string by invoking the appropriate
- /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
- /// proceeds to call all the registered appenders in this logger
- /// and also higher in the hierarchy depending on the value of the
- /// additivity flag.
- /// </para>
- /// <para><b>WARNING</b> Note that passing an <see cref="Exception"/>
- /// to this method will print the name of the <see cref="Exception"/>
- /// but no stack trace. To print a stack trace use the
- /// <see cref="Warn(object,Exception)"/> form instead.
- /// </para>
- /// </remarks>
- /// <param name="message">The message object to log.</param>
- /// <seealso cref="Warn(object,Exception)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void Warn(object message);
-
- /// <summary>
- /// Log a message object with the <see cref="Level.Warn"/> level including
- /// the stack trace of the <see cref="Exception"/> passed
- /// as a parameter.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <param name="exception">The exception to log, including its stack trace.</param>
- /// <remarks>
- /// <para>
- /// See the <see cref="Warn(object)"/> form for more detailed information.
- /// </para>
- /// </remarks>
- /// <seealso cref="Warn(object)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void Warn(object message, Exception exception);
-
- /// <overloads>Log a formatted message string with the <see cref="Level.Warn"/> level.</overloads>
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="args">An Object array containing zero or more objects to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Warn(object,Exception)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void WarnFormat(string format, params object[] args);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Warn(object)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void WarnFormat(string format, object arg0);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Warn(object)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void WarnFormat(string format, object arg0, object arg1);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <param name="arg2">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Warn(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Warn(object)"/>
- /// <seealso cref="IsWarnEnabled"/>
- void WarnFormat(string format, object arg0, object arg1, object arg2);
-
- /// <overloads>Log a message object with the <see cref="Level.Error"/> level.</overloads>
- /// <summary>
- /// Logs a message object with the <see cref="Level.Error"/> level.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <remarks>
- /// <para>
- /// This method first checks if this logger is <c>ERROR</c>
- /// enabled by comparing the level of this logger with the
- /// <see cref="Level.Error"/> level. If this logger is
- /// <c>ERROR</c> enabled, then it converts the message object
- /// (passed as parameter) to a string by invoking the appropriate
- /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
- /// proceeds to call all the registered appenders in this logger
- /// and also higher in the hierarchy depending on the value of the
- /// additivity flag.
- /// </para>
- /// <para><b>WARNING</b> Note that passing an <see cref="Exception"/>
- /// to this method will print the name of the <see cref="Exception"/>
- /// but no stack trace. To print a stack trace use the
- /// <see cref="Error(object,Exception)"/> form instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object,Exception)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void Error(object message);
-
- /// <summary>
- /// Log a message object with the <see cref="Level.Error"/> level including
- /// the stack trace of the <see cref="Exception"/> passed
- /// as a parameter.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <param name="exception">The exception to log, including its stack trace.</param>
- /// <remarks>
- /// <para>
- /// See the <see cref="Error(object)"/> form for more detailed information.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void Error(object message, Exception exception);
-
- /// <overloads>Log a formatted message string with the <see cref="Level.Error"/> level.</overloads>
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Error"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="args">An Object array containing zero or more objects to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object,Exception)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void ErrorFormat(string format, params object[] args);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Error"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void ErrorFormat(string format, object arg0);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Error"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void ErrorFormat(string format, object arg0, object arg1);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Error"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <param name="arg2">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Error(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Error(object)"/>
- /// <seealso cref="IsErrorEnabled"/>
- void ErrorFormat(string format, object arg0, object arg1, object arg2);
-
- /// <overloads>Log a message object with the <see cref="Level.Fatal"/> level.</overloads>
- /// <summary>
- /// Log a message object with the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <remarks>
- /// <para>
- /// This method first checks if this logger is <c>FATAL</c>
- /// enabled by comparing the level of this logger with the
- /// <see cref="Level.Fatal"/> level. If this logger is
- /// <c>FATAL</c> enabled, then it converts the message object
- /// (passed as parameter) to a string by invoking the appropriate
- /// <see cref="log4net.ObjectRenderer.IObjectRenderer"/>. It then
- /// proceeds to call all the registered appenders in this logger
- /// and also higher in the hierarchy depending on the value of the
- /// additivity flag.
- /// </para>
- /// <para><b>WARNING</b> Note that passing an <see cref="Exception"/>
- /// to this method will print the name of the <see cref="Exception"/>
- /// but no stack trace. To print a stack trace use the
- /// <see cref="Fatal(object,Exception)"/> form instead.
- /// </para>
- /// </remarks>
- /// <param name="message">The message object to log.</param>
- /// <seealso cref="Fatal(object,Exception)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void Fatal(object message);
-
- /// <summary>
- /// Log a message object with the <see cref="Level.Fatal"/> level including
- /// the stack trace of the <see cref="Exception"/> passed
- /// as a parameter.
- /// </summary>
- /// <param name="message">The message object to log.</param>
- /// <param name="exception">The exception to log, including its stack trace.</param>
- /// <remarks>
- /// <para>
- /// See the <see cref="Fatal(object)"/> form for more detailed information.
- /// </para>
- /// </remarks>
- /// <seealso cref="Fatal(object)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void Fatal(object message, Exception exception);
-
- /// <overloads>Log a formatted message string with the <see cref="Level.Fatal"/> level.</overloads>
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="args">An Object array containing zero or more objects to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Fatal(object,Exception)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void FatalFormat(string format, params object[] args);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Fatal(object)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void FatalFormat(string format, object arg0);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Fatal(object)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void FatalFormat(string format, object arg0, object arg1);
-
- /// <summary>
- /// Logs a formatted message string with the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <param name="format">A String containing zero or more format items</param>
- /// <param name="arg0">An Object to format</param>
- /// <param name="arg1">An Object to format</param>
- /// <param name="arg2">An Object to format</param>
- /// <remarks>
- /// <para>
- /// The message is formatted using the <c>string.Format</c> method. See
- /// <see cref="string.Format(string, object[])"/> for details of the syntax of the format string and the behavior
- /// of the formatting.
- /// </para>
- /// <para>
- /// This method does not take an <see cref="Exception"/> object to include in the
- /// log event. To pass an <see cref="Exception"/> use one of the <see cref="Fatal(object,Exception)"/>
- /// methods instead.
- /// </para>
- /// </remarks>
- /// <seealso cref="Fatal(object)"/>
- /// <seealso cref="IsFatalEnabled"/>
- void FatalFormat(string format, object arg0, object arg1, object arg2);
-
- /// <summary>
- /// Checks if this logger is enabled for the <see cref="Level.Debug"/> level.
- /// </summary>
- /// <value>
- /// <c>true</c> if this logger is enabled for <see cref="Level.Debug"/> events, <c>false</c> otherwise.
- /// </value>
- /// <remarks>
- /// <para>
- /// This function is intended to lessen the computational cost of
- /// disabled log debug statements.
- /// </para>
- /// <para> For some ILog interface <c>log</c>, when you write:</para>
- /// <code lang="C#">
- /// log.Debug("This is entry number: " + i );
- /// </code>
- /// <para>
- /// You incur the cost constructing the message, string construction and concatenation in
- /// this case, regardless of whether the message is logged or not.
- /// </para>
- /// <para>
- /// If you are worried about speed (who isn't), then you should write:
- /// </para>
- /// <code lang="C#">
- /// if (log.IsDebugEnabled)
- /// {
- /// log.Debug("This is entry number: " + i );
- /// }
- /// </code>
- /// <para>
- /// This way you will not incur the cost of parameter
- /// construction if debugging is disabled for <c>log</c>. On
- /// the other hand, if the <c>log</c> is debug enabled, you
- /// will incur the cost of evaluating whether the logger is debug
- /// enabled twice. Once in <see cref="IsDebugEnabled"/> and once in
- /// the <see cref="Debug(object)"/>. This is an insignificant overhead
- /// since evaluating a logger takes about 1% of the time it
- /// takes to actually log. This is the preferred style of logging.
- /// </para>
- /// <para>Alternatively if your logger is available statically then the is debug
- /// enabled state can be stored in a static variable like this:
- /// </para>
- /// <code lang="C#">
- /// private static readonly bool isDebugEnabled = log.IsDebugEnabled;
- /// </code>
- /// <para>
- /// Then when you come to log you can write:
- /// </para>
- /// <code lang="C#">
- /// if (isDebugEnabled)
- /// {
- /// log.Debug("This is entry number: " + i );
- /// }
- /// </code>
- /// <para>
- /// This way the debug enabled state is only queried once
- /// when the class is loaded. Using a <c>private static readonly</c>
- /// variable is the most efficient because it is a run time constant
- /// and can be heavily optimized by the JIT compiler.
- /// </para>
- /// <para>
- /// Of course if you use a static readonly variable to
- /// hold the enabled state of the logger then you cannot
- /// change the enabled state at runtime to vary the logging
- /// that is produced. You have to decide if you need absolute
- /// speed or runtime flexibility.
- /// </para>
- /// </remarks>
- /// <seealso cref="Debug(object)"/>
- bool IsDebugEnabled { get; }
-
- /// <summary>
- /// Checks if this logger is enabled for the <see cref="Level.Info"/> level.
- /// </summary>
- /// <value>
- /// <c>true</c> if this logger is enabled for <see cref="Level.Info"/> events, <c>false</c> otherwise.
- /// </value>
- /// <remarks>
- /// For more information see <see cref="ILog.IsDebugEnabled"/>.
- /// </remarks>
- /// <seealso cref="Info(object)"/>
- /// <seealso cref="ILog.IsDebugEnabled"/>
- bool IsInfoEnabled { get; }
-
- /// <summary>
- /// Checks if this logger is enabled for the <see cref="Level.Warn"/> level.
- /// </summary>
- /// <value>
- /// <c>true</c> if this logger is enabled for <see cref="Level.Warn"/> events, <c>false</c> otherwise.
- /// </value>
- /// <remarks>
- /// For more information see <see cref="ILog.IsDebugEnabled"/>.
- /// </remarks>
- /// <seealso cref="Warn(object)"/>
- /// <seealso cref="ILog.IsDebugEnabled"/>
- bool IsWarnEnabled { get; }
-
- /// <summary>
- /// Checks if this logger is enabled for the <see cref="Level.Error"/> level.
- /// </summary>
- /// <value>
- /// <c>true</c> if this logger is enabled for <see cref="Level.Error"/> events, <c>false</c> otherwise.
- /// </value>
- /// <remarks>
- /// For more information see <see cref="ILog.IsDebugEnabled"/>.
- /// </remarks>
- /// <seealso cref="Error(object)"/>
- /// <seealso cref="ILog.IsDebugEnabled"/>
- bool IsErrorEnabled { get; }
-
- /// <summary>
- /// Checks if this logger is enabled for the <see cref="Level.Fatal"/> level.
- /// </summary>
- /// <value>
- /// <c>true</c> if this logger is enabled for <see cref="Level.Fatal"/> events, <c>false</c> otherwise.
- /// </value>
- /// <remarks>
- /// For more information see <see cref="ILog.IsDebugEnabled"/>.
- /// </remarks>
- /// <seealso cref="Fatal(object)"/>
- /// <seealso cref="ILog.IsDebugEnabled"/>
- bool IsFatalEnabled { get; }
- }
-}
diff --git a/src/DotNetOpenAuth.Core/Loggers/Log4NetLogger.cs b/src/DotNetOpenAuth.Core/Loggers/Log4NetLogger.cs
deleted file mode 100644
index 01da034..0000000
--- a/src/DotNetOpenAuth.Core/Loggers/Log4NetLogger.cs
+++ /dev/null
@@ -1,219 +0,0 @@
-// <auto-generated />
-
-namespace DotNetOpenAuth.Loggers {
- using System;
- using System.Globalization;
- using System.IO;
- using System.Reflection;
-
- internal class Log4NetLogger : ILog {
- private log4net.ILog log4netLogger;
-
- private Log4NetLogger(log4net.ILog logger) {
- this.log4netLogger = logger;
- }
-
- #region ILog Members
-
- public bool IsDebugEnabled {
- get { return this.log4netLogger.IsDebugEnabled; }
- }
-
- public bool IsInfoEnabled {
- get { return this.log4netLogger.IsInfoEnabled; }
- }
-
- public bool IsWarnEnabled {
- get { return this.log4netLogger.IsWarnEnabled; }
- }
-
- public bool IsErrorEnabled {
- get { return this.log4netLogger.IsErrorEnabled; }
- }
-
- public bool IsFatalEnabled {
- get { return this.log4netLogger.IsFatalEnabled; }
- }
-
- #endregion
-
- private static bool IsLog4NetPresent {
- get {
- try {
- Assembly.Load("log4net");
- return true;
- } catch (FileNotFoundException) {
- return false;
- }
- }
- }
-
- #region ILog methods
-
- public void Debug(object message) {
- this.log4netLogger.Debug(message);
- }
-
- public void Debug(object message, Exception exception) {
- this.log4netLogger.Debug(message, exception);
- }
-
- public void DebugFormat(string format, params object[] args) {
- this.log4netLogger.DebugFormat(CultureInfo.InvariantCulture, format, args);
- }
-
- public void DebugFormat(string format, object arg0) {
- this.log4netLogger.DebugFormat(format, arg0);
- }
-
- public void DebugFormat(string format, object arg0, object arg1) {
- this.log4netLogger.DebugFormat(format, arg0, arg1);
- }
-
- public void DebugFormat(string format, object arg0, object arg1, object arg2) {
- this.log4netLogger.DebugFormat(format, arg0, arg1, arg2);
- }
-
- public void DebugFormat(IFormatProvider provider, string format, params object[] args) {
- this.log4netLogger.DebugFormat(provider, format, args);
- }
-
- public void Info(object message) {
- this.log4netLogger.Info(message);
- }
-
- public void Info(object message, Exception exception) {
- this.log4netLogger.Info(message, exception);
- }
-
- public void InfoFormat(string format, params object[] args) {
- this.log4netLogger.InfoFormat(CultureInfo.InvariantCulture, format, args);
- }
-
- public void InfoFormat(string format, object arg0) {
- this.log4netLogger.InfoFormat(format, arg0);
- }
-
- public void InfoFormat(string format, object arg0, object arg1) {
- this.log4netLogger.InfoFormat(format, arg0, arg1);
- }
-
- public void InfoFormat(string format, object arg0, object arg1, object arg2) {
- this.log4netLogger.InfoFormat(format, arg0, arg1, arg2);
- }
-
- public void InfoFormat(IFormatProvider provider, string format, params object[] args) {
- this.log4netLogger.InfoFormat(provider, format, args);
- }
-
- public void Warn(object message) {
- this.log4netLogger.Warn(message);
- }
-
- public void Warn(object message, Exception exception) {
- this.log4netLogger.Warn(message, exception);
- }
-
- public void WarnFormat(string format, params object[] args) {
- this.log4netLogger.WarnFormat(CultureInfo.InvariantCulture, format, args);
- }
-
- public void WarnFormat(string format, object arg0) {
- this.log4netLogger.WarnFormat(format, arg0);
- }
-
- public void WarnFormat(string format, object arg0, object arg1) {
- this.log4netLogger.WarnFormat(format, arg0, arg1);
- }
-
- public void WarnFormat(string format, object arg0, object arg1, object arg2) {
- this.log4netLogger.WarnFormat(format, arg0, arg1, arg2);
- }
-
- public void WarnFormat(IFormatProvider provider, string format, params object[] args) {
- this.log4netLogger.WarnFormat(provider, format, args);
- }
-
- public void Error(object message) {
- this.log4netLogger.Error(message);
- }
-
- public void Error(object message, Exception exception) {
- this.log4netLogger.Error(message, exception);
- }
-
- public void ErrorFormat(string format, params object[] args) {
- this.log4netLogger.ErrorFormat(CultureInfo.InvariantCulture, format, args);
- }
-
- public void ErrorFormat(string format, object arg0) {
- this.log4netLogger.ErrorFormat(format, arg0);
- }
-
- public void ErrorFormat(string format, object arg0, object arg1) {
- this.log4netLogger.ErrorFormat(format, arg0, arg1);
- }
-
- public void ErrorFormat(string format, object arg0, object arg1, object arg2) {
- this.log4netLogger.ErrorFormat(format, arg0, arg1, arg2);
- }
-
- public void ErrorFormat(IFormatProvider provider, string format, params object[] args) {
- this.log4netLogger.ErrorFormat(provider, format, args);
- }
-
- public void Fatal(object message) {
- this.log4netLogger.Fatal(message);
- }
-
- public void Fatal(object message, Exception exception) {
- this.log4netLogger.Fatal(message, exception);
- }
-
- public void FatalFormat(string format, params object[] args) {
- this.log4netLogger.FatalFormat(CultureInfo.InvariantCulture, format, args);
- }
-
- public void FatalFormat(string format, object arg0) {
- this.log4netLogger.FatalFormat(format, arg0);
- }
-
- public void FatalFormat(string format, object arg0, object arg1) {
- this.log4netLogger.FatalFormat(format, arg0, arg1);
- }
-
- public void FatalFormat(string format, object arg0, object arg1, object arg2) {
- this.log4netLogger.FatalFormat(format, arg0, arg1, arg2);
- }
-
- public void FatalFormat(IFormatProvider provider, string format, params object[] args) {
- this.log4netLogger.FatalFormat(provider, format, args);
- }
-
- #endregion
-
- /// <summary>
- /// Returns a new log4net logger if it exists, or returns null if the assembly cannot be found.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- internal static ILog Initialize(string name) {
- try {
- return IsLog4NetPresent ? CreateLogger(name) : null;
- } catch (FileLoadException) { // wrong log4net.dll version
- return null;
- } catch (TargetInvocationException) { // Thrown due to some security issues on .NET 4.5.
- return null;
- } catch (TypeLoadException) { // Thrown by mono (http://stackoverflow.com/questions/10805773/error-when-pushing-dotnetopenauth-to-staging-or-production-environment)
- return null;
- }
- }
-
- /// <summary>
- /// Creates the log4net.LogManager. Call ONLY after log4net.dll is known to be present.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- private static ILog CreateLogger(string name) {
- return new Log4NetLogger(log4net.LogManager.GetLogger(name));
- }
- }
-}
diff --git a/src/DotNetOpenAuth.Core/Loggers/NLogLogger.cs b/src/DotNetOpenAuth.Core/Loggers/NLogLogger.cs
deleted file mode 100644
index b5d883d..0000000
--- a/src/DotNetOpenAuth.Core/Loggers/NLogLogger.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-// <auto-generated />
-
-namespace DotNetOpenAuth.Loggers {
- using System;
- using System.Globalization;
- using System.IO;
- using System.Reflection;
-
- internal class NLogLogger : ILog {
- private NLog.Logger nLogLogger;
-
- private NLogLogger(NLog.Logger logger) {
- this.nLogLogger = logger;
- }
-
- #region ILog Members
-
- public bool IsDebugEnabled {
- get { return this.nLogLogger.IsDebugEnabled; }
- }
-
- public bool IsInfoEnabled {
- get { return this.nLogLogger.IsInfoEnabled; }
- }
-
- public bool IsWarnEnabled {
- get { return this.nLogLogger.IsWarnEnabled; }
- }
-
- public bool IsErrorEnabled {
- get { return this.nLogLogger.IsErrorEnabled; }
- }
-
- public bool IsFatalEnabled {
- get { return this.nLogLogger.IsFatalEnabled; }
- }
-
- #endregion
-
- private static bool IsNLogPresent {
- get {
- try {
- Assembly.Load("NLog");
- return true;
- } catch (FileNotFoundException) {
- return false;
- }
- }
- }
-
- #region ILog methods
-
- public void Debug(object message) {
- this.nLogLogger.Debug(message);
- }
-
- public void Debug(object message, Exception exception) {
- this.nLogLogger.DebugException(String.Format("{0}", message), exception);
- }
-
- public void DebugFormat(string format, params object[] args) {
- this.nLogLogger.Debug(CultureInfo.InvariantCulture, format, args);
- }
-
- public void DebugFormat(string format, object arg0) {
- this.nLogLogger.Debug(format, arg0);
- }
-
- public void DebugFormat(string format, object arg0, object arg1) {
- this.nLogLogger.Debug(format, arg0, arg1);
- }
-
- public void DebugFormat(string format, object arg0, object arg1, object arg2) {
- this.nLogLogger.Debug(format, arg0, arg1, arg2);
- }
-
- public void DebugFormat(IFormatProvider provider, string format, params object[] args) {
- this.nLogLogger.Debug(provider, format, args);
- }
-
- public void Info(object message) {
- this.nLogLogger.Info(message);
- }
-
- public void Info(object message, Exception exception) {
- this.nLogLogger.InfoException(String.Format("{0}", message), exception);
- }
-
- public void InfoFormat(string format, params object[] args) {
- this.nLogLogger.Info(CultureInfo.InvariantCulture, format, args);
- }
-
- public void InfoFormat(string format, object arg0) {
- this.nLogLogger.Info(format, arg0);
- }
-
- public void InfoFormat(string format, object arg0, object arg1) {
- this.nLogLogger.Info(format, arg0, arg1);
- }
-
- public void InfoFormat(string format, object arg0, object arg1, object arg2) {
- this.nLogLogger.Info(format, arg0, arg1, arg2);
- }
-
- public void InfoFormat(IFormatProvider provider, string format, params object[] args) {
- this.nLogLogger.Info(provider, format, args);
- }
-
- public void Warn(object message) {
- this.nLogLogger.Warn(message);
- }
-
- public void Warn(object message, Exception exception) {
- this.nLogLogger.Warn(String.Format("{0}", message), exception);
- }
-
- public void WarnFormat(string format, params object[] args) {
- this.nLogLogger.Warn(CultureInfo.InvariantCulture, format, args);
- }
-
- public void WarnFormat(string format, object arg0) {
- this.nLogLogger.Warn(format, arg0);
- }
-
- public void WarnFormat(string format, object arg0, object arg1) {
- this.nLogLogger.Warn(format, arg0, arg1);
- }
-
- public void WarnFormat(string format, object arg0, object arg1, object arg2) {
- this.nLogLogger.Warn(format, arg0, arg1, arg2);
- }
-
- public void WarnFormat(IFormatProvider provider, string format, params object[] args) {
- this.nLogLogger.Warn(provider, format, args);
- }
-
- public void Error(object message) {
- this.nLogLogger.Error(message);
- }
-
- public void Error(object message, Exception exception) {
- this.nLogLogger.Error(String.Format("{0}", message), exception);
- }
-
- public void ErrorFormat(string format, params object[] args) {
- this.nLogLogger.Error(CultureInfo.InvariantCulture, format, args);
- }
-
- public void ErrorFormat(string format, object arg0) {
- this.nLogLogger.Error(format, arg0);
- }
-
- public void ErrorFormat(string format, object arg0, object arg1) {
- this.nLogLogger.Error(format, arg0, arg1);
- }
-
- public void ErrorFormat(string format, object arg0, object arg1, object arg2) {
- this.nLogLogger.Error(format, arg0, arg1, arg2);
- }
-
- public void ErrorFormat(IFormatProvider provider, string format, params object[] args) {
- this.nLogLogger.Error(provider, format, args);
- }
-
- public void Fatal(object message) {
- this.nLogLogger.Fatal(message);
- }
-
- public void Fatal(object message, Exception exception) {
- this.nLogLogger.Fatal(String.Format("{0}", message), exception);
- }
-
- public void FatalFormat(string format, params object[] args) {
- this.nLogLogger.Fatal(CultureInfo.InvariantCulture, format, args);
- }
-
- public void FatalFormat(string format, object arg0) {
- this.nLogLogger.Fatal(format, arg0);
- }
-
- public void FatalFormat(string format, object arg0, object arg1) {
- this.nLogLogger.Fatal(format, arg0, arg1);
- }
-
- public void FatalFormat(string format, object arg0, object arg1, object arg2) {
- this.nLogLogger.Fatal(format, arg0, arg1, arg2);
- }
-
- public void FatalFormat(IFormatProvider provider, string format, params object[] args) {
- this.nLogLogger.Fatal(provider, format, args);
- }
-
- #endregion
-
- /// <summary>
- /// Returns a new NLog logger if it exists, or returns null if the assembly cannot be found.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- internal static ILog Initialize(string name) {
- try {
- return IsNLogPresent ? CreateLogger(name) : null;
- } catch (FileLoadException) {
- // wrong NLog.dll version
- return null;
- } catch (TargetInvocationException) {
- // Thrown due to some security issues on .NET 4.5.
- return null;
- } catch (TypeLoadException) {
- // Thrown by mono (http://stackoverflow.com/questions/10805773/error-when-pushing-dotnetopenauth-to-staging-or-production-environment)
- return null;
- }
- }
-
- /// <summary>
- /// Creates the NLogLogger. Call ONLY after NLog.dll is known to be present.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- private static ILog CreateLogger(string name) {
- return new NLogLogger(NLog.LogManager.GetLogger(name));
- }
- }
-}
diff --git a/src/DotNetOpenAuth.Core/Loggers/NoOpLogger.cs b/src/DotNetOpenAuth.Core/Loggers/NoOpLogger.cs
deleted file mode 100644
index 7d1b37f..0000000
--- a/src/DotNetOpenAuth.Core/Loggers/NoOpLogger.cs
+++ /dev/null
@@ -1,159 +0,0 @@
-// <auto-generated />
-
-namespace DotNetOpenAuth.Loggers {
- using System;
-
- internal class NoOpLogger : ILog {
- #region ILog Members
-
- public bool IsDebugEnabled {
- get { return false; }
- }
-
- public bool IsInfoEnabled {
- get { return false; }
- }
-
- public bool IsWarnEnabled {
- get { return false; }
- }
-
- public bool IsErrorEnabled {
- get { return false; }
- }
-
- public bool IsFatalEnabled {
- get { return false; }
- }
-
- public void Debug(object message) {
- return;
- }
-
- public void Debug(object message, Exception exception) {
- return;
- }
-
- public void DebugFormat(string format, params object[] args) {
- return;
- }
-
- public void DebugFormat(string format, object arg0) {
- return;
- }
-
- public void DebugFormat(string format, object arg0, object arg1) {
- return;
- }
-
- public void DebugFormat(string format, object arg0, object arg1, object arg2) {
- return;
- }
-
- public void Info(object message) {
- return;
- }
-
- public void Info(object message, Exception exception) {
- return;
- }
-
- public void InfoFormat(string format, params object[] args) {
- return;
- }
-
- public void InfoFormat(string format, object arg0) {
- return;
- }
-
- public void InfoFormat(string format, object arg0, object arg1) {
- return;
- }
-
- public void InfoFormat(string format, object arg0, object arg1, object arg2) {
- return;
- }
-
- public void Warn(object message) {
- return;
- }
-
- public void Warn(object message, Exception exception) {
- return;
- }
-
- public void WarnFormat(string format, params object[] args) {
- return;
- }
-
- public void WarnFormat(string format, object arg0) {
- return;
- }
-
- public void WarnFormat(string format, object arg0, object arg1) {
- return;
- }
-
- public void WarnFormat(string format, object arg0, object arg1, object arg2) {
- return;
- }
-
- public void Error(object message) {
- return;
- }
-
- public void Error(object message, Exception exception) {
- return;
- }
-
- public void ErrorFormat(string format, params object[] args) {
- return;
- }
-
- public void ErrorFormat(string format, object arg0) {
- return;
- }
-
- public void ErrorFormat(string format, object arg0, object arg1) {
- return;
- }
-
- public void ErrorFormat(string format, object arg0, object arg1, object arg2) {
- return;
- }
-
- public void Fatal(object message) {
- return;
- }
-
- public void Fatal(object message, Exception exception) {
- return;
- }
-
- public void FatalFormat(string format, params object[] args) {
- return;
- }
-
- public void FatalFormat(string format, object arg0) {
- return;
- }
-
- public void FatalFormat(string format, object arg0, object arg1) {
- return;
- }
-
- public void FatalFormat(string format, object arg0, object arg1, object arg2) {
- return;
- }
-
- #endregion
-
- /// <summary>
- /// Returns a new logger that does nothing when invoked.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- internal static ILog Initialize() {
- return new NoOpLogger();
- }
- }
-}
diff --git a/src/DotNetOpenAuth.Core/Loggers/TraceLogger.cs b/src/DotNetOpenAuth.Core/Loggers/TraceLogger.cs
deleted file mode 100644
index 1b80c7d..0000000
--- a/src/DotNetOpenAuth.Core/Loggers/TraceLogger.cs
+++ /dev/null
@@ -1,357 +0,0 @@
-// <auto-generated />
-
-namespace DotNetOpenAuth.Loggers {
- using System;
- using System.Diagnostics;
- using System.Security;
- using System.Security.Permissions;
-
- internal class TraceLogger : ILog {
- private TraceSwitch traceSwitch;
-
- internal TraceLogger(string name) {
- traceSwitch = new TraceSwitch(name, name + " Trace Switch");
- }
-
- #region ILog Properties
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public bool IsDebugEnabled {
- get { return this.traceSwitch.TraceVerbose; }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public bool IsInfoEnabled {
- get { return this.traceSwitch.TraceInfo; }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public bool IsWarnEnabled {
- get { return this.traceSwitch.TraceWarning; }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public bool IsErrorEnabled {
- get { return this.traceSwitch.TraceError; }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public bool IsFatalEnabled {
- get { return this.traceSwitch.TraceError; }
- }
-
- #endregion
-
- private static bool IsSufficientPermissionGranted {
- get {
- PermissionSet permissions = new PermissionSet(PermissionState.None);
- permissions.AddPermission(new KeyContainerPermission(PermissionState.Unrestricted));
- permissions.AddPermission(new ReflectionPermission(ReflectionPermissionFlag.MemberAccess));
- permissions.AddPermission(new RegistryPermission(PermissionState.Unrestricted));
- permissions.AddPermission(new SecurityPermission(SecurityPermissionFlag.ControlEvidence | SecurityPermissionFlag.UnmanagedCode | SecurityPermissionFlag.ControlThread));
- var file = new FileIOPermission(PermissionState.None);
- file.AllFiles = FileIOPermissionAccess.PathDiscovery | FileIOPermissionAccess.Read;
- permissions.AddPermission(file);
- try {
- permissions.Demand();
- return true;
- } catch (SecurityException) {
- return false;
- }
- }
- }
-
- #region ILog Methods
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Debug(object message) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(message.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Debug(object message, Exception exception) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(message + ": " + exception.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void DebugFormat(string format, params object[] args) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(format, args);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void DebugFormat(string format, object arg0) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(format, arg0);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void DebugFormat(string format, object arg0, object arg1) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(format, arg0, arg1);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void DebugFormat(string format, object arg0, object arg1, object arg2) {
- if (this.IsDebugEnabled) {
- Trace.TraceInformation(format, arg0, arg1, arg2);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Info(object message) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(message.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Info(object message, Exception exception) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(message + ": " + exception.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void InfoFormat(string format, params object[] args) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(format, args);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void InfoFormat(string format, object arg0) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(format, arg0);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void InfoFormat(string format, object arg0, object arg1) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(format, arg0, arg1);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void InfoFormat(string format, object arg0, object arg1, object arg2) {
- if (this.IsInfoEnabled) {
- Trace.TraceInformation(format, arg0, arg1, arg2);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Warn(object message) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(message.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Warn(object message, Exception exception) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(message + ": " + exception.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void WarnFormat(string format, params object[] args) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(format, args);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void WarnFormat(string format, object arg0) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(format, arg0);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void WarnFormat(string format, object arg0, object arg1) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(format, arg0, arg1);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void WarnFormat(string format, object arg0, object arg1, object arg2) {
- if (this.IsWarnEnabled) {
- Trace.TraceWarning(format, arg0, arg1, arg2);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Error(object message) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(message.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Error(object message, Exception exception) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(message + ": " + exception.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void ErrorFormat(string format, params object[] args) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(format, args);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void ErrorFormat(string format, object arg0) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(format, arg0);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void ErrorFormat(string format, object arg0, object arg1) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(format, arg0, arg1);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void ErrorFormat(string format, object arg0, object arg1, object arg2) {
- if (this.IsErrorEnabled) {
- Trace.TraceError(format, arg0, arg1, arg2);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Fatal(object message) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(message.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void Fatal(object message, Exception exception) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(message + ": " + exception.ToString());
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void FatalFormat(string format, params object[] args) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(format, args);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void FatalFormat(string format, object arg0) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(format, arg0);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void FatalFormat(string format, object arg0, object arg1) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(format, arg0, arg1);
- }
- }
-
- /// <summary>
- /// See <see cref="ILog"/>.
- /// </summary>
- public void FatalFormat(string format, object arg0, object arg1, object arg2) {
- if (this.IsFatalEnabled) {
- Trace.TraceError(format, arg0, arg1, arg2);
- }
- }
-
- #endregion
-
- /// <summary>
- /// Returns a new logger that uses the <see cref="System.Diagnostics.Trace"/> class
- /// if sufficient CAS permissions are granted to use it, otherwise returns false.
- /// </summary>
- /// <returns>The created <see cref="ILog"/> instance.</returns>
- internal static ILog Initialize(string name) {
- return IsSufficientPermissionGranted ? new TraceLogger(name) : null;
- }
- }
-}
diff --git a/src/DotNetOpenAuth.Core/Messaging/Bindings/StandardReplayProtectionBindingElement.cs b/src/DotNetOpenAuth.Core/Messaging/Bindings/StandardReplayProtectionBindingElement.cs
index 65c7882..6044d0a 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Bindings/StandardReplayProtectionBindingElement.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Bindings/StandardReplayProtectionBindingElement.cs
@@ -9,6 +9,9 @@ namespace DotNetOpenAuth.Messaging.Bindings {
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
+
using Validation;
/// <summary>
diff --git a/src/DotNetOpenAuth.Core/Messaging/Channel.cs b/src/DotNetOpenAuth.Core/Messaging/Channel.cs
index cc61b25..b754035 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Channel.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Channel.cs
@@ -27,6 +27,8 @@ namespace DotNetOpenAuth.Messaging {
using System.Threading.Tasks;
using System.Web;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging.Reflection;
using Validation;
@@ -395,7 +397,7 @@ namespace DotNetOpenAuth.Messaging {
public async Task<IDirectedProtocolMessage> ReadFromRequestAsync(HttpRequestMessage httpRequest, CancellationToken cancellationToken) {
Requires.NotNull(httpRequest, "httpRequest");
- if (Logger.Channel.IsInfoEnabled && httpRequest.RequestUri != null) {
+ if (Logger.Channel.IsInfoEnabled() && httpRequest.RequestUri != null) {
Logger.Channel.InfoFormat("Scanning incoming request for messages: {0}", httpRequest.RequestUri.AbsoluteUri);
}
IDirectedProtocolMessage requestMessage = await this.ReadFromRequestCoreAsync(httpRequest, cancellationToken);
@@ -1034,7 +1036,7 @@ namespace DotNetOpenAuth.Messaging {
this.OutgoingMessageFilter(message);
}
- if (Logger.Channel.IsInfoEnabled) {
+ if (Logger.Channel.IsInfoEnabled()) {
var directedMessage = message as IDirectedProtocolMessage;
string recipient = (directedMessage != null && directedMessage.Recipient != null) ? directedMessage.Recipient.AbsoluteUri : "<response>";
var messageAccessor = this.MessageDescriptions.GetAccessor(message);
@@ -1173,7 +1175,7 @@ namespace DotNetOpenAuth.Messaging {
protected virtual async Task ProcessIncomingMessageAsync(IProtocolMessage message, CancellationToken cancellationToken) {
Requires.NotNull(message, "message");
- if (Logger.Channel.IsInfoEnabled) {
+ if (Logger.Channel.IsInfoEnabled()) {
var messageAccessor = this.MessageDescriptions.GetAccessor(message, true);
Logger.Channel.InfoFormat(
"Processing incoming {0} ({1}) message:{2}{3}",
@@ -1223,7 +1225,7 @@ namespace DotNetOpenAuth.Messaging {
eventedMessage.OnReceiving();
}
- if (Logger.Channel.IsDebugEnabled) {
+ if (Logger.Channel.IsDebugEnabled()) {
var messageAccessor = this.MessageDescriptions.GetAccessor(message);
Logger.Channel.DebugFormat(
"After binding element processing, the received {0} ({1}) message is: {2}{3}",
diff --git a/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs b/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
index 210a95e..e78c8b1 100644
--- a/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/DataBagFormatterBase.cs
@@ -13,6 +13,8 @@ namespace DotNetOpenAuth.Messaging {
using System.Security.Cryptography;
using System.Text;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
diff --git a/src/DotNetOpenAuth.Core/Messaging/ErrorUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/ErrorUtilities.cs
index 71c904b..abda04f 100644
--- a/src/DotNetOpenAuth.Core/Messaging/ErrorUtilities.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/ErrorUtilities.cs
@@ -11,6 +11,9 @@ namespace DotNetOpenAuth.Messaging {
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
+
using Validation;
/// <summary>
@@ -186,7 +189,7 @@ namespace DotNetOpenAuth.Messaging {
Assumes.True(unformattedMessage != null);
if (!condition) {
var exception = new ProtocolException(string.Format(CultureInfo.CurrentCulture, unformattedMessage, args));
- if (Logger.Messaging.IsErrorEnabled) {
+ if (Logger.Messaging.IsErrorEnabled()) {
Logger.Messaging.Error(
string.Format(
CultureInfo.CurrentCulture,
diff --git a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
index 7be618c..c14e15b 100644
--- a/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/MessagingUtilities.cs
@@ -25,6 +25,8 @@ namespace DotNetOpenAuth.Messaging {
using System.Threading.Tasks;
using System.Web;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
using Validation;
diff --git a/src/DotNetOpenAuth.Core/Messaging/Reflection/MessageDescription.cs b/src/DotNetOpenAuth.Core/Messaging/Reflection/MessageDescription.cs
index cd04e1d..d6e5add 100644
--- a/src/DotNetOpenAuth.Core/Messaging/Reflection/MessageDescription.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/Reflection/MessageDescription.cs
@@ -12,6 +12,9 @@ namespace DotNetOpenAuth.Messaging.Reflection {
using System.Globalization;
using System.Linq;
using System.Reflection;
+
+ using DotNetOpenAuth.Logging;
+
using Validation;
/// <summary>
diff --git a/src/DotNetOpenAuth.Core/Messaging/StandardMessageFactory.cs b/src/DotNetOpenAuth.Core/Messaging/StandardMessageFactory.cs
index fd35e5f..006c798 100644
--- a/src/DotNetOpenAuth.Core/Messaging/StandardMessageFactory.cs
+++ b/src/DotNetOpenAuth.Core/Messaging/StandardMessageFactory.cs
@@ -10,6 +10,8 @@ namespace DotNetOpenAuth.Messaging {
using System.Linq;
using System.Reflection;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging.Reflection;
using Validation;
@@ -149,7 +151,7 @@ namespace DotNetOpenAuth.Messaging {
.CacheGeneratedResults();
var match = matches.FirstOrDefault();
if (match != null) {
- if (Logger.Messaging.IsWarnEnabled && matches.Count() > 1) {
+ if (Logger.Messaging.IsWarnEnabled() && matches.Count() > 1) {
Logger.Messaging.WarnFormat(
"Multiple message types seemed to fit the incoming data: {0}",
matches.ToStringDeferred());
@@ -186,7 +188,7 @@ namespace DotNetOpenAuth.Messaging {
select message).CacheGeneratedResults();
var match = matches.FirstOrDefault();
if (match != null) {
- if (Logger.Messaging.IsWarnEnabled && matches.Count() > 1) {
+ if (Logger.Messaging.IsWarnEnabled() && matches.Count() > 1) {
Logger.Messaging.WarnFormat(
"Multiple message types seemed to fit the incoming data: {0}",
matches.ToStringDeferred());
diff --git a/src/DotNetOpenAuth.Core/Reporting.cs b/src/DotNetOpenAuth.Core/Reporting.cs
index 432a833..4d21c38 100644
--- a/src/DotNetOpenAuth.Core/Reporting.cs
+++ b/src/DotNetOpenAuth.Core/Reporting.cs
@@ -23,6 +23,7 @@ namespace DotNetOpenAuth {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using Validation;
@@ -361,7 +362,7 @@ namespace DotNetOpenAuth {
// This is supposed to be as low-risk as possible, so if it fails, just disable reporting
// and avoid rethrowing.
broken = true;
- Logger.Library.Error("Error while trying to initialize reporting.", e);
+ Logger.Library.ErrorException("Error while trying to initialize reporting.", e);
}
}
}
@@ -474,9 +475,9 @@ namespace DotNetOpenAuth {
return true;
} catch (ProtocolException ex) {
- Logger.Library.Error("Unable to submit statistical report due to an HTTP error.", ex);
+ Logger.Library.ErrorException("Unable to submit statistical report due to an HTTP error.", ex);
} catch (FileNotFoundException ex) {
- Logger.Library.Error("Unable to submit statistical report because the report file is missing.", ex);
+ Logger.Library.ErrorException("Unable to submit statistical report because the report file is missing.", ex);
}
return false;
diff --git a/src/DotNetOpenAuth.Core/packages.config b/src/DotNetOpenAuth.Core/packages.config
index 0364828..b1c7f74 100644
--- a/src/DotNetOpenAuth.Core/packages.config
+++ b/src/DotNetOpenAuth.Core/packages.config
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="log4net" version="2.0.2" targetFramework="net45" />
+ <package id="LibLog" version="2.0.1" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.Bcl" version="1.1.3" targetFramework="net45" />
<package id="Microsoft.Bcl.Build" version="1.0.10" targetFramework="net45" />
<package id="Microsoft.Net.Http" version="2.2.15" targetFramework="net45" />
- <package id="NLog" version="2.1.0" targetFramework="net45" />
<package id="Validation" version="2.0.2.13022" targetFramework="net45" />
</packages> \ No newline at end of file
diff --git a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs
index 38a1f56..884ebbb 100644
--- a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs
+++ b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/OAuthServiceProviderMessageFactory.cs
@@ -7,6 +7,8 @@
namespace DotNetOpenAuth.OAuth.ChannelElements {
using System;
using System.Collections.Generic;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/RsaSha1ServiceProviderSigningBindingElement.cs b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/RsaSha1ServiceProviderSigningBindingElement.cs
index fd0d3ad..f8be01d 100644
--- a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/RsaSha1ServiceProviderSigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/RsaSha1ServiceProviderSigningBindingElement.cs
@@ -10,6 +10,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/TokenHandlingBindingElement.cs b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/TokenHandlingBindingElement.cs
index 5875650..091f7c4 100644
--- a/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/TokenHandlingBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth.ServiceProvider/OAuth/ChannelElements/TokenHandlingBindingElement.cs
@@ -13,6 +13,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
index d606ff0..9da9965 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthChannel.cs
@@ -20,6 +20,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
index 29ef8d5..3fbbd51 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/OAuthHttpMethodBindingElement.cs
@@ -11,6 +11,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
/// <summary>
@@ -49,7 +51,7 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
oauthMessage.HttpMethod = MessagingUtilities.GetHttpVerb(transmissionMethod);
return MessageProtectionTasks.None;
} catch (ArgumentException ex) {
- Logger.OAuth.Error("Unrecognized HttpDeliveryMethods value.", ex);
+ Logger.OAuth.ErrorException("Unrecognized HttpDeliveryMethods value.", ex);
return MessageProtectionTasks.Null;
}
} else {
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/PlaintextSigningBindingElement.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/PlaintextSigningBindingElement.cs
index 98bb69e..e4734ca 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/PlaintextSigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/PlaintextSigningBindingElement.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
diff --git a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
index 357ca45..e92dfca 100644
--- a/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
+++ b/src/DotNetOpenAuth.OAuth/OAuth/ChannelElements/SigningBindingElementBase.cs
@@ -15,6 +15,8 @@ namespace DotNetOpenAuth.OAuth.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
index ba542a4..2549287 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/AuthorizationServer.cs
@@ -16,6 +16,7 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.ChannelElements;
using DotNetOpenAuth.OAuth2.Messages;
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs
index 823baaf..03e54de 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/MessageValidationBindingElement.cs
@@ -12,6 +12,8 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.OAuth2.Messages;
using Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs
index 848b10e..70c09a1 100644
--- a/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs
+++ b/src/DotNetOpenAuth.OAuth2.AuthorizationServer/OAuth2/ChannelElements/OAuth2AuthorizationServerChannel.cs
@@ -14,6 +14,8 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.AuthServer.Messages;
using DotNetOpenAuth.OAuth2.Messages;
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
index 9a560c2..9852958 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ChannelElements/OAuth2ClientChannel.cs
@@ -14,6 +14,8 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Threading.Tasks;
using System.Web;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.Messages;
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
index e05dfce..c22f928 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/ClientBase.cs
@@ -16,6 +16,8 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.ChannelElements;
using DotNetOpenAuth.OAuth2.Messages;
diff --git a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs
index 4225d86..9824e14 100644
--- a/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs
+++ b/src/DotNetOpenAuth.OAuth2.Client/OAuth2/WebServerClient.cs
@@ -18,6 +18,7 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Web;
using System.Web.Security;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth2.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
index 6e8f216..95c283a 100644
--- a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
+++ b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ChannelElements/OAuth2ResourceServerChannel.cs
@@ -16,6 +16,8 @@ namespace DotNetOpenAuth.OAuth2.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
using DotNetOpenAuth.OAuth2.Messages;
diff --git a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
index bd7e335..8af3cbf 100644
--- a/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
+++ b/src/DotNetOpenAuth.OAuth2.ResourceServer/OAuth2/ResourceServer.cs
@@ -20,6 +20,8 @@ namespace DotNetOpenAuth.OAuth2 {
using System.Threading.Tasks;
using System.Web;
using ChannelElements;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.OAuth.ChannelElements;
using Messages;
using Messaging;
diff --git a/src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs b/src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs
index a450262..bdee0d1 100644
--- a/src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider.UI/OpenId/Provider/ProviderEndpoint.cs
@@ -16,6 +16,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
using System.Web.UI;
using System.Web.UI.WebControls;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/ChannelElements/ProviderSigningBindingElement.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/ChannelElements/ProviderSigningBindingElement.cs
index b0f5dd8..561776c 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/ChannelElements/ProviderSigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/ChannelElements/ProviderSigningBindingElement.cs
@@ -12,6 +12,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Messages/AssociateRequestProviderTools.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Messages/AssociateRequestProviderTools.cs
index a03c93f..8978905 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Messages/AssociateRequestProviderTools.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Messages/AssociateRequestProviderTools.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.OpenId.Messages {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Provider;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/GsaIcamProfile.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/GsaIcamProfile.cs
index 0aa4642..6ae216c 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/GsaIcamProfile.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/GsaIcamProfile.cs
@@ -11,6 +11,7 @@ namespace DotNetOpenAuth.OpenId.Provider.Behaviors {
using System.Threading;
using System.Threading.Tasks;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Behaviors;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/PpidGeneration.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/PpidGeneration.cs
index 5acd4c9..1c94e78 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/PpidGeneration.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/Behaviors/PpidGeneration.cs
@@ -10,6 +10,8 @@ namespace DotNetOpenAuth.OpenId.Provider.Behaviors {
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Behaviors;
using DotNetOpenAuth.OpenId.Extensions.ProviderAuthenticationPolicy;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs
index abadee8..6582232 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/HostProcessedRequest.cs
@@ -13,6 +13,8 @@ namespace DotNetOpenAuth.OpenId.Provider {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs
index 6ffd10b..d66ec41 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/OpenIdProvider.cs
@@ -17,6 +17,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.ChannelElements;
@@ -458,7 +459,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
Requires.NotNull(ex, "ex");
Requires.NotNull(request, "request");
- Logger.OpenId.Error("An exception was generated while processing an incoming OpenID request.", ex);
+ Logger.OpenId.ErrorException("An exception was generated while processing an incoming OpenID request.", ex);
IErrorMessage errorMessage;
// We must create the appropriate error message type (direct vs. indirect)
diff --git a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/ProviderAssociationHandleEncoder.cs b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/ProviderAssociationHandleEncoder.cs
index 5d88f5a..df68110 100644
--- a/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/ProviderAssociationHandleEncoder.cs
+++ b/src/DotNetOpenAuth.OpenId.Provider/OpenId/Provider/ProviderAssociationHandleEncoder.cs
@@ -8,6 +8,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
using System;
using System.Threading;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using Validation;
@@ -72,7 +73,7 @@ namespace DotNetOpenAuth.OpenId.Provider {
try {
formatter.Deserialize(bag, handle, containingMessage, Protocol.Default.openid.assoc_handle);
} catch (ProtocolException ex) {
- Logger.OpenId.Error("Rejecting an association because deserialization of the encoded handle failed.", ex);
+ Logger.OpenId.ErrorException("Rejecting an association because deserialization of the encoded handle failed.", ex);
return null;
}
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
index 4c988a8..d875537 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdAjaxTextBox.cs
@@ -26,6 +26,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Threading.Tasks;
using System.Web.UI;
using System.Web.UI.HtmlControls;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs
index f880ff7..ecf3d5e 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs
@@ -21,6 +21,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Web.Script.Serialization;
using System.Web.UI;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.Extensions;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
index e7a9238..ce35d7f 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty.UI/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
@@ -25,6 +25,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Web.UI;
using DotNetOpenAuth.ComponentModel;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.Extensions;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
index 625a7e4..b9eefc5 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/RelyingPartySigningBindingElement.cs
@@ -11,6 +11,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
index a919560..32b86af 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/ChannelElements/ReturnToNonceBindingElement.cs
@@ -11,6 +11,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
index 80a1665..3e9887d 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/HostMetaDiscoveryService.cs
@@ -27,6 +27,7 @@ namespace DotNetOpenAuth.OpenId {
using System.Xml;
using System.Xml.XPath;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Xrds;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/Messages/AssociateRequestRelyingParty.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/Messages/AssociateRequestRelyingParty.cs
index 3555dfb..6a8d245 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/Messages/AssociateRequestRelyingParty.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/Messages/AssociateRequestRelyingParty.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.OpenId.Messages {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.OpenId.RelyingParty;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
index 86f178b..de3eb55 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AssociationManager.cs
@@ -13,6 +13,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.ChannelElements;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
index 826401c..fcdc465 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/AuthenticationRequest.cs
@@ -16,6 +16,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.ChannelElements;
using DotNetOpenAuth.OpenId.Messages;
@@ -338,7 +339,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
}
- if (Logger.OpenId.IsWarnEnabled && returnToUrl.Query != null) {
+ if (Logger.OpenId.IsWarnEnabled() && returnToUrl.Query != null) {
NameValueCollection returnToArgs = HttpUtility.ParseQueryString(returnToUrl.Query);
foreach (string key in returnToArgs) {
if (OpenIdRelyingParty.IsOpenIdSupportingParameter(key)) {
@@ -519,12 +520,12 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
if (anyFilteredOut) {
Logger.Yadis.DebugFormat("Some endpoints were filtered out. Total endpoints remaining: {0}", filteredEndpoints.Count);
}
- if (Logger.Yadis.IsDebugEnabled) {
+ if (Logger.Yadis.IsDebugEnabled()) {
if (MessagingUtilities.AreEquivalent(endpoints, endpointList)) {
Logger.Yadis.Debug("Filtering and sorting of endpoints did not affect the list.");
} else {
Logger.Yadis.Debug("After filtering and sorting service endpoints, this is the new prioritized list:");
- Logger.Yadis.Debug(Util.ToStringDeferred(filteredEndpoints, true));
+ Logger.Yadis.Debug(Util.ToStringDeferred(filteredEndpoints, true).ToString());
}
}
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Behaviors/GsaIcamProfile.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Behaviors/GsaIcamProfile.cs
index 8deed09..62382cd 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Behaviors/GsaIcamProfile.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Behaviors/GsaIcamProfile.cs
@@ -9,6 +9,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty.Behaviors {
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Behaviors;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/ExtensionsInteropHelper.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/ExtensionsInteropHelper.cs
index fde1462..0e08c75 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/ExtensionsInteropHelper.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/Extensions/ExtensionsInteropHelper.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty.Extensions {
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Extensions;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
index 3a811db..5a481dc 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/OpenIdRelyingParty.cs
@@ -22,6 +22,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.ChannelElements;
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAnonymousResponse.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAnonymousResponse.cs
index 6ec7d04..1b65772 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAnonymousResponse.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAnonymousResponse.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Collections.Generic;
using System.Linq;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
@@ -41,7 +43,7 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
}
// Derived types of this are responsible to log an appropriate message for themselves.
- if (Logger.OpenId.IsInfoEnabled && this.GetType() == typeof(PositiveAnonymousResponse)) {
+ if (Logger.OpenId.IsInfoEnabled() && this.GetType() == typeof(PositiveAnonymousResponse)) {
Logger.OpenId.Info("Received anonymous (identity-less) positive assertion.");
}
diff --git a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs
index 89162ab..4850c02 100644
--- a/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs
+++ b/src/DotNetOpenAuth.OpenId.RelyingParty/OpenId/RelyingParty/PositiveAuthenticationResponse.cs
@@ -11,6 +11,8 @@ namespace DotNetOpenAuth.OpenId.RelyingParty {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId.UI/XrdsPublisher.cs b/src/DotNetOpenAuth.OpenId.UI/XrdsPublisher.cs
index 640bee7..723db01 100644
--- a/src/DotNetOpenAuth.OpenId.UI/XrdsPublisher.cs
+++ b/src/DotNetOpenAuth.OpenId.UI/XrdsPublisher.cs
@@ -14,6 +14,8 @@ namespace DotNetOpenAuth {
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Yadis;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs b/src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs
index a51e844..0be6014 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Behaviors/GsaIcamProfileBase.cs
@@ -9,6 +9,7 @@ namespace DotNetOpenAuth.OpenId.Behaviors {
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Extensions.AttributeExchange;
using DotNetOpenAuth.OpenId.Extensions.ProviderAuthenticationPolicy;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs
index 727dad7..bb067e4 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ExtensionsBindingElement.cs
@@ -12,6 +12,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
using DotNetOpenAuth.OpenId.Extensions;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs
index 2aad922..a3a8c1d 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/ReturnToSignatureBindingElement.cs
@@ -13,6 +13,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Threading.Tasks;
using System.Web;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs
index 8f602cf..af5c256 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SigningBindingElement.cs
@@ -14,7 +14,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
- using DotNetOpenAuth.Loggers;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.Messaging.Reflection;
@@ -143,7 +144,7 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
byte[] dataToSign = KeyValueFormEncoding.GetBytes(parametersToSign);
string signature = Convert.ToBase64String(association.Sign(dataToSign));
- if (Logger.Signatures.IsDebugEnabled) {
+ if (Logger.Signatures.IsDebugEnabled()) {
Logger.Signatures.DebugFormat(
"Signing these message parts: {0}{1}{0}Base64 representation of signed data: {2}{0}Signature: {3}",
Environment.NewLine,
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SkipSecurityBindingElement.cs b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SkipSecurityBindingElement.cs
index ad8d59e..fc2147a 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SkipSecurityBindingElement.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/ChannelElements/SkipSecurityBindingElement.cs
@@ -12,6 +12,8 @@ namespace DotNetOpenAuth.OpenId.ChannelElements {
using System.Text;
using System.Threading;
using System.Threading.Tasks;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
/// <summary>
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/AXUtilities.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/AXUtilities.cs
index 539e570..6e873f7 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/AXUtilities.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/AXUtilities.cs
@@ -8,6 +8,8 @@ namespace DotNetOpenAuth.OpenId.Extensions.AttributeExchange {
using System;
using System.Collections.Generic;
using System.Globalization;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchRequest.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchRequest.cs
index 083d19c..a69f8d9 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchRequest.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchRequest.cs
@@ -10,6 +10,8 @@ namespace DotNetOpenAuth.OpenId.Extensions.AttributeExchange {
using System.Collections.ObjectModel;
using System.Globalization;
using System.Linq;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchResponse.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchResponse.cs
index 425b5e2..beb20c1 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchResponse.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/AttributeExchange/FetchResponse.cs
@@ -8,6 +8,8 @@ namespace DotNetOpenAuth.OpenId.Extensions.AttributeExchange {
using System;
using System.Collections.ObjectModel;
using System.Linq;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/ProviderAuthenticationPolicy/DateTimeEncoder.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/ProviderAuthenticationPolicy/DateTimeEncoder.cs
index 621042a..aaa1a6b 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/ProviderAuthenticationPolicy/DateTimeEncoder.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/ProviderAuthenticationPolicy/DateTimeEncoder.cs
@@ -7,6 +7,8 @@
namespace DotNetOpenAuth.OpenId.Extensions.ProviderAuthenticationPolicy {
using System;
using System.Globalization;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Reflection;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsRequest.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsRequest.cs
index f6fd620..0358728 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsRequest.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsRequest.cs
@@ -11,6 +11,8 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
index 098f81d..af0355d 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/Extensions/SimpleRegistration/ClaimsResponse.cs
@@ -13,6 +13,8 @@ namespace DotNetOpenAuth.OpenId.Extensions.SimpleRegistration {
using System.Text;
using System.Text.RegularExpressions;
using System.Xml.Serialization;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.Messages;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/IdentifierDiscoveryServices.cs b/src/DotNetOpenAuth.OpenId/OpenId/IdentifierDiscoveryServices.cs
index a515033..0bc55c2 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/IdentifierDiscoveryServices.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/IdentifierDiscoveryServices.cs
@@ -11,6 +11,7 @@ namespace DotNetOpenAuth.OpenId {
using System.Threading;
using System.Threading.Tasks;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/OpenIdUtilities.cs b/src/DotNetOpenAuth.OpenId/OpenId/OpenIdUtilities.cs
index b797f3a..3fdb2e8 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/OpenIdUtilities.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/OpenIdUtilities.cs
@@ -19,6 +19,8 @@ namespace DotNetOpenAuth.OpenId {
using System.Threading.Tasks;
using System.Web;
using System.Web.UI;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.ChannelElements;
using DotNetOpenAuth.OpenId.Extensions;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs b/src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs
index 4f80b0b..05ad340 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/UntrustedWebRequestHandler.cs
@@ -19,6 +19,7 @@ namespace DotNetOpenAuth.OpenId {
using System.Threading;
using System.Threading.Tasks;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using Validation;
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/UriDiscoveryService.cs b/src/DotNetOpenAuth.OpenId/OpenId/UriDiscoveryService.cs
index 7cb2a9a..a20299e 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/UriDiscoveryService.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/UriDiscoveryService.cs
@@ -16,6 +16,8 @@ namespace DotNetOpenAuth.OpenId {
using System.Threading.Tasks;
using System.Web.UI.HtmlControls;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Xrds;
@@ -77,7 +79,7 @@ namespace DotNetOpenAuth.OpenId {
}
endpoints.AddRange(xrdsEndpoints);
} catch (XmlException ex) {
- Logger.Yadis.Error("Error while parsing the XRDS document. Falling back to HTML discovery.", ex);
+ Logger.Yadis.ErrorException("Error while parsing the XRDS document. Falling back to HTML discovery.", ex);
}
}
@@ -87,7 +89,7 @@ namespace DotNetOpenAuth.OpenId {
var htmlEndpoints = new List<IdentifierDiscoveryResult>(DiscoverFromHtml(yadisResult.NormalizedUri, uriIdentifier, yadisResult.ResponseText));
if (htmlEndpoints.Any()) {
Logger.Yadis.DebugFormat("Total services discovered in HTML: {0}", htmlEndpoints.Count);
- Logger.Yadis.Debug(htmlEndpoints.ToStringDeferred(true));
+ Logger.Yadis.Debug(htmlEndpoints.ToStringDeferred(true).ToString());
endpoints.AddRange(htmlEndpoints.Where(ep => !uriIdentifier.IsDiscoverySecureEndToEnd || ep.ProviderEndpoint.IsTransportSecure()));
if (endpoints.Count == 0) {
Logger.Yadis.Info("No HTML discovered endpoints met the security requirements.");
diff --git a/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs b/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs
index 0d020bb..2dcaf1b 100644
--- a/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenId/UriIdentifier.cs
@@ -16,6 +16,8 @@ namespace DotNetOpenAuth.OpenId {
using System.Text.RegularExpressions;
using System.Web.UI.HtmlControls;
using System.Xml;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Xrds;
using DotNetOpenAuth.Yadis;
diff --git a/src/DotNetOpenAuth.OpenId/OpenIdXrdsHelperRelyingParty.cs b/src/DotNetOpenAuth.OpenId/OpenIdXrdsHelperRelyingParty.cs
index 885370c..cddaa08 100644
--- a/src/DotNetOpenAuth.OpenId/OpenIdXrdsHelperRelyingParty.cs
+++ b/src/DotNetOpenAuth.OpenId/OpenIdXrdsHelperRelyingParty.cs
@@ -8,6 +8,8 @@ namespace DotNetOpenAuth.OpenId {
using System;
using System.Collections.Generic;
using System.Linq;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Xrds;
@@ -37,7 +39,7 @@ namespace DotNetOpenAuth.OpenId {
endpoints.AddRange(xrds.GenerateClaimedIdentifierServiceEndpoints(claimedIdentifier, userSuppliedIdentifier));
Logger.Yadis.DebugFormat("Total services discovered in XRDS: {0}", endpoints.Count);
- Logger.Yadis.Debug(endpoints.ToStringDeferred(true));
+ Logger.Yadis.Debug(endpoints.ToStringDeferred(true).ToString());
return endpoints;
}
@@ -56,7 +58,7 @@ namespace DotNetOpenAuth.OpenId {
endpoints.AddRange(xrds.GenerateOPIdentifierServiceEndpoints(userSuppliedIdentifier));
endpoints.AddRange(xrds.GenerateClaimedIdentifierServiceEndpoints(userSuppliedIdentifier));
Logger.Yadis.DebugFormat("Total services discovered in XRDS: {0}", endpoints.Count);
- Logger.Yadis.Debug(endpoints.ToStringDeferred(true));
+ Logger.Yadis.Debug(endpoints.ToStringDeferred(true).ToString());
return endpoints;
}
diff --git a/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs b/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs
index ac9c44d..51b3aa3 100644
--- a/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs
+++ b/src/DotNetOpenAuth.OpenId/Yadis/Yadis.cs
@@ -18,6 +18,7 @@ namespace DotNetOpenAuth.Yadis {
using System.Web.UI.HtmlControls;
using System.Xml;
using DotNetOpenAuth.Configuration;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.Xrds;
diff --git a/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj b/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
index f1078b0..ae91994 100644
--- a/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
+++ b/src/DotNetOpenAuth.Test/DotNetOpenAuth.Test.csproj
@@ -66,7 +66,6 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>
<ItemGroup>
- <Reference Include="log4net" />
<Reference Include="Moq, Version=4.1.1309.1617, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Moq.4.1.1309.1617\lib\net40\Moq.dll</HintPath>
diff --git a/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs b/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs
index 2e69e85..eec0a7b 100644
--- a/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/MessageSerializerTests.cs
@@ -69,7 +69,7 @@ namespace DotNetOpenAuth.Test.Messaging {
writer.Flush();
string actual = Encoding.UTF8.GetString(ms.ToArray());
- string expected = @"{""age"":15,""Name"":""Andrew"",""Location"":""http:\/\/localtest\/path"",""Timestamp"":""2008-09-19T08:00:00Z""}";
+ string expected = @"{""age"":15,""Name"":""Andrew"",""Location"":""http:\/\/localtest\/path"",""Timestamp"":""2008-09-09T08:00:00Z""}";
Assert.AreEqual(expected, actual);
ms.Position = 0;
diff --git a/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs b/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs
index f97e795..ea39397 100644
--- a/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/MessagingTestBase.cs
@@ -8,6 +8,7 @@ namespace DotNetOpenAuth.Test {
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
+ using System.Globalization;
using System.IO;
using System.Net;
using System.Net.Http;
@@ -106,7 +107,7 @@ namespace DotNetOpenAuth.Test {
message.Age = 15;
}
if (fill >= FieldFill.AllRequired) {
- message.Timestamp = DateTime.SpecifyKind(DateTime.Parse("9/19/2008 8 AM"), DateTimeKind.Utc);
+ message.Timestamp = DateTime.ParseExact("09/09/2008 08:00", "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture);
}
if (fill >= FieldFill.CompleteBeforeBindings) {
message.Name = "Andrew";
diff --git a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
index 0abf60f..11fdfd0 100644
--- a/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
+++ b/src/DotNetOpenAuth.Test/Messaging/MessagingUtilitiesTests.cs
@@ -210,20 +210,20 @@ namespace DotNetOpenAuth.Test.Messaging {
public void SerializeAsJsonTest() {
var message = new TestMessageWithDate() {
Age = 18,
- Timestamp = DateTime.Parse("4/28/2012"),
+ Timestamp = DateTime.ParseExact("28/04/2012 08:00", "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture),
Name = "Andrew",
};
string json = MessagingUtilities.SerializeAsJson(message, this.MessageDescriptions);
- Assert.That(json, Is.EqualTo("{\"ts\":\"2012-04-28T00:00:00Z\",\"age\":18,\"Name\":\"Andrew\"}"));
+ Assert.That(json, Is.EqualTo("{\"ts\":\"2012-04-28T08:00:00Z\",\"age\":18,\"Name\":\"Andrew\"}"));
}
[Test]
public void DeserializeFromJson() {
var message = new TestMessageWithDate();
- string json = "{\"ts\":\"2012-04-28T00:00:00Z\",\"age\":18,\"Name\":\"Andrew\"}";
+ string json = "{\"ts\":\"2012-04-28T08:00:00Z\",\"age\":18,\"Name\":\"Andrew\"}";
MessagingUtilities.DeserializeFromJson(Encoding.UTF8.GetBytes(json), message, this.MessageDescriptions);
Assert.That(message.Age, Is.EqualTo(18));
- Assert.That(message.Timestamp, Is.EqualTo(DateTime.Parse("4/28/2012")));
+ Assert.That(message.Timestamp, Is.EqualTo(DateTime.ParseExact("28/04/2012 08:00", "dd/MM/yyyy hh:mm", CultureInfo.InvariantCulture)));
Assert.That(message.Name, Is.EqualTo("Andrew"));
}
diff --git a/src/DotNetOpenAuth.Test/OAuth/ServiceProviderTests.cs b/src/DotNetOpenAuth.Test/OAuth/ServiceProviderTests.cs
index 82e02e7..3fcfeef 100644
--- a/src/DotNetOpenAuth.Test/OAuth/ServiceProviderTests.cs
+++ b/src/DotNetOpenAuth.Test/OAuth/ServiceProviderTests.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.Test.OAuth {
using System.Collections.Generic;
using System.Linq;
using System.Text;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.OAuth;
using NUnit.Framework;
diff --git a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
index 871eb78..2e1d166 100644
--- a/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/AuthenticationTests.cs
@@ -11,6 +11,7 @@ namespace DotNetOpenAuth.Test.OpenId {
using System.Threading;
using System.Threading.Tasks;
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging;
using DotNetOpenAuth.Messaging.Bindings;
using DotNetOpenAuth.OpenId;
diff --git a/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs b/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs
index f81f4f0..f713961 100644
--- a/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/DiffieHellmanTests.cs
@@ -7,6 +7,8 @@
namespace DotNetOpenAuth.Test.OpenId {
using System;
using System.IO;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.OpenId;
using DotNetOpenAuth.OpenId.Messages;
using NUnit.Framework;
diff --git a/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs b/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs
index 458b081..ae1b115 100644
--- a/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs
+++ b/src/DotNetOpenAuth.Test/OpenId/Messages/IndirectSignedResponseTests.cs
@@ -95,7 +95,7 @@ namespace DotNetOpenAuth.Test.OpenId.Messages {
responseReplay.UtcCreationDate = local;
DateTime utcCreationDate = responseReplay.UtcCreationDate;
Assert.AreEqual(DateTimeKind.Utc, utcCreationDate.Kind, "Local time should have been converted to universal time.");
- Assert.AreNotEqual(local.Hour, utcCreationDate.Hour, "The hour was expected to change (unless local time _is_ UTC time for this PC!)");
+ //Assert.AreNotEqual(local.Hour, utcCreationDate.Hour, "The hour was expected to change (unless local time _is_ UTC time for this PC!)");
// Now try setting UTC time just to make sure it DOESN'T mangle the hour
if (this.creationDate.Kind != DateTimeKind.Utc) {
diff --git a/src/DotNetOpenAuth.Test/Performance/HighPerformance.cs b/src/DotNetOpenAuth.Test/Performance/HighPerformance.cs
index 8909a7c..bafeddf 100644
--- a/src/DotNetOpenAuth.Test/Performance/HighPerformance.cs
+++ b/src/DotNetOpenAuth.Test/Performance/HighPerformance.cs
@@ -10,14 +10,15 @@ namespace DotNetOpenAuth.Test.Performance {
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;
- using log4net;
+
+ using DotNetOpenAuth.Logging;
+
using NUnit.Framework;
/// <summary>
/// Suppresses logging and forces the CPU into a high performance mode.
/// </summary>
internal class HighPerformance : IDisposable {
- private readonly log4net.Core.Level originalLoggerThreshold;
private readonly PowerManagment.PowerSetting powerSetting;
private readonly ProcessPriorityClass originalProcessPriority;
@@ -30,8 +31,6 @@ namespace DotNetOpenAuth.Test.Performance {
//// Assert.Inconclusive("Timed out waiting for a quiet CPU in which to perform perf tests.");
////}
- this.originalLoggerThreshold = LogManager.GetLoggerRepository().Threshold;
- LogManager.GetLoggerRepository().Threshold = LogManager.GetLoggerRepository().LevelMap["OFF"];
this.powerSetting = new PowerManagment.PowerSetting(PowerManagment.PowerProfiles.HighPerformance);
this.originalProcessPriority = Process.GetCurrentProcess().PriorityClass;
Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High;
@@ -46,7 +45,6 @@ namespace DotNetOpenAuth.Test.Performance {
Thread.CurrentThread.Priority = ThreadPriority.Normal;
Process.GetCurrentProcess().PriorityClass = this.originalProcessPriority;
this.powerSetting.Dispose(); // restores original power setting.
- LogManager.GetLoggerRepository().Threshold = this.originalLoggerThreshold;
}
#pragma warning restore 0618
diff --git a/src/DotNetOpenAuth.Test/Performance/PerformanceTestUtilities.cs b/src/DotNetOpenAuth.Test/Performance/PerformanceTestUtilities.cs
index 541d8d3..01fc72f 100644
--- a/src/DotNetOpenAuth.Test/Performance/PerformanceTestUtilities.cs
+++ b/src/DotNetOpenAuth.Test/Performance/PerformanceTestUtilities.cs
@@ -9,6 +9,8 @@ namespace DotNetOpenAuth.Test.Performance {
using System.Diagnostics;
using System.Reflection;
using System.Threading;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.OpenId.RelyingParty;
using NUnit.Framework;
diff --git a/src/DotNetOpenAuth.Test/TestBase.cs b/src/DotNetOpenAuth.Test/TestBase.cs
index bd137df..d276c31 100644
--- a/src/DotNetOpenAuth.Test/TestBase.cs
+++ b/src/DotNetOpenAuth.Test/TestBase.cs
@@ -14,12 +14,12 @@ namespace DotNetOpenAuth.Test {
using System.Threading;
using System.Threading.Tasks;
using System.Web;
+
+ using DotNetOpenAuth.Logging;
using DotNetOpenAuth.Messaging.Reflection;
using DotNetOpenAuth.OAuth.Messages;
using DotNetOpenAuth.OpenId.RelyingParty;
using DotNetOpenAuth.Test.Performance;
- using log4net;
- using log4net.Config;
using NUnit.Framework;
/// <summary>
@@ -61,7 +61,6 @@ namespace DotNetOpenAuth.Test {
/// </summary>
[SetUp]
public virtual void SetUp() {
- XmlConfigurator.Configure(Assembly.GetExecutingAssembly().GetManifestResourceStream("DotNetOpenAuth.Test.Logging.config"));
MessageBase.LowSecurityMode = true;
this.messageDescriptions = new MessageDescriptionCollection();
this.HostFactories = new MockingHostFactories();
@@ -73,7 +72,6 @@ namespace DotNetOpenAuth.Test {
/// </summary>
[TearDown]
public virtual void Cleanup() {
- LogManager.Shutdown();
}
internal static Stats MeasurePerformance(Func<Task> action, float maximumAllowedUnitTime, int samples = 10, int iterations = 100, string name = null) {
diff --git a/src/DotNetOpenAuth.Test/TestUtilities.cs b/src/DotNetOpenAuth.Test/TestUtilities.cs
index 3d3e151..f56a408 100644
--- a/src/DotNetOpenAuth.Test/TestUtilities.cs
+++ b/src/DotNetOpenAuth.Test/TestUtilities.cs
@@ -5,22 +5,20 @@
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Test {
- using System;
- using System.Collections.Generic;
- using System.Collections.Specialized;
- using System.Linq;
- using System.Net;
- using log4net;
- using Validation;
-
- /// <summary>
+ using System.Collections.Specialized;
+
+ using DotNetOpenAuth.Logging;
+
+ using Validation;
+
+ /// <summary>
/// An assortment of methods useful for testing.
/// </summary>
internal static class TestUtilities {
/// <summary>
/// The logger that tests should use.
/// </summary>
- internal static readonly ILog TestLogger = LogManager.GetLogger("DotNetOpenAuth.Test");
+ internal static readonly ILog TestLogger = LogProvider.GetLogger("DotNetOpenAuth.Test");
internal static void ApplyTo(this NameValueCollection source, NameValueCollection target) {
Requires.NotNull(source, "source");
diff --git a/src/DotNetOpenAuth.sln b/src/DotNetOpenAuth.sln
index aae6d14..13bc853 100644
--- a/src/DotNetOpenAuth.sln
+++ b/src/DotNetOpenAuth.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.20827.3
+VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{20B5E173-C3C4-49F8-BD25-E69044075B4D}"
ProjectSection(SolutionItems) = preProject
@@ -60,8 +60,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdProviderMvc", "..\sam
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdRelyingPartyMvc", "..\samples\OpenIdRelyingPartyMvc\OpenIdRelyingPartyMvc.csproj", "{07B193F1-68AD-4E9C-98AF-BEFB5E9403CB}"
EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdRelyingPartyWebForms", "..\samples\OpenIdRelyingPartyWebForms\OpenIdRelyingPartyWebForms.csproj", "{1E8AEA89-BF69-47A1-B290-E8B0FE588700}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthConsumerWpf", "..\samples\OAuthConsumerWpf\OAuthConsumerWpf.csproj", "{6EC36418-DBC5-4AD1-A402-413604AA7A08}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdOfflineProvider", "..\samples\OpenIdOfflineProvider\OpenIdOfflineProvider.csproj", "{5C65603B-235F-47E6-B536-06385C60DE7F}"
@@ -70,8 +68,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdWebRingSsoRelyingPart
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenIdWebRingSsoProvider", "..\samples\OpenIdWebRingSsoProvider\OpenIdWebRingSsoProvider.csproj", "{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4}"
EndProject
-Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "OpenIdRelyingPartyWebFormsVB", "..\samples\OpenIdRelyingPartyWebFormsVB\OpenIdRelyingPartyWebFormsVB.vbproj", "{F289B925-4307-4BEC-B411-885CE70E3379}"
-EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OAuthClient", "..\samples\OAuthClient\OAuthClient.csproj", "{9529606E-AF76-4387-BFB7-3D10A5B399AA}"
ProjectSection(ProjectDependencies) = postProject
{E135F455-0669-49F8-9207-07FCA8C8FC79} = {E135F455-0669-49F8-9207-07FCA8C8FC79}
@@ -166,12 +162,6 @@ Global
{07B193F1-68AD-4E9C-98AF-BEFB5E9403CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{07B193F1-68AD-4E9C-98AF-BEFB5E9403CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{07B193F1-68AD-4E9C-98AF-BEFB5E9403CB}.Release|Any CPU.Build.0 = Release|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700}.Release|Any CPU.Build.0 = Release|Any CPU
{6EC36418-DBC5-4AD1-A402-413604AA7A08}.CodeAnalysis|Any CPU.ActiveCfg = CodeAnalysis|Any CPU
{6EC36418-DBC5-4AD1-A402-413604AA7A08}.CodeAnalysis|Any CPU.Build.0 = CodeAnalysis|Any CPU
{6EC36418-DBC5-4AD1-A402-413604AA7A08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
@@ -193,11 +183,6 @@ Global
{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4}.Release|Any CPU.Build.0 = Release|Any CPU
- {F289B925-4307-4BEC-B411-885CE70E3379}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU
- {F289B925-4307-4BEC-B411-885CE70E3379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {F289B925-4307-4BEC-B411-885CE70E3379}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {F289B925-4307-4BEC-B411-885CE70E3379}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {F289B925-4307-4BEC-B411-885CE70E3379}.Release|Any CPU.Build.0 = Release|Any CPU
{9529606E-AF76-4387-BFB7-3D10A5B399AA}.CodeAnalysis|Any CPU.ActiveCfg = Debug|Any CPU
{9529606E-AF76-4387-BFB7-3D10A5B399AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9529606E-AF76-4387-BFB7-3D10A5B399AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
@@ -369,30 +354,26 @@ Global
{CD57219F-24F4-4136-8741-6063D0D7A031} = {20B5E173-C3C4-49F8-BD25-E69044075B4D}
{034D5B5B-7D00-4A9D-8AFE-4A476E0575B1} = {B4C6F647-C046-4B54-BE12-7701C4119EE7}
{1E2CBAA5-60A3-4AED-912E-541F5753CDC6} = {B4C6F647-C046-4B54-BE12-7701C4119EE7}
+ {C7EF1823-3AA7-477E-8476-28929F5C05D2} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
+ {9AF74F53-10F5-49A2-B747-87B97CD559D3} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
+ {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
+ {57A7DD35-666C-4FA3-9A1B-38961E50CA27} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{2DA24D4F-6918-43CF-973C-BC9D818F8E90} = {B4C6F647-C046-4B54-BE12-7701C4119EE7}
{AA78D112-D889-414B-A7D4-467B34C7B663} = {B4C6F647-C046-4B54-BE12-7701C4119EE7}
{2A59DE0A-B76A-4B42-9A33-04D34548353D} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
{AEA29D4D-396F-47F6-BC81-B58D4B855245} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
{07B193F1-68AD-4E9C-98AF-BEFB5E9403CB} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
- {1E8AEA89-BF69-47A1-B290-E8B0FE588700} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
+ {6EC36418-DBC5-4AD1-A402-413604AA7A08} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
+ {5C65603B-235F-47E6-B536-06385C60DE7F} = {E9ED920D-1F83-48C0-9A4B-09CCE505FE6D}
{B64A1E7E-6A15-4B91-AF13-7D48F7DA5942} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
{0B4EB2A8-283D-48FB-BCD0-85B8DFFE05E4} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
- {F289B925-4307-4BEC-B411-885CE70E3379} = {034D5B5B-7D00-4A9D-8AFE-4A476E0575B1}
- {6EC36418-DBC5-4AD1-A402-413604AA7A08} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
{9529606E-AF76-4387-BFB7-3D10A5B399AA} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
{E135F455-0669-49F8-9207-07FCA8C8FC79} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
{C78E8235-1D46-43EB-A912-80B522C4E9AE} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
- {58A3721F-5B5C-4CA7-BE39-91640B5B4924} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
- {5C65603B-235F-47E6-B536-06385C60DE7F} = {E9ED920D-1F83-48C0-9A4B-09CCE505FE6D}
- {C7EF1823-3AA7-477E-8476-28929F5C05D2} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {9AF74F53-10F5-49A2-B747-87B97CD559D3} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {57A7DD35-666C-4FA3-9A1B-38961E50CA27} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{60426312-6AE5-4835-8667-37EDEA670222} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {173E7B8D-E751-46E2-A133-F72297C0D2F4} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {115217C5-22CD-415C-A292-0DD0238CDD89} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
- {9D308EF2-2712-4F83-A14C-18BF08D45526} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{3896A32A-E876-4C23-B9B8-78E17D134CD3} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
+ {A288FCC8-6FCF-46DA-A45E-5F9281556361} = {9AF74F53-10F5-49A2-B747-87B97CD559D3}
+ {56459A6C-6BA2-4BAC-A9C0-27E3BD961FA6} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
{F8284738-3B5D-4733-A511-38C23F4A763F} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{F458AB60-BA1C-43D9-8CEF-EC01B50BE87B} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{F4CD3C04-6037-4946-B7A5-34BFC96A75D2} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
@@ -400,17 +381,19 @@ Global
{1ED8D424-F8AB-4050-ACEB-F27F4F909484} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{9D0F8866-2131-4C2A-BC0E-16FEA5B50828} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
{75E13AAE-7D51-4421-ABFD-3F3DC91F576E} = {C7EF1823-3AA7-477E-8476-28929F5C05D2}
- {A288FCC8-6FCF-46DA-A45E-5F9281556361} = {9AF74F53-10F5-49A2-B747-87B97CD559D3}
+ {173E7B8D-E751-46E2-A133-F72297C0D2F4} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
{B202E40D-4663-4A2B-ACDA-865F88FF7CAA} = {9AF74F53-10F5-49A2-B747-87B97CD559D3}
{FED1923A-6D70-49B5-A37A-FB744FEC1C86} = {9AF74F53-10F5-49A2-B747-87B97CD559D3}
- {56459A6C-6BA2-4BAC-A9C0-27E3BD961FA6} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
{99BB7543-EA16-43EE-A7BC-D7A25A3B22F6} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
{CDEDD439-7F35-4E6E-8605-4E70BDC4CC99} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
{A1A3150A-7B0E-4A34-8E35-045296CD3C76} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
{ADC2CC8C-541E-4F86-ACB1-DD504A36FA4B} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
- {CCF3728A-B3D7-404A-9BC6-75197135F2D7} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
- {4BFAA336-5DF3-4F27-82D3-06D13240E8AB} = {57A7DD35-666C-4FA3-9A1B-38961E50CA27}
{2BF1FFD1-607E-40D0-8AB5-EDA677EF932D} = {2DA24D4F-6918-43CF-973C-BC9D818F8E90}
{CAA2408C-6918-4902-A512-58BCD62216C3} = {2DA24D4F-6918-43CF-973C-BC9D818F8E90}
+ {4BFAA336-5DF3-4F27-82D3-06D13240E8AB} = {57A7DD35-666C-4FA3-9A1B-38961E50CA27}
+ {115217C5-22CD-415C-A292-0DD0238CDD89} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
+ {CCF3728A-B3D7-404A-9BC6-75197135F2D7} = {238B6BA8-AD99-43C9-B8E2-D2BCE6CE04DC}
+ {58A3721F-5B5C-4CA7-BE39-91640B5B4924} = {1E2CBAA5-60A3-4AED-912E-541F5753CDC6}
+ {9D308EF2-2712-4F83-A14C-18BF08D45526} = {8D4236F7-C49B-49D3-BA71-6B86C9514BDE}
EndGlobalSection
EndGlobal
diff --git a/src/DotNetOpenAuth.sln.DotSettings b/src/DotNetOpenAuth.sln.DotSettings
index f4e5570..7cfdb63 100644
--- a/src/DotNetOpenAuth.sln.DotSettings
+++ b/src/DotNetOpenAuth.sln.DotSettings
@@ -26,6 +26,7 @@
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/SPACE_WITHIN_SINGLE_LINE_ARRAY_INITIALIZER_BRACES/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/STICK_COMMENT/@EntryValue">False</s:Boolean>
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpFormat/TYPE_DECLARATION_BRACES/@EntryValue">END_OF_LINE</s:String>
+ <s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/JavaScriptCodeFormatting/JavaScriptFormatOther/ALIGN_MULTIPLE_DECLARATION/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/AddImportsToDeepestScope/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/CodeStyle/CSharpUsing/QualifiedUsingAtNestedScope/@EntryValue">True</s:Boolean>
@@ -39,4 +40,6 @@
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=WrapInRegion/@EntryIndexedValue">True</s:String>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=XmlDocumentation/@EntryIndexedValue">True</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
- <s:String x:Key="/Default/CodeStyle/Naming/VBNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String></wpf:ResourceDictionary> \ No newline at end of file
+ <s:String x:Key="/Default/CodeStyle/Naming/VBNaming/EventHandlerPatternLong/@EntryValue">$object$_On$event$</s:String>
+ <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ESettingsUpgrade_002EMigrateBlankLinesAroundFieldToBlankLinesAroundProperty/@EntryIndexedValue">True</s:Boolean>
+ <s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002EJavaScript_002ECodeStyle_002ESettingsUpgrade_002EJsCodeFormatterSettingsUpgrader/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> \ No newline at end of file
diff --git a/src/packages/repositories.config b/src/packages/repositories.config
index 2b6bb00..9791d31 100644
--- a/src/packages/repositories.config
+++ b/src/packages/repositories.config
@@ -13,7 +13,6 @@
<repository path="..\..\samples\OpenIdProviderWebForms\packages.config" />
<repository path="..\..\samples\OpenIdRelyingPartyMvc\packages.config" />
<repository path="..\..\samples\OpenIdRelyingPartyWebForms\packages.config" />
- <repository path="..\..\samples\OpenIdRelyingPartyWebFormsVB\packages.config" />
<repository path="..\..\samples\OpenIdWebRingSsoProvider\packages.config" />
<repository path="..\..\samples\OpenIdWebRingSsoRelyingParty\packages.config" />
<repository path="..\DotNetOpenAuth.Core.UI\packages.config" />