-
Notifications
You must be signed in to change notification settings - Fork 0
/
CustLogs.cs
53 lines (44 loc) · 1.2 KB
/
CustLogs.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
43
44
45
46
47
48
49
50
51
52
53
using System;
using System.Collections.Generic;
using System.IO;
namespace MigrateData3to4
{
class CustLogs
{
public List<string> DailyLogs = [];
public List<string> IntvLogs = [];
public CustLogs()
{
// Get all the stuff we need from Cumulus.ini
ReadIniFile();
}
private void ReadIniFile()
{
var pwd = Directory.GetCurrentDirectory();
if (!System.IO.File.Exists(pwd + Path.DirectorySeparatorChar + "Cumulus.ini"))
{
Utils.LogMessage("Failed to find Cumulus.ini file!");
Console.WriteLine("Failed to find Cumulus.ini file!");
Environment.Exit(1);
}
Utils.LogMessage("Reading Cumulus.ini file");
IniFile ini = new IniFile("Cumulus.ini");
// Custom Log Settings
for (var i = 0; i < 10; i++)
{
if (ini.ValueExists("CustomLogs", "DailyFilename" + i))
{
var name = ini.GetValue("CustomLogs", "DailyFilename" + i, string.Empty);
if (!string.IsNullOrEmpty(name))
DailyLogs.Add(name + ".txt");
}
if (ini.ValueExists("CustomLogs", "IntervalFilename" + i))
{
var name = ini.GetValue("CustomLogs", "IntervalFilename" + i, string.Empty);
if (!string.IsNullOrEmpty(name))
IntvLogs.Add(name);
}
}
}
}
}