using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SafeMobileLib.Logs
{
public sealed class LogLevel
{
private readonly String name;
private readonly int value;
public static readonly LogLevel Minimal = new LogLevel(1, "minimal");
public static readonly LogLevel Critical = new LogLevel(2, "critical");
public static readonly LogLevel Verbose = new LogLevel(3, "verbose");
private LogLevel(int value, String name)
{
this.name = name;
this.value = value;
}
public override String ToString()
{
return name;
}
///
/// Get the direction from a string representation of it
///
/// String containing the log level name
/// Direction object
public static LogLevel GetLogLevel(String logLevel)
{
if (logLevel.ToLower().Trim().Equals(Critical.ToString().ToLower()))
return Critical;
if (logLevel.ToLower().Trim().Equals(Minimal.ToString().ToLower()))
return Minimal;
if (logLevel.ToLower().Trim().Equals(Verbose.ToString().ToLower()))
return Verbose;
return Verbose;
}
}
}