Aspects.Logging.Configuration.Concrete.ConfigFileConfigurationProvider.GetLogger C# (CSharp) Method

GetLogger() public method

Gets the logger.
/// The UseConsoleLogger and the Logger config cannot both be filled in at the same time ///
public GetLogger ( ) : ILogger
return ILogger
        public ILogger GetLogger()
        {
            if (!ConfigFileSource.IsEnabled)
            {
                return new NullLogger();
            }

            if (!string.IsNullOrWhiteSpace(ConfigFileSource.Logger) && ConfigFileSource.UseConsoleLogger)
            {
                throw new ConfigurationErrorsException(
                    "The UseConsoleLogger and the Logger config cannot both be filled in at the same time");
            }

            if (ConfigFileSource.UseConsoleLogger)
            {
                return new ConsoleLogger();
            }

            if (!string.IsNullOrWhiteSpace(ConfigFileSource.Logger))
            {
                Type type = Type.GetType(ConfigFileSource.Logger);
                if (type != null)
                {
                    return (ILogger)Activator.CreateInstance(type);
                }
            }

            throw new ConfigurationErrorsException("Could not find a proper configuration");
        }
    }
ConfigFileConfigurationProvider