Move main ArchiLogger from ASF to Program

It makes more sense to put it in ASF class due to sharing potential, but I want to unify ArchiBoT logging and this makes it easier for maintenance
This commit is contained in:
JustArchi
2016-12-23 18:49:52 +01:00
parent 4219107d2b
commit 30c69cf57c
23 changed files with 192 additions and 190 deletions

View File

@@ -82,7 +82,7 @@ namespace ArchiSteamFarm {
internal static BotDatabase Load(string filePath) {
if (string.IsNullOrEmpty(filePath)) {
ASF.ArchiLogger.LogNullError(nameof(filePath));
Program.ArchiLogger.LogNullError(nameof(filePath));
return null;
}
@@ -95,12 +95,12 @@ namespace ArchiSteamFarm {
try {
botDatabase = JsonConvert.DeserializeObject<BotDatabase>(File.ReadAllText(filePath));
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
Program.ArchiLogger.LogGenericException(e);
return null;
}
if (botDatabase == null) {
ASF.ArchiLogger.LogNullError(nameof(botDatabase));
Program.ArchiLogger.LogNullError(nameof(botDatabase));
return null;
}
@@ -111,7 +111,7 @@ namespace ArchiSteamFarm {
internal void Save() {
string json = JsonConvert.SerializeObject(this);
if (string.IsNullOrEmpty(json)) {
ASF.ArchiLogger.LogNullError(nameof(json));
Program.ArchiLogger.LogNullError(nameof(json));
return;
}
@@ -121,7 +121,7 @@ namespace ArchiSteamFarm {
File.WriteAllText(FilePath, json);
break;
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
Program.ArchiLogger.LogGenericException(e);
}
Thread.Sleep(1000);