mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-06-02 22:08:27 +01:00
add logging
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user