aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2018-12-30 17:29:02 -0500
committerGitHub <noreply@github.com>2018-12-30 17:29:02 -0500
commit1f02cf4b7e13c932bc30968cbb74b71885fd3eb7 (patch)
tree2fbf2e570340765abd40b5ad8e491f1f212699c0 /MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
parent7ad023143062c1995178e5700961b553822bd5af (diff)
parent4c95aee52eda793d1e013164cc0fde9eb609f894 (diff)
Merge pull request #285 from Bond-009/logging
Use Serilog to handle logging
Diffstat (limited to 'MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs')
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs19
1 files changed, 10 insertions, 9 deletions
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 0525c8cc4..5361e313c 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -21,6 +21,7 @@ using System.Threading.Tasks;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Services;
using MimeTypes = MediaBrowser.Model.Net.MimeTypes;
+using Microsoft.Extensions.Logging;
namespace MediaBrowser.Api.Playback.Hls
{
@@ -190,17 +191,17 @@ namespace MediaBrowser.Api.Playback.Hls
if (currentTranscodingIndex == null)
{
- Logger.Debug("Starting transcoding because currentTranscodingIndex=null");
+ Logger.LogDebug("Starting transcoding because currentTranscodingIndex=null");
startTranscoding = true;
}
else if (requestedIndex < currentTranscodingIndex.Value)
{
- Logger.Debug("Starting transcoding because requestedIndex={0} and currentTranscodingIndex={1}", requestedIndex, currentTranscodingIndex);
+ Logger.LogDebug("Starting transcoding because requestedIndex={0} and currentTranscodingIndex={1}", requestedIndex, currentTranscodingIndex);
startTranscoding = true;
}
else if (requestedIndex - currentTranscodingIndex.Value > segmentGapRequiringTranscodingChange)
{
- Logger.Debug("Starting transcoding because segmentGap is {0} and max allowed gap is {1}. requestedIndex={2}", requestedIndex - currentTranscodingIndex.Value, segmentGapRequiringTranscodingChange, requestedIndex);
+ Logger.LogDebug("Starting transcoding because segmentGap is {0} and max allowed gap is {1}. requestedIndex={2}", requestedIndex - currentTranscodingIndex.Value, segmentGapRequiringTranscodingChange, requestedIndex);
startTranscoding = true;
}
if (startTranscoding)
@@ -245,13 +246,13 @@ namespace MediaBrowser.Api.Playback.Hls
}
}
- //Logger.Info("waiting for {0}", segmentPath);
+ //Logger.LogInformation("waiting for {0}", segmentPath);
//while (!File.Exists(segmentPath))
//{
// await Task.Delay(50, cancellationToken).ConfigureAwait(false);
//}
- Logger.Info("returning {0}", segmentPath);
+ Logger.LogInformation("returning {0}", segmentPath);
job = job ?? ApiEntryPoint.Instance.OnTranscodeBeginRequest(playlistPath, TranscodingJobType);
return await GetSegmentResult(state, playlistPath, segmentPath, segmentExtension, requestedIndex, job, cancellationToken).ConfigureAwait(false);
}
@@ -358,7 +359,7 @@ namespace MediaBrowser.Api.Playback.Hls
return;
}
- Logger.Debug("Deleting partial HLS file {0}", path);
+ Logger.LogDebug("Deleting partial HLS file {path}", path);
try
{
@@ -366,7 +367,7 @@ namespace MediaBrowser.Api.Playback.Hls
}
catch (IOException ex)
{
- Logger.ErrorException("Error deleting partial stream file(s) {0}", ex, path);
+ Logger.LogError(ex, "Error deleting partial stream file(s) {path}", path);
var task = Task.Delay(100);
Task.WaitAll(task);
@@ -374,7 +375,7 @@ namespace MediaBrowser.Api.Playback.Hls
}
catch (Exception ex)
{
- Logger.ErrorException("Error deleting partial stream file(s) {0}", ex, path);
+ Logger.LogError(ex, "Error deleting partial stream file(s) {path}", path);
}
}
@@ -968,4 +969,4 @@ namespace MediaBrowser.Api.Playback.Hls
).Trim();
}
}
-} \ No newline at end of file
+}