Improve logging for PT Run (#6800)

* init code pass

* adjusting tabbing for readabilty

* few small adjustments
This commit is contained in:
Clint Rutkas
2020-09-23 16:32:06 -07:00
committed by GitHub
parent dafc1e0c7d
commit b071220b6c
35 changed files with 186 additions and 289 deletions

View File

@@ -51,7 +51,7 @@ namespace Wox.Infrastructure.Storage
if (File.Exists(FilePath))
{
File.Delete(FilePath);
Log.Info($"|JsonStorage.TryLoad|Deleting cached data at <{FilePath}>");
Log.Info($"Deleting cached data at <{FilePath}>", GetType());
}
}
@@ -84,7 +84,7 @@ namespace Wox.Infrastructure.Storage
catch (JsonException e)
{
LoadDefault();
Log.Exception($"|JsonStorage.Deserialize|Deserialize error for json <{FilePath}>", e);
Log.Exception($"Deserialize error for json <{FilePath}>", e, GetType());
}
if (_data == null)
@@ -123,11 +123,12 @@ namespace Wox.Infrastructure.Storage
string serialized = JsonConvert.SerializeObject(_data, Formatting.Indented);
File.WriteAllText(FilePath, serialized);
_storageHelper.Close();
Log.Info($"|JsonStorage.Save|Saving cached data at <{FilePath}>");
Log.Info($"Saving cached data at <{FilePath}>", GetType());
}
catch (IOException e)
{
Log.Error($"|JsonStorage.Save|Error in saving data at <{FilePath}>", e.Message);
Log.Exception($"Error in saving data at <{FilePath}>", e, GetType());
}
}
}