add logging

This commit is contained in:
Luke Pulverenti
2016-06-30 19:17:49 -04:00
parent edfd04129e
commit 106087b685
9 changed files with 18 additions and 36 deletions

View File

@@ -123,6 +123,7 @@ namespace MediaBrowser.Common.Implementations.Configuration
/// </summary>
public void SaveConfiguration()
{
Logger.Info("Saving system configuration");
var path = CommonApplicationPaths.SystemConfigurationFilePath;
Directory.CreateDirectory(Path.GetDirectoryName(path));

View File

@@ -296,6 +296,8 @@ namespace MediaBrowser.Common.Implementations.HttpClientManager
private async Task<HttpResponseInfo> GetCachedResponse(string responseCachePath, TimeSpan cacheLength, string url)
{
_logger.Info("Checking for cache file {0}", responseCachePath);
try
{
if (_fileSystem.GetLastWriteTimeUtc(responseCachePath).Add(cacheLength) > DateTime.UtcNow)

View File

@@ -68,7 +68,7 @@ namespace MediaBrowser.Common.Implementations.Serialization
private Stream OpenFile(string path)
{
_logger.Debug("Deserializing file {0}", path);
_logger.Info("Deserializing file {0}", path);
return new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, 131072);
}

View File

@@ -80,6 +80,7 @@ namespace MediaBrowser.Common.Implementations.Serialization
/// <param name="file">The file.</param>
public void SerializeToFile(object obj, string file)
{
_logger.Info("Serializing to file {0}", file);
using (var stream = new FileStream(file, FileMode.Create))
{
SerializeToStream(obj, stream);
@@ -94,7 +95,7 @@ namespace MediaBrowser.Common.Implementations.Serialization
/// <returns>System.Object.</returns>
public object DeserializeFromFile(Type type, string file)
{
_logger.Debug("Deserializing file {0}", file);
_logger.Info("Deserializing file {0}", file);
using (var stream = _fileSystem.OpenRead(file))
{
return DeserializeFromStream(type, stream);

View File

@@ -193,6 +193,7 @@ namespace MediaBrowser.Common.Implementations.Updates
/// <returns>Task{List{PackageInfo}}.</returns>
public async Task<IEnumerable<PackageInfo>> GetAvailablePackagesWithoutRegistrationInfo(CancellationToken cancellationToken)
{
_logger.Info("Opening {0}", PackageCachePath);
try
{
using (var stream = _fileSystem.OpenRead(PackageCachePath))