From 9da48106c893bf179a00db7dadbb74f513277263 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 29 Dec 2016 16:50:53 -0500 Subject: [PATCH] update logging --- .../Encoder/MediaEncoder.cs | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs index 89730a11fd..c26664921e 100644 --- a/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs +++ b/MediaBrowser.MediaEncoding/Encoder/MediaEncoder.cs @@ -533,8 +533,10 @@ namespace MediaBrowser.MediaEncoding.Encoder probeSize = probeSize + " " + analyzeDuration; probeSize = probeSize.Trim(); + var forceEnableLogging = request.Protocol != MediaProtocol.File; + return GetMediaInfoInternal(GetInputArgument(inputFiles, request.Protocol), request.InputPath, request.Protocol, extractChapters, - probeSize, request.MediaType == DlnaProfileType.Audio, request.VideoType, cancellationToken); + probeSize, request.MediaType == DlnaProfileType.Audio, request.VideoType, forceEnableLogging, cancellationToken); } /// @@ -577,14 +579,6 @@ namespace MediaBrowser.MediaEncoding.Encoder /// /// Gets the media info internal. /// - /// The input path. - /// The primary path. - /// The protocol. - /// if set to true [extract chapters]. - /// The probe size argument. - /// if set to true [is audio]. - /// Type of the video. - /// The cancellation token. /// Task{MediaInfoResult}. private async Task GetMediaInfoInternal(string inputPath, string primaryPath, @@ -593,6 +587,7 @@ namespace MediaBrowser.MediaEncoding.Encoder string probeSizeArgument, bool isAudio, VideoType videoType, + bool forceEnableLogging, CancellationToken cancellationToken) { var args = extractChapters @@ -614,7 +609,14 @@ namespace MediaBrowser.MediaEncoding.Encoder EnableRaisingEvents = true }); - _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); + if (forceEnableLogging) + { + _logger.Info("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); + } + else + { + _logger.Debug("{0} {1}", process.StartInfo.FileName, process.StartInfo.Arguments); + } using (var processWrapper = new ProcessWrapper(process, this, _logger)) {