forked from jjxtra/UrlMonitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Logger.cs
42 lines (36 loc) · 878 Bytes
/
Logger.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NLog;
namespace UrlMonitor
{
public enum LogLevel
{
Info,
Warning,
Error
}
/// <summary>
/// Logger
/// </summary>
public static class Log
{
private static readonly Logger logger = LogManager.GetLogger("FileLogger");
public static void Write(LogLevel level, string text, params object[] args)
{
switch (level)
{
case LogLevel.Info:
logger.Info(text, args);
break;
case LogLevel.Warning:
logger.Warn(text, args);
break;
case LogLevel.Error:
logger.Error(text, args);
break;
}
}
}
}