using System;
using NLog;
using Quadarax.Foundation.Core.Logging;

namespace Quadarax.Foundation.Core.NLog
{
    public static class LogSeverityEnumExt
    {
        public static LogLevel ToNLogLevel(this LogSeverityEnum owner)
        {
            switch (owner)
            {
                    case LogSeverityEnum.Trace:
                        return LogLevel.Trace;
                    case LogSeverityEnum.Debug:
                        return LogLevel.Debug;
                    case LogSeverityEnum.Info:
                        return LogLevel.Info;
                    case LogSeverityEnum.Warn:
                        return LogLevel.Warn;
                    case LogSeverityEnum.Error:
                        return LogLevel.Error;
                    case LogSeverityEnum.Fatal:
                        return LogLevel.Fatal;
                    default:
                        throw new NotSupportedException($"Not supported enum conversion for '{owner}'");
            }
        }
    }
}
