mirror of
https://github.com/JustArchiNET/ArchiSteamFarm.git
synced 2026-01-16 08:25:28 +00:00
Rewrite entire ASF logging, as preparation for #354
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user