/// <summary>Logs an information event to the wrapped <see cref="Logger"/>.</summary>
        /// <param name="logger">The logger.</param>
        /// <param name="message">The description of the event.</param>
        /// <param name="source">A source where the event occurred.</param>
        /// <returns>The id of the logged event or null in one of the following reasons:
        /// The event hasn't been logged, because of the current
        /// <see cref="LoggingProviderBase.Threshold">Threshold</see> level;
        /// Returning an id is not supported by the current implementation;
        /// The event has been logged to a fallback provider, because of an error in the current implementation.
        /// </returns>
        /// <exception cref="ArgumentException">Thrown when the supplied <paramref name="exception"/> is
        /// an empty string.</exception>
        /// <exception cref="ArgumentNullException">Thrown when the supplied <paramref name="message"/>,
        /// <paramref name="source"/> or <paramref name="logger"/> are null references (Nothing in VB).
        /// </exception>
        /// <exception cref="Exception">Thrown when the logging provider failed to log the event. The
        /// exact type of exception thrown depends on the actual provider implementation. See documentation
        /// of the <see cref="LoggingProviderBase.LogInternal">LogInternal</see> method of the used logging
        /// provider for more information.</exception>
        public static object Log(this ILogger logger, string message, MethodBase source)
        {
            LoggingHelper.ValideLoggerIsNotNull(logger);
            LoggingHelper.ValidateSourceIsNotNull(source);

            string methodName = LoggingHelper.BuildMethodName(source);

            LogEntry entry = new LogEntry(LoggingEventType.Information, message, methodName, null);

            return(logger.Log(entry));
        }
        /// <summary>Logs an error event to the wrapped <see cref="Logger"/>.</summary>
        /// <param name="logger">The logger.</param>
        /// <param name="exception">The exception that has to be logged.</param>
        /// <param name="source">A source where the event occurred.</param>
        /// <returns>The id of the logged event or null in one of the following reasons:
        /// The event hasn't been logged, because of the current
        /// <see cref="LoggingProviderBase.Threshold">Threshold</see> level;
        /// Returning an id is not supported by the current implementation;
        /// The event has been logged to a fallback provider, because of an error in the current implementation.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// Thrown when the supplied <paramref name="exception"/>,
        /// the <paramref name="source"/> or <paramref name="logger"/> are null references (Nothing in VB).
        /// </exception>
        /// <exception cref="Exception">Thrown when the logging provider failed to log the event. The
        /// exact type of exception thrown depends on the actual provider implementation. See documentation
        /// of the <see cref="LoggingProviderBase.LogInternal">LogInternal</see> method of the used logging
        /// provider for more information.</exception>
        public static object Log(this ILogger logger, Exception exception, MethodBase source)
        {
            LoggingHelper.ValideLoggerIsNotNull(logger);
            LoggingHelper.ValidateExceptionIsNotNull(exception);
            LoggingHelper.ValidateSourceIsNotNull(source);

            string message    = LoggingHelper.GetExceptionMessageOrExceptionType(exception);
            string methodName = LoggingHelper.BuildMethodName(source);

            LogEntry entry = new LogEntry(LoggingEventType.Error, message, methodName, exception);

            return(logger.Log(entry));
        }
        /// <summary>Logs an event to the wrapped <see cref="Logger"/>.</summary>
        /// <param name="logger">The logger.</param>
        /// <param name="severity">The severity of the event.</param>
        /// <param name="message">The description of the event.</param>
        /// <param name="source">A source where the event occurred.</param>
        /// <returns>The id of the logged event or null in one of the following reasons:
        /// The event hasn't been logged, because of the current
        /// <see cref="LoggingProviderBase.Threshold">Threshold</see> level;
        /// Returning an id is not supported by the current implementation;
        /// The event has been logged to a fallback provider, because of an error in the current implementation.
        /// </returns>
        /// <exception cref="ArgumentException">Thrown when the supplied <paramref name="message"/> is
        /// an empty string.</exception>
        /// <exception cref="ArgumentNullException">
        /// Thrown when the supplied <paramref name="message"/>, <paramref name="source"/> or
        /// <paramref name="logger"/> are null references (Nothing in VB).</exception>
        /// <exception cref="InvalidEnumArgumentException">Thrown when the supplied <paramref name="severity"/>
        /// has an unexpected value.</exception>
        /// <exception cref="Exception">Thrown when the logging provider failed to log the event. The
        /// exact type of exception thrown depends on the actual provider implementation. See documentation
        /// of the <see cref="LoggingProviderBase.LogInternal">LogInternal</see> method of the used logging
        /// provider for more information.</exception>
        public static object Log(this ILogger logger, LoggingEventType severity, string message,
                                 MethodBase source)
        {
            LoggingHelper.ValideLoggerIsNotNull(logger);
            LoggingHelper.ValidateSeverityInValidRange(severity);
            LoggingHelper.ValidateSourceIsNotNull(source);

            string methodName = LoggingHelper.BuildMethodName(source);

            LogEntry entry = new LogEntry(severity, message, methodName, null);

            return(logger.Log(entry));
        }