using System; using Microsoft.Extensions.Logging; namespace LLama.Native { /// /// Severity level of a log message /// public enum LLamaLogLevel { /// /// Logs that highlight when the current flow of execution is stopped due to a failure. /// Error = 2, /// /// Logs that highlight an abnormal or unexpected event in the application flow, but do not otherwise cause the application execution to stop. /// Warning = 3, /// /// Logs that track the general flow of the application. /// Info = 4, /// /// Logs that are used for interactive investigation during development. /// Debug = 5, } internal static class LLamaLogLevelExtensions { public static LogLevel ToLogLevel(this LLamaLogLevel llama) { return (llama) switch { LLamaLogLevel.Error => LogLevel.Error, LLamaLogLevel.Warning => LogLevel.Warning, LLamaLogLevel.Info => LogLevel.Information, LLamaLogLevel.Debug => LogLevel.Debug, _ => throw new ArgumentOutOfRangeException(nameof(llama), llama, null) }; } } }