-
Notifications
You must be signed in to change notification settings - Fork 3
/
Program.cs
executable file
·38 lines (33 loc) · 1.1 KB
/
Program.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
using System;
using System.IO;
using System.Threading.Tasks;
using log4net.Config;
namespace consolestatisticsappcsharp
{
public class Program
{
private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
static void Main(string[] args)
{
try
{
FileInfo fileInfo = new FileInfo("log4net.config");
XmlConfigurator.Configure(fileInfo);
Options options = Options.parseOptions(args);
if (options == null)
{
return;
}
StatisticsConsole console = new StatisticsConsole(options);
// Run() is an async method so we have to call Wait()
// have this thread wait for it to finish executing.
console.Run().Wait();
}
catch (Exception e)
{
Console.WriteLine("Error!:\n" + e.Message);
Console.WriteLine(e.StackTrace);
}
}
}
}