public void Log(LogLevel logLevel, string message)
 {
     Log(logLevel, message, null);
 }
        public void Log(LogLevel logLevel, string message, Exception exception)
        {
            var isException = exception != null;

            switch (logLevel)
            {
            case LogLevel.Trace:
                if (isException)
                {
                    _internalTarget.Trace(message, exception);
                }
                else
                {
                    _internalTarget.Trace(message);
                }
                break;

            case LogLevel.Debug:
                if (isException)
                {
                    _internalTarget.Debug(message, exception);
                }
                else
                {
                    _internalTarget.Debug(message);
                }
                break;

            case LogLevel.Info:
                if (isException)
                {
                    _internalTarget.Info(message, exception);
                }
                else
                {
                    _internalTarget.Info(message);
                }
                break;

            case LogLevel.Warning:
                if (isException)
                {
                    _internalTarget.Warn(message, exception);
                }
                else
                {
                    _internalTarget.Warn(message);
                }
                break;

            case LogLevel.Error:
                if (isException)
                {
                    _internalTarget.Error(message, exception);
                }
                else
                {
                    _internalTarget.Error(message);
                }
                break;

            case LogLevel.Fatal:
                if (isException)
                {
                    _internalTarget.Fatal(message, exception);
                }
                else
                {
                    _internalTarget.Fatal(message);
                }
                break;
            }
        }
 /// <summary>
 /// Set the level of the given logger to the given log level.
 /// </summary>
 /// <param name="logger">The module logger for which the new log level should be set.</param>
 /// <param name="level">The new log level to which the given logger should be set.</param>
 public override void SetLevel(IModuleLogger logger, LogLevel level)
 {
     base.SetLevel(logger, level);
     ConfigManager.SaveConfiguration(_config);
 }