Rewrite entire ASF logging, as preparation for #354

This commit is contained in:
JustArchi
2016-11-06 12:06:02 +01:00
parent 770fe6c333
commit 8b3b822938
30 changed files with 701 additions and 672 deletions

View File

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