Made log level adjustable during runtime for ConsoleLogReceiver.cs.
Also renamed log levels to be pascal case.
This commit is contained in:
parent
f275ff330d
commit
3049cccc3e
@ -7,7 +7,7 @@ namespace SimpleLogger
|
|||||||
{
|
{
|
||||||
public string Identifier => "Console Logger";
|
public string Identifier => "Console Logger";
|
||||||
|
|
||||||
public LogLevel Level => LogLevel.DEBUG;
|
public LogLevel Level { get; set; } = LogLevel.Debug;
|
||||||
|
|
||||||
public void Flush()
|
public void Flush()
|
||||||
{
|
{
|
||||||
|
@ -2,9 +2,9 @@ namespace SimpleLogger
|
|||||||
{
|
{
|
||||||
public enum LogLevel : int
|
public enum LogLevel : int
|
||||||
{
|
{
|
||||||
FATAL,
|
Fatal,
|
||||||
INFO,
|
Info,
|
||||||
WARNING,
|
Warning,
|
||||||
DEBUG,
|
Debug,
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -12,7 +12,7 @@ namespace SimpleLogger
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="message">The message to log.</param>
|
/// <param name="message">The message to log.</param>
|
||||||
/// <param name="level">The level of severity, by default, info.</param>
|
/// <param name="level">The level of severity, by default, info.</param>
|
||||||
public static void Log(string message, LogLevel level = LogLevel.INFO) {
|
public static void Log(string message, LogLevel level = LogLevel.Info) {
|
||||||
foreach (ILogReceiver listener in listeners.Values)
|
foreach (ILogReceiver listener in listeners.Values)
|
||||||
{
|
{
|
||||||
if (level <= listener.Level) {
|
if (level <= listener.Level) {
|
||||||
|
Loading…
Reference in New Issue
Block a user