-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
42 lines (37 loc) · 1.14 KB
/
Program.cs
File metadata and controls
42 lines (37 loc) · 1.14 KB
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 Serilog;
using Serilog.Events;
namespace LetsBrew.BrewBot;
public static class Program
{
private static readonly ILogger Logger = new LoggerConfiguration()
.WriteTo.Console()
.WriteTo.File("discordBot.log", rollingInterval: RollingInterval.Day)
#if DEBUG
.MinimumLevel.Debug()
#endif
.CreateLogger();
public static void Main(string[] args)
{
}
public static void Log(LogEventLevel level, string message)
{
switch(level)
{
case LogEventLevel.Information:
Logger.Information(message);
break;
case LogEventLevel.Warning:
Logger.Warning(message);
break;
case LogEventLevel.Error:
Logger.Error(message);
break;
case LogEventLevel.Fatal:
Logger.Fatal(message);
break;
default:
Logger.Verbose(message);
break;
}
}
}