From 2f3430387e440dfdb00652e43afaf16959dd2366 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 13 Mar 2014 13:12:42 -0700 Subject: [PATCH] Major logging overhaul --- src/NzbDrone.Common/ArchiveProvider.cs | 4 +- src/NzbDrone.Common/Disk/DiskProviderBase.cs | 4 +- src/NzbDrone.Common/HttpProvider.cs | 6 +-- .../Instrumentation/ExceptronTarget.cs | 2 +- .../Processes/ProcessProvider.cs | 8 ++-- .../DatabaseTargetFixture.cs | 3 +- .../Configuration/ConfigService.cs | 2 +- .../DataAugmentation/Xem/XemProxy.cs | 6 +-- .../DataAugmentation/Xem/XemService.cs | 10 ++-- .../Migration/Framework/MigrationLogger.cs | 2 +- .../DecisionEngine/DownloadDecisionMaker.cs | 2 +- .../QualityUpgradableSpecification.cs | 6 +-- .../AcceptableSizeSpecification.cs | 14 +++--- .../Specifications/BlacklistSpecification.cs | 4 +- .../Specifications/CutoffSpecification.cs | 4 +- .../Specifications/LanguageSpecification.cs | 4 +- .../Specifications/NotInQueueSpecification.cs | 2 +- .../NotRestrictedReleaseSpecification.cs | 8 ++-- .../Specifications/NotSampleSpecification.cs | 2 +- .../QualityAllowedByProfileSpecification.cs | 4 +- .../Specifications/RetentionSpecification.cs | 4 +- .../RssSync/HistorySpecification.cs | 10 ++-- .../RssSync/MonitoredEpisodeSpecification.cs | 2 +- .../RssSync/ProperSpecification.cs | 4 +- .../Search/DailyEpisodeMatchSpecification.cs | 2 +- .../Search/SeasonMatchSpecification.cs | 2 +- .../Search/SeriesSpecification.cs | 4 +- .../SingleEpisodeSearchMatchSpecification.cs | 4 +- .../UpgradeDiskSpecification.cs | 2 +- .../Download/Clients/Blackhole/Blackhole.cs | 4 +- .../Download/Clients/Nzbget/NzbgetProxy.cs | 2 +- .../Download/Clients/Pneumatic/Pneumatic.cs | 4 +- .../Download/Clients/Sabnzbd/SabnzbdProxy.cs | 3 +- src/NzbDrone.Core/Download/DownloadService.cs | 2 +- .../Download/FailedDownloadService.cs | 16 +++---- .../RedownloadFailedDownloadService.cs | 8 ++-- .../CleanupAdditionalNamingSpecs.cs | 2 +- .../Housekeepers/CleanupOrphanedBlacklist.cs | 2 +- .../CleanupOrphanedEpisodeFiles.cs | 2 +- .../Housekeepers/CleanupOrphanedEpisodes.cs | 2 +- .../CleanupOrphanedHistoryItems.cs | 2 +- .../CleanupOrphanedMetadataFiles.cs | 2 +- .../FixFutureRunScheduledTasks.cs | 4 +- .../Housekeepers/UpdateCleanTitleForSeries.cs | 2 +- .../IndexerSearch/EpisodeSearchService.cs | 2 +- .../IndexerSearch/NzbSearchService.cs | 2 +- .../IndexerSearch/SeasonSearchService.cs | 2 +- .../IndexerSearch/SeriesSearchService.cs | 2 +- .../Indexers/IndexerFetchService.cs | 3 +- src/NzbDrone.Core/Indexers/Newznab/Newznab.cs | 2 +- src/NzbDrone.Core/Indexers/RssParserBase.cs | 2 +- src/NzbDrone.Core/Indexers/RssSyncService.cs | 2 +- .../Extensions/LoggerCleansedExtensions.cs | 46 +++++++++++++++++++ .../LoggerProgressExtensions.cs} | 2 +- src/NzbDrone.Core/Jobs/TaskManager.cs | 2 +- .../Lifecycle/LifecycleService.cs | 4 +- .../MediaFiles/DiskScanService.cs | 6 +-- .../DownloadedEpisodesImportService.cs | 2 +- .../MediaFiles/EpisodeFileMovingService.cs | 12 ++--- .../EpisodeImport/ImportDecisionMaker.cs | 4 +- .../Specifications/FreeSpaceSpecification.cs | 4 +- .../Specifications/FullSeasonSpecification.cs | 2 +- .../Specifications/NotInUseSpecification.cs | 4 +- .../Specifications/NotSampleSpecification.cs | 18 ++++---- .../NotUnpackingSpecification.cs | 6 +-- .../Specifications/UpgradeSpecification.cs | 2 +- .../MediaFileTableCleanupService.cs | 8 ++-- .../MediaInfo/VideoFileInfoReader.cs | 2 +- .../MediaFiles/RecycleBinProvider.cs | 20 ++++---- .../MediaFiles/RenameEpisodeFileService.cs | 10 ++-- .../MediaFiles/UpdateEpisodeFileService.cs | 2 +- .../MediaFiles/UpgradeMediaFileService.cs | 2 +- .../Messaging/Commands/CommandExecutor.cs | 4 +- .../Messaging/Commands/TestCommandExecutor.cs | 2 +- .../Messaging/Events/EventAggregator.cs | 2 +- .../MetaData/Consumers/Xbmc/XbmcMetadata.cs | 8 ++-- .../MetaData/Files/CleanMetadataService.cs | 4 +- .../Metadata/ExistingMetadataService.cs | 6 +-- .../Metadata/Files/MetadataFileService.cs | 4 +- src/NzbDrone.Core/Metadata/MetadataBase.cs | 2 +- .../Notifications/Email/EmailService.cs | 2 +- .../Notifications/Growl/GrowlService.cs | 4 +- .../Notifications/Plex/PlexService.cs | 8 ++-- .../Notifications/Prowl/ProwlService.cs | 8 ++-- .../Notifications/Xbmc/HttpApiProvider.cs | 12 ++--- .../Notifications/Xbmc/JsonApiProvider.cs | 14 +++--- .../Notifications/Xbmc/XbmcService.cs | 6 +-- src/NzbDrone.Core/NzbDrone.Core.csproj | 3 +- src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs | 5 ++ src/NzbDrone.Core/Parser/Parser.cs | 21 ++++----- src/NzbDrone.Core/Parser/ParsingService.cs | 6 +-- src/NzbDrone.Core/Parser/QualityParser.cs | 2 +- src/NzbDrone.Core/Queue/QueueService.cs | 2 +- src/NzbDrone.Core/Rest/RestSharpExtensions.cs | 2 +- src/NzbDrone.Core/Tv/EpisodeService.cs | 2 +- src/NzbDrone.Core/Tv/RefreshSeriesService.cs | 4 +- src/NzbDrone.Core/Tv/SeriesService.cs | 4 +- .../Update/InstallUpdateService.cs | 2 +- .../Update/UpdateCheckService.cs | 2 +- .../AccessControl/FirewallAdapter.cs | 4 +- src/NzbDrone.Host/Router.cs | 8 ++-- src/NzbDrone.Mono/DiskProvider.cs | 6 +-- 102 files changed, 284 insertions(+), 238 deletions(-) create mode 100644 src/NzbDrone.Core/Instrumentation/Extensions/LoggerCleansedExtensions.cs rename src/NzbDrone.Core/Instrumentation/{LoggerExtensions.cs => Extensions/LoggerProgressExtensions.cs} (95%) diff --git a/src/NzbDrone.Common/ArchiveProvider.cs b/src/NzbDrone.Common/ArchiveProvider.cs index f15cc6899..5d7d644d5 100644 --- a/src/NzbDrone.Common/ArchiveProvider.cs +++ b/src/NzbDrone.Common/ArchiveProvider.cs @@ -25,7 +25,7 @@ public ArchiveService(Logger logger) public void Extract(string compressedFile, string destination) { - _logger.Trace("Extracting archive [{0}] to [{1}]", compressedFile, destination); + _logger.Debug("Extracting archive [{0}] to [{1}]", compressedFile, destination); if (OsInfo.IsWindows) { @@ -37,7 +37,7 @@ public void Extract(string compressedFile, string destination) ExtractTgz(compressedFile, destination); } - _logger.Trace("Extraction complete."); + _logger.Debug("Extraction complete."); } private void ExtractZip(string compressedFile, string destination) diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index 98c1c7924..bc15fc84f 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -201,7 +201,7 @@ private void TransferFolder(string source, string target, TransferAction transfe Ensure.That(source, () => source).IsValidPath(); Ensure.That(target, () => target).IsValidPath(); - Logger.Trace("{0} {1} -> {2}", transferAction, source, target); + Logger.Debug("{0} {1} -> {2}", transferAction, source, target); var sourceFolder = new DirectoryInfo(source); var targetFolder = new DirectoryInfo(target); @@ -220,7 +220,7 @@ private void TransferFolder(string source, string target, TransferAction transfe { var destFile = Path.Combine(target, sourceFile.Name); - Logger.Trace("{0} {1} -> {2}", transferAction, sourceFile, destFile); + Logger.Debug("{0} {1} -> {2}", transferAction, sourceFile, destFile); switch (transferAction) { diff --git a/src/NzbDrone.Common/HttpProvider.cs b/src/NzbDrone.Common/HttpProvider.cs index f60ee48fd..c64b081c6 100644 --- a/src/NzbDrone.Common/HttpProvider.cs +++ b/src/NzbDrone.Common/HttpProvider.cs @@ -102,14 +102,14 @@ public void DownloadFile(string url, string fileName) fileInfo.Directory.Create(); } - _logger.Trace("Downloading [{0}] to [{1}]", url, fileName); + _logger.Debug("Downloading [{0}] to [{1}]", url, fileName); var stopWatch = Stopwatch.StartNew(); var webClient = new WebClient(); webClient.Headers.Add(HttpRequestHeader.UserAgent, _userAgent); webClient.DownloadFile(url, fileName); stopWatch.Stop(); - _logger.Trace("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds); + _logger.Debug("Downloading Completed. took {0:0}s", stopWatch.Elapsed.Seconds); } catch (WebException e) { @@ -127,7 +127,7 @@ public string PostCommand(string address, string username, string password, stri { address = String.Format("http://{0}/jsonrpc", address); - _logger.Trace("Posting command: {0}, to {1}", command, address); + _logger.Debug("Posting command: {0}, to {1}", command, address); byte[] byteArray = Encoding.ASCII.GetBytes(command); diff --git a/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs b/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs index f824a5ac4..b45b76a00 100644 --- a/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs @@ -48,7 +48,7 @@ protected override void Write(LogEventInfo logEvent) { if (logEvent == null || logEvent.Exception == null) return; - InternalLogger.Trace("Sending Exception to api.exceptron.com. Process Name: {0}", Process.GetCurrentProcess().ProcessName); + InternalLogger.Debug("Sending Exception to api.exceptron.com. Process Name: {0}", Process.GetCurrentProcess().ProcessName); try { diff --git a/src/NzbDrone.Common/Processes/ProcessProvider.cs b/src/NzbDrone.Common/Processes/ProcessProvider.cs index d1c4774e5..f0ac02148 100644 --- a/src/NzbDrone.Common/Processes/ProcessProvider.cs +++ b/src/NzbDrone.Common/Processes/ProcessProvider.cs @@ -60,7 +60,7 @@ public ProcessPriorityClass GetCurrentProcessPriority() public ProcessInfo GetProcessById(int id) { - Logger.Trace("Finding process with Id:{0}", id); + Logger.Debug("Finding process with Id:{0}", id); var processInfo = ConvertToProcessInfo(Process.GetProcesses().FirstOrDefault(p => p.Id == id)); @@ -70,7 +70,7 @@ public ProcessInfo GetProcessById(int id) } else { - Logger.Trace("Found process {0}", processInfo.ToString()); + Logger.Debug("Found process {0}", processInfo.ToString()); } return processInfo; @@ -186,7 +186,7 @@ public ProcessOutput StartAndCapture(string path, string args = null) public void WaitForExit(Process process) { - Logger.Trace("Waiting for process {0} to exit.", process.ProcessName); + Logger.Debug("Waiting for process {0} to exit.", process.ProcessName); process.WaitForExit(); } @@ -268,7 +268,7 @@ public void Kill(int processId) if (process.HasExited) { - Logger.Trace("Process has already exited"); + Logger.Debug("Process has already exited"); return; } diff --git a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs index bb49dbfd3..6d26f4836 100644 --- a/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs +++ b/src/NzbDrone.Core.Test/InstrumentationTests/DatabaseTargetFixture.cs @@ -4,7 +4,6 @@ using NLog; using NUnit.Framework; using NzbDrone.Common.Instrumentation; -using NzbDrone.Core.Datastore; using NzbDrone.Core.Datastore.Migration.Framework; using NzbDrone.Core.MediaFiles; using NzbDrone.Core.Instrumentation; @@ -103,7 +102,7 @@ public void exception_log_with_no_message_should_use_exceptions_message() public void null_string_as_arg_should_not_fail() { var epFile = new EpisodeFile(); - _logger.Trace("File {0} no longer exists on disk. removing from database.", epFile.Path); + _logger.Debug("File {0} no longer exists on disk. removing from database.", epFile.Path); epFile.Path.Should().BeNull(); } diff --git a/src/NzbDrone.Core/Configuration/ConfigService.cs b/src/NzbDrone.Core/Configuration/ConfigService.cs index 2e6d62858..465b422b6 100644 --- a/src/NzbDrone.Core/Configuration/ConfigService.cs +++ b/src/NzbDrone.Core/Configuration/ConfigService.cs @@ -247,7 +247,7 @@ public void SetValue(string key, string value) { key = key.ToLowerInvariant(); - _logger.Trace("Writing Setting to file. Key:'{0}' Value:'{1}'", key, value); + _logger.Trace("Writing Setting to database. Key:'{0}' Value:'{1}'", key, value); var dbValue = _repository.Get(key); diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs index f3c381b7b..80b1f58e2 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemProxy.cs @@ -38,7 +38,7 @@ private static RestRequest BuildRequest(string resource) public List GetXemSeriesIds() { - _logger.Trace("Fetching Series IDs from"); + _logger.Debug("Fetching Series IDs from"); var restClient = new RestClient(XEM_BASE_URL); @@ -52,9 +52,7 @@ public List GetXemSeriesIds() public List GetSceneTvdbMappings(int id) { - _logger.Trace("Fetching Mappings for: {0}", id); - var url = String.Format("{0}all?id={1}&origin=tvdb", XEM_BASE_URL, id); - + _logger.Debug("Fetching Mappings for: {0}", id); var restClient = new RestClient(XEM_BASE_URL); diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs index fc0146c7b..682129d77 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs @@ -30,7 +30,7 @@ public XemService(IEpisodeService episodeService, private void PerformUpdate(Series series) { - _logger.Trace("Updating scene numbering mapping for: {0}", series); + _logger.Debug("Updating scene numbering mapping for: {0}", series); try { @@ -38,7 +38,7 @@ private void PerformUpdate(Series series) if (!mappings.Any()) { - _logger.Trace("Mappings for: {0} are empty, skipping", series); + _logger.Debug("Mappings for: {0} are empty, skipping", series); _cache.Remove(series.TvdbId.ToString()); return; } @@ -54,13 +54,13 @@ private void PerformUpdate(Series series) foreach (var mapping in mappings) { - _logger.Trace("Setting scene numbering mappings for {0} S{1:00}E{2:00}", series, mapping.Tvdb.Season, mapping.Tvdb.Episode); + _logger.Debug("Setting scene numbering mappings for {0} S{1:00}E{2:00}", series, mapping.Tvdb.Season, mapping.Tvdb.Episode); var episode = episodes.SingleOrDefault(e => e.SeasonNumber == mapping.Tvdb.Season && e.EpisodeNumber == mapping.Tvdb.Episode); if (episode == null) { - _logger.Trace("Information hasn't been added to TheTVDB yet, skipping."); + _logger.Debug("Information hasn't been added to TheTVDB yet, skipping."); continue; } @@ -105,7 +105,7 @@ public void Handle(SeriesUpdatedEvent message) if (!_cache.Find(message.Series.TvdbId.ToString())) { - _logger.Trace("Scene numbering is not available for {0} [{1}]", message.Series.Title, message.Series.TvdbId); + _logger.Debug("Scene numbering is not available for {0} [{1}]", message.Series.Title, message.Series.TvdbId); return; } diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs index cab90b90c..1d924ab08 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs @@ -32,7 +32,7 @@ public void Emphasize(string message) public void Sql(string sql) { - _logger.Trace(sql); + _logger.Debug(sql); } public void ElapsedTime(TimeSpan timeSpan) diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index bae6f3d60..0963760ce 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -4,7 +4,7 @@ using NLog; using NzbDrone.Core.DecisionEngine.Specifications; using NzbDrone.Core.IndexerSearch.Definitions; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; using NzbDrone.Common.Serializer; diff --git a/src/NzbDrone.Core/DecisionEngine/QualityUpgradableSpecification.cs b/src/NzbDrone.Core/DecisionEngine/QualityUpgradableSpecification.cs index aae2a6d6b..a37f65ef3 100644 --- a/src/NzbDrone.Core/DecisionEngine/QualityUpgradableSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/QualityUpgradableSpecification.cs @@ -26,7 +26,7 @@ public bool IsUpgradable(QualityProfile profile, QualityModel currentQuality, Qu int compare = new QualityModelComparer(profile).Compare(newQuality, currentQuality); if (compare <= 0) { - _logger.Trace("existing item has better or equal quality. skipping"); + _logger.Debug("existing item has better or equal quality. skipping"); return false; } @@ -50,7 +50,7 @@ public bool CutoffNotMet(QualityProfile profile, QualityModel currentQuality, Qu return true; } - _logger.Trace("Existing item meets cut-off. skipping."); + _logger.Debug("Existing item meets cut-off. skipping."); return false; } @@ -63,7 +63,7 @@ public bool IsProperUpgrade(QualityModel currentQuality, QualityModel newQuality if (currentQuality.Quality == newQuality.Quality && compare > 0) { - _logger.Trace("New quality is a proper for existing quality"); + _logger.Debug("New quality is a proper for existing quality"); return true; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs index 8cd175703..5073ca546 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/AcceptableSizeSpecification.cs @@ -27,19 +27,19 @@ public string RejectionReason public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { - _logger.Trace("Beginning size check for: {0}", subject); + _logger.Debug("Beginning size check for: {0}", subject); var quality = subject.ParsedEpisodeInfo.Quality.Quality; if (quality == Quality.RAWHD) { - _logger.Trace("Raw-HD release found, skipping size check."); + _logger.Debug("Raw-HD release found, skipping size check."); return true; } if (quality == Quality.Unknown) { - _logger.Trace("Unknown quality. skipping size check."); + _logger.Debug("Unknown quality. skipping size check."); return false; } @@ -52,12 +52,12 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear //If the parsed size is smaller than minSize we don't want it if (subject.Release.Size < minSize) { - _logger.Trace("Item: {0}, Size: {1} is smaller than minimum allowed size ({2}), rejecting.", subject, subject.Release.Size, minSize); + _logger.Debug("Item: {0}, Size: {1} is smaller than minimum allowed size ({2}), rejecting.", subject, subject.Release.Size, minSize); return false; } if (qualityDefinition.MaxSize == 0) { - _logger.Trace("Max size is 0 (unlimited) - skipping check."); + _logger.Debug("Max size is 0 (unlimited) - skipping check."); } else { @@ -75,11 +75,11 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear //If the parsed size is greater than maxSize we don't want it if (subject.Release.Size > maxSize) { - _logger.Trace("Item: {0}, Size: {1} is greater than maximum allowed size ({2}), rejecting.", subject, subject.Release.Size, maxSize); + _logger.Debug("Item: {0}, Size: {1} is greater than maximum allowed size ({2}), rejecting.", subject, subject.Release.Size, maxSize); return false; } } - _logger.Trace("Item: {0}, meets size constraints.", subject); + _logger.Debug("Item: {0}, meets size constraints.", subject); return true; } } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs index 0b7e5166c..8d00b0d3b 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/BlacklistSpecification.cs @@ -31,13 +31,13 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { if (!_configService.EnableFailedDownloadHandling) { - _logger.Trace("Failed Download Handling is not enabled"); + _logger.Debug("Failed Download Handling is not enabled"); return true; } if (_blacklistService.Blacklisted(subject.Series.Id, subject.Release.Title)) { - _logger.Trace("{0} is blacklisted, rejecting.", subject.Release.Title); + _logger.Debug("{0} is blacklisted, rejecting.", subject.Release.Title); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs index e087c6ef3..7ede1ed8d 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/CutoffSpecification.cs @@ -28,12 +28,12 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { foreach (var file in subject.Episodes.Where(c => c.EpisodeFileId != 0).Select(c => c.EpisodeFile.Value)) { - _logger.Trace("Comparing file quality with report. Existing file is {0}", file.Quality); + _logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality); if (!_qualityUpgradableSpecification.CutoffNotMet(subject.Series.QualityProfile, file.Quality, subject.ParsedEpisodeInfo.Quality)) { - _logger.Trace("Cutoff already met, rejecting."); + _logger.Debug("Cutoff already met, rejecting."); return false; } } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs index 1ed27c14d..1ec1eb76d 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/LanguageSpecification.cs @@ -24,10 +24,10 @@ public string RejectionReason public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { - _logger.Trace("Checking if report meets language requirements. {0}", subject.ParsedEpisodeInfo.Language); + _logger.Debug("Checking if report meets language requirements. {0}", subject.ParsedEpisodeInfo.Language); if (subject.ParsedEpisodeInfo.Language != Language.English) { - _logger.Trace("Report Language: {0} rejected because it is not English", subject.ParsedEpisodeInfo.Language); + _logger.Debug("Report Language: {0} rejected because it is not English", subject.ParsedEpisodeInfo.Language); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs index 7e4f34551..4fe2010de 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/NotInQueueSpecification.cs @@ -41,7 +41,7 @@ public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriter if (IsInQueue(subject, queue)) { - _logger.Trace("Already in queue, rejecting."); + _logger.Debug("Already in queue, rejecting."); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs index 7ba369944..7a9e9f65c 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/NotRestrictedReleaseSpecification.cs @@ -27,13 +27,13 @@ public string RejectionReason public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { - _logger.Trace("Checking if release contains any restricted terms: {0}", subject); + _logger.Debug("Checking if release contains any restricted terms: {0}", subject); var restrictionsString = _configService.ReleaseRestrictions; if (String.IsNullOrWhiteSpace(restrictionsString)) { - _logger.Trace("No restrictions configured, allowing: {0}", subject); + _logger.Debug("No restrictions configured, allowing: {0}", subject); return true; } @@ -43,12 +43,12 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { if (subject.Release.Title.ToLowerInvariant().Contains(restriction.ToLowerInvariant())) { - _logger.Trace("{0} is restricted: {1}", subject, restriction); + _logger.Debug("{0} is restricted: {1}", subject, restriction); return false; } } - _logger.Trace("No restrictions apply, allowing: {0}", subject); + _logger.Debug("No restrictions apply, allowing: {0}", subject); return true; } } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs index 5d6a2da77..c5e193012 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/NotSampleSpecification.cs @@ -18,7 +18,7 @@ public bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriter { if (subject.Release.Title.ToLower().Contains("sample") && subject.Release.Size < 70.Megabytes()) { - _logger.Trace("Sample release, rejecting."); + _logger.Debug("Sample release, rejecting."); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs index b4bcc1f83..758d9b2d6 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/QualityAllowedByProfileSpecification.cs @@ -23,10 +23,10 @@ public string RejectionReason public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase searchCriteria) { - _logger.Trace("Checking if report meets quality requirements. {0}", subject.ParsedEpisodeInfo.Quality); + _logger.Debug("Checking if report meets quality requirements. {0}", subject.ParsedEpisodeInfo.Quality); if (!subject.Series.QualityProfile.Value.Items.Exists(v => v.Allowed && v.Quality == subject.ParsedEpisodeInfo.Quality.Quality)) { - _logger.Trace("Quality {0} rejected by Series' quality profile", subject.ParsedEpisodeInfo.Quality); + _logger.Debug("Quality {0} rejected by Series' quality profile", subject.ParsedEpisodeInfo.Quality); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs index c74289e55..614794b92 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RetentionSpecification.cs @@ -30,10 +30,10 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear var age = subject.Release.Age; var retention = _configService.Retention; - _logger.Trace("Checking if report meets retention requirements. {0}", age); + _logger.Debug("Checking if report meets retention requirements. {0}", age); if (retention > 0 && age > retention) { - _logger.Trace("Report age: {0} rejected by user's retention limit", age); + _logger.Debug("Report age: {0} rejected by user's retention limit", age); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs index 17225a717..0132f4adf 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/HistorySpecification.cs @@ -37,7 +37,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { if (searchCriteria != null) { - _logger.Trace("Skipping history check during search"); + _logger.Debug("Skipping history check during search"); return true; } @@ -45,15 +45,15 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear if (downloadClient != null && downloadClient.GetType() == typeof (Sabnzbd)) { - _logger.Trace("Performing history status check on report"); + _logger.Debug("Performing history status check on report"); foreach (var episode in subject.Episodes) { - _logger.Trace("Checking current status of episode [{0}] in history", episode.Id); + _logger.Debug("Checking current status of episode [{0}] in history", episode.Id); var mostRecent = _historyService.MostRecentForEpisode(episode.Id); if (mostRecent != null && mostRecent.EventType == HistoryEventType.Grabbed) { - _logger.Trace("Latest history item is downloading, rejecting."); + _logger.Debug("Latest history item is downloading, rejecting."); return false; } } @@ -65,7 +65,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear var bestQualityInHistory = _historyService.GetBestQualityInHistory(subject.Series.QualityProfile, episode.Id); if (bestQualityInHistory != null) { - _logger.Trace("Comparing history quality with report. History is {0}", bestQualityInHistory); + _logger.Debug("Comparing history quality with report. History is {0}", bestQualityInHistory); if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, bestQualityInHistory, subject.ParsedEpisodeInfo.Quality)) return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs index 2bd097e32..a0709622f 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/MonitoredEpisodeSpecification.cs @@ -26,7 +26,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { if (searchCriteria != null) { - _logger.Trace("Skipping monitored check during search"); + _logger.Debug("Skipping monitored check during search"); return true; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs index 6d099eeba..0346ab28a 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/RssSync/ProperSpecification.cs @@ -41,13 +41,13 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { if (file.DateAdded < DateTime.Today.AddDays(-7)) { - _logger.Trace("Proper for old file, rejecting: {0}", subject); + _logger.Debug("Proper for old file, rejecting: {0}", subject); return false; } if (!_configService.AutoDownloadPropers) { - _logger.Trace("Auto downloading of propers is disabled"); + _logger.Debug("Auto downloading of propers is disabled"); return false; } } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs index cee1ae288..6698d49dd 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/DailyEpisodeMatchSpecification.cs @@ -38,7 +38,7 @@ public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase search if (!remoteEpisode.ParsedEpisodeInfo.IsDaily() || remoteEpisode.ParsedEpisodeInfo.AirDate != episode.AirDate) { - _logger.Trace("Episode AirDate does not match searched episode number, skipping."); + _logger.Debug("Episode AirDate does not match searched episode number, skipping."); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs index 7a42601e5..211870221 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeasonMatchSpecification.cs @@ -33,7 +33,7 @@ public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase search if (singleEpisodeSpec.SeasonNumber != remoteEpisode.ParsedEpisodeInfo.SeasonNumber) { - _logger.Trace("Season number does not match searched season number, skipping."); + _logger.Debug("Season number does not match searched season number, skipping."); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs index 8a30288d2..6e6f146f8 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SeriesSpecification.cs @@ -28,11 +28,11 @@ public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase search return true; } - _logger.Trace("Checking if series matches searched series"); + _logger.Debug("Checking if series matches searched series"); if (remoteEpisode.Series.Id != searchCriteria.Series.Id) { - _logger.Trace("Series {0} does not match {1}", remoteEpisode.Series, searchCriteria.Series); + _logger.Debug("Series {0} does not match {1}", remoteEpisode.Series, searchCriteria.Series); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs index 7a8deeec9..3960a4e4d 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/Search/SingleEpisodeSearchMatchSpecification.cs @@ -34,13 +34,13 @@ public bool IsSatisfiedBy(RemoteEpisode remoteEpisode, SearchCriteriaBase search if (singleEpisodeSpec.SeasonNumber != remoteEpisode.ParsedEpisodeInfo.SeasonNumber) { - _logger.Trace("Season number does not match searched season number, skipping."); + _logger.Debug("Season number does not match searched season number, skipping."); return false; } if (!remoteEpisode.ParsedEpisodeInfo.EpisodeNumbers.Contains(singleEpisodeSpec.EpisodeNumber)) { - _logger.Trace("Episode number does not match searched episode number, skipping."); + _logger.Debug("Episode number does not match searched episode number, skipping."); return false; } diff --git a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs index 8d2c5f631..833f4b9a5 100644 --- a/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs +++ b/src/NzbDrone.Core/DecisionEngine/Specifications/UpgradeDiskSpecification.cs @@ -28,7 +28,7 @@ public virtual bool IsSatisfiedBy(RemoteEpisode subject, SearchCriteriaBase sear { foreach (var file in subject.Episodes.Where(c => c.EpisodeFileId != 0).Select(c => c.EpisodeFile.Value)) { - _logger.Trace("Comparing file quality with report. Existing file is {0}", file.Quality); + _logger.Debug("Comparing file quality with report. Existing file is {0}", file.Quality); if (!_qualityUpgradableSpecification.IsUpgradable(subject.Series.QualityProfile, file.Quality, subject.ParsedEpisodeInfo.Quality)) { diff --git a/src/NzbDrone.Core/Download/Clients/Blackhole/Blackhole.cs b/src/NzbDrone.Core/Download/Clients/Blackhole/Blackhole.cs index c183378fc..d04007166 100644 --- a/src/NzbDrone.Core/Download/Clients/Blackhole/Blackhole.cs +++ b/src/NzbDrone.Core/Download/Clients/Blackhole/Blackhole.cs @@ -33,9 +33,9 @@ public override string DownloadNzb(RemoteEpisode remoteEpisode) var filename = Path.Combine(Settings.Folder, title + ".nzb"); - _logger.Trace("Downloading NZB from: {0} to: {1}", url, filename); + _logger.Debug("Downloading NZB from: {0} to: {1}", url, filename); _httpProvider.DownloadFile(url, filename); - _logger.Trace("NZB Download succeeded, saved to: {0}", filename); + _logger.Debug("NZB Download succeeded, saved to: {0}", filename); return null; } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs index e6d1bf54a..678a63a56 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/NzbgetProxy.cs @@ -48,7 +48,7 @@ private string ProcessRequest(IRestRequest restRequest, NzbgetSettings settings) { var client = BuildClient(settings); var response = client.Execute(restRequest); - _logger.Trace("Response: {0}", response.Content); + _logger.Debug("Response: {0}", response.Content); CheckForError(response); diff --git a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs index 2e93023bc..7b521d748 100644 --- a/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs +++ b/src/NzbDrone.Core/Download/Clients/Pneumatic/Pneumatic.cs @@ -43,10 +43,10 @@ public override string DownloadNzb(RemoteEpisode remoteEpisode) //Save to the Pneumatic directory (The user will need to ensure its accessible by XBMC) var filename = Path.Combine(Settings.Folder, title + ".nzb"); - logger.Trace("Downloading NZB from: {0} to: {1}", url, filename); + logger.Debug("Downloading NZB from: {0} to: {1}", url, filename); _httpProvider.DownloadFile(url, filename); - logger.Trace("NZB Download succeeded, saved to: {0}", filename); + logger.Debug("NZB Download succeeded, saved to: {0}", filename); var contents = String.Format("plugin://plugin.program.pneumatic/?mode=strm&type=add_file&nzb={0}&nzbname={1}", filename, title); _diskProvider.WriteAllText(Path.Combine(_configService.DownloadedEpisodesFolder, title + ".strm"), contents); diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs index c5ca48167..e3b987e4c 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabnzbdProxy.cs @@ -5,6 +5,7 @@ using NzbDrone.Common; using NzbDrone.Common.Serializer; using NzbDrone.Core.Download.Clients.Sabnzbd.Responses; +using NzbDrone.Core.Instrumentation.Extensions; using RestSharp; namespace NzbDrone.Core.Download.Clients.Sabnzbd @@ -124,7 +125,7 @@ private IRestClient BuildClient(string action, SabnzbdSettings settings) action, authentication); - _logger.Trace(url); + _logger.CleansedDebug(url); return new RestClient(url); } diff --git a/src/NzbDrone.Core/Download/DownloadService.cs b/src/NzbDrone.Core/Download/DownloadService.cs index 71e633d47..b8598cec1 100644 --- a/src/NzbDrone.Core/Download/DownloadService.cs +++ b/src/NzbDrone.Core/Download/DownloadService.cs @@ -1,7 +1,7 @@ using System; using NLog; using NzbDrone.Common.EnsureThat; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Parser.Model; diff --git a/src/NzbDrone.Core/Download/FailedDownloadService.cs b/src/NzbDrone.Core/Download/FailedDownloadService.cs index f5438dea5..c432eafeb 100644 --- a/src/NzbDrone.Core/Download/FailedDownloadService.cs +++ b/src/NzbDrone.Core/Download/FailedDownloadService.cs @@ -58,7 +58,7 @@ private void CheckQueue(List grabbedHistory, List grabbedHistory, List failedLocal.Id.Equals(h.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID)))) { - _logger.Trace("Already added to history as failed"); + _logger.Debug("Already added to history as failed"); continue; } @@ -103,7 +103,7 @@ private void CheckHistory(List grabbedHistory, List grabbedHistory, List failedLocal.Id.Equals(h.Data.GetValueOrDefault(DOWNLOAD_CLIENT_ID)))) { - _logger.Trace("Already added to history as failed"); + _logger.Debug("Already added to history as failed"); continue; } @@ -164,7 +164,7 @@ private IDownloadClient GetDownloadClient() if (downloadClient == null) { - _logger.Trace("No download client is configured"); + _logger.Debug("No download client is configured"); } return downloadClient; @@ -174,7 +174,7 @@ public void Execute(CheckForFailedDownloadCommand message) { if (!_configService.EnableFailedDownloadHandling) { - _logger.Trace("Failed Download Handling is not enabled"); + _logger.Debug("Failed Download Handling is not enabled"); return; } diff --git a/src/NzbDrone.Core/Download/RedownloadFailedDownloadService.cs b/src/NzbDrone.Core/Download/RedownloadFailedDownloadService.cs index 0182f7b26..b6e0c0de9 100644 --- a/src/NzbDrone.Core/Download/RedownloadFailedDownloadService.cs +++ b/src/NzbDrone.Core/Download/RedownloadFailedDownloadService.cs @@ -32,13 +32,13 @@ public void Redownload(int seriesId, List episodeIds) { if (!_configService.AutoRedownloadFailed) { - _logger.Trace("Auto redownloading failed episodes is disabled"); + _logger.Debug("Auto redownloading failed episodes is disabled"); return; } if (episodeIds.Count == 1) { - _logger.Trace("Failed download only contains one episode, searching again"); + _logger.Debug("Failed download only contains one episode, searching again"); _commandExecutor.PublishCommandAsync(new EpisodeSearchCommand { @@ -53,7 +53,7 @@ public void Redownload(int seriesId, List episodeIds) if (episodeIds.Count == episodesInSeason.Count) { - _logger.Trace("Failed download was entire season, searching again"); + _logger.Debug("Failed download was entire season, searching again"); _commandExecutor.PublishCommandAsync(new SeasonSearchCommand { @@ -64,7 +64,7 @@ public void Redownload(int seriesId, List episodeIds) return; } - _logger.Trace("Failed download contains multiple episodes, probably a double episode, searching again"); + _logger.Debug("Failed download contains multiple episodes, probably a double episode, searching again"); _commandExecutor.PublishCommandAsync(new EpisodeSearchCommand { diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs index ece5ce6c7..f11d30ef8 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs @@ -16,7 +16,7 @@ public CleanupAdditionalNamingSpecs(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running naming spec cleanup"); + _logger.Debug("Running naming spec cleanup"); var mapper = _database.GetDataMapper(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs index 3ccb0c181..83c3e3d82 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedBlacklist.cs @@ -16,7 +16,7 @@ public CleanupOrphanedBlacklist(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running orphaned blacklist cleanup"); + _logger.Debug("Running orphaned blacklist cleanup"); var mapper = _database.GetDataMapper(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFiles.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFiles.cs index c11da71f1..3a6b661f5 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFiles.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodeFiles.cs @@ -16,7 +16,7 @@ public CleanupOrphanedEpisodeFiles(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running orphaned episode files cleanup"); + _logger.Debug("Running orphaned episode files cleanup"); var mapper = _database.GetDataMapper(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs index a75a69ded..2c2792f04 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs @@ -16,7 +16,7 @@ public CleanupOrphanedEpisodes(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running orphaned episodes cleanup"); + _logger.Debug("Running orphaned episodes cleanup"); var mapper = _database.GetDataMapper(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs index f715665fb..0b8e9d374 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs @@ -16,7 +16,7 @@ public CleanupOrphanedHistoryItems(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running orphaned history cleanup"); + _logger.Debug("Running orphaned history cleanup"); CleanupOrphanedBySeries(); CleanupOrphanedByEpisode(); } diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedMetadataFiles.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedMetadataFiles.cs index a54497e30..88ee87ad3 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedMetadataFiles.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedMetadataFiles.cs @@ -16,7 +16,7 @@ public CleanupOrphanedMetadataFiles(IDatabase database, Logger logger) public void Clean() { - _logger.Trace("Running orphaned episode files cleanup"); + _logger.Debug("Running orphaned episode files cleanup"); DeleteOrphanedBySeries(); DeleteOrphanedByEpisodeFile(); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/FixFutureRunScheduledTasks.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/FixFutureRunScheduledTasks.cs index a75bebfdf..40c99aabd 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/FixFutureRunScheduledTasks.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/FixFutureRunScheduledTasks.cs @@ -21,10 +21,10 @@ public void Clean() { if (BuildInfo.IsDebug) { - _logger.Trace("Not running scheduled task last execution cleanup during debug"); + _logger.Debug("Not running scheduled task last execution cleanup during debug"); } - _logger.Trace("Running scheduled task last execution cleanup"); + _logger.Debug("Running scheduled task last execution cleanup"); var mapper = _database.GetDataMapper(); mapper.AddParameter("time", DateTime.UtcNow); diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs index b01e24ab2..4242b56ac 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/UpdateCleanTitleForSeries.cs @@ -18,7 +18,7 @@ public UpdateCleanTitleForSeries(ISeriesRepository seriesRepository, Logger logg public void Clean() { - _logger.Trace("Updating CleanTitle for all series"); + _logger.Debug("Updating CleanTitle for all series"); var series = _seriesRepository.All().ToList(); diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs index f365b1fd5..9aec6bbc3 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs @@ -1,6 +1,6 @@ using NLog; using NzbDrone.Core.Download; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; namespace NzbDrone.Core.IndexerSearch diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index 006f2b9a8..9af07cf51 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -8,7 +8,7 @@ using NzbDrone.Core.DecisionEngine.Specifications; using NzbDrone.Core.IndexerSearch.Definitions; using NzbDrone.Core.Indexers; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Parser.Model; using NzbDrone.Core.Tv; using System.Linq; diff --git a/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs b/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs index 13b384856..4c164ceef 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeasonSearchService.cs @@ -1,6 +1,6 @@ using NLog; using NzbDrone.Core.Download; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; namespace NzbDrone.Core.IndexerSearch diff --git a/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs b/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs index 149440b91..9eca04157 100644 --- a/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/SeriesSearchService.cs @@ -1,6 +1,6 @@ using NLog; using NzbDrone.Core.Download; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Tv; diff --git a/src/NzbDrone.Core/Indexers/IndexerFetchService.cs b/src/NzbDrone.Core/Indexers/IndexerFetchService.cs index 67da61c5d..4bbca036f 100644 --- a/src/NzbDrone.Core/Indexers/IndexerFetchService.cs +++ b/src/NzbDrone.Core/Indexers/IndexerFetchService.cs @@ -5,6 +5,7 @@ using NzbDrone.Common; using NzbDrone.Core.Indexers.Exceptions; using NzbDrone.Core.IndexerSearch.Definitions; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Parser.Model; using System.Linq; @@ -115,7 +116,7 @@ private List Fetch(IIndexer indexer, IEnumerable urls) { try { - _logger.Trace("Downloading Feed " + url); + _logger.CleansedDebug("Downloading Feed " + url); var xml = _httpProvider.DownloadString(url); if (!string.IsNullOrWhiteSpace(xml)) { diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index 7e6f8caad..cb89009b9 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -35,7 +35,7 @@ public override IEnumerable DefaultDefinitions Enable = false, Name = "Nzb.su", Implementation = GetType().Name, - Settings = GetSettings("https://nzb.su", new List()) + Settings = GetSettings("https://api.nzb.su", new List()) }); list.Add(new IndexerDefinition diff --git a/src/NzbDrone.Core/Indexers/RssParserBase.cs b/src/NzbDrone.Core/Indexers/RssParserBase.cs index 29ad27ee2..0988c4f97 100644 --- a/src/NzbDrone.Core/Indexers/RssParserBase.cs +++ b/src/NzbDrone.Core/Indexers/RssParserBase.cs @@ -82,7 +82,7 @@ private ReleaseInfo ParseFeedItem(XElement item, string url) throw new SizeParsingException("Unable to parse size from: {0} [{1}]", reportInfo.Title, url); } - _logger.Trace("Parsed: {0} from: {1}", reportInfo, item.Title()); + _logger.Trace("Parsed: {0}", item.Title()); return PostProcessor(item, reportInfo); } diff --git a/src/NzbDrone.Core/Indexers/RssSyncService.cs b/src/NzbDrone.Core/Indexers/RssSyncService.cs index 8435a1549..8958d8e76 100644 --- a/src/NzbDrone.Core/Indexers/RssSyncService.cs +++ b/src/NzbDrone.Core/Indexers/RssSyncService.cs @@ -2,7 +2,7 @@ using NLog; using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Download; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; namespace NzbDrone.Core.Indexers diff --git a/src/NzbDrone.Core/Instrumentation/Extensions/LoggerCleansedExtensions.cs b/src/NzbDrone.Core/Instrumentation/Extensions/LoggerCleansedExtensions.cs new file mode 100644 index 000000000..3d0ee33f3 --- /dev/null +++ b/src/NzbDrone.Core/Instrumentation/Extensions/LoggerCleansedExtensions.cs @@ -0,0 +1,46 @@ +using System; +using System.Text.RegularExpressions; +using NLog; + +namespace NzbDrone.Core.Instrumentation.Extensions +{ + public static class LoggerCleansedExtensions + { + private static readonly Regex CleansingRegex = new Regex(@"(?<=apikey=)(\w+?)(?=\W|$|_)", RegexOptions.Compiled | RegexOptions.IgnoreCase); + + public static void CleansedInfo(this Logger logger, string message, params object[] args) + { + var formattedMessage = String.Format(message, args); + LogCleansedMessage(logger, LogLevel.Info, formattedMessage); + } + + public static void CleansedDebug(this Logger logger, string message, params object[] args) + { + var formattedMessage = String.Format(message, args); + LogCleansedMessage(logger, LogLevel.Debug, formattedMessage); + } + + public static void CleansedTrace(this Logger logger, string message, params object[] args) + { + var formattedMessage = String.Format(message, args); + LogCleansedMessage(logger, LogLevel.Trace, formattedMessage); + } + + private static void LogCleansedMessage(Logger logger, LogLevel level, string message) + { + message = Cleanse(message); + + var logEvent = new LogEventInfo(level, logger.Name, message); + logEvent.Properties.Add("Status", ""); + + logger.Log(logEvent); + } + + private static string Cleanse(string message) + { + //TODO: password= + + return CleansingRegex.Replace(message, ""); + } + } +} diff --git a/src/NzbDrone.Core/Instrumentation/LoggerExtensions.cs b/src/NzbDrone.Core/Instrumentation/Extensions/LoggerProgressExtensions.cs similarity index 95% rename from src/NzbDrone.Core/Instrumentation/LoggerExtensions.cs rename to src/NzbDrone.Core/Instrumentation/Extensions/LoggerProgressExtensions.cs index 82ece28d2..6aeb5ecf7 100644 --- a/src/NzbDrone.Core/Instrumentation/LoggerExtensions.cs +++ b/src/NzbDrone.Core/Instrumentation/Extensions/LoggerProgressExtensions.cs @@ -1,7 +1,7 @@ using System; using NLog; -namespace NzbDrone.Core.Instrumentation +namespace NzbDrone.Core.Instrumentation.Extensions { public static class LoggerExtensions { diff --git a/src/NzbDrone.Core/Jobs/TaskManager.cs b/src/NzbDrone.Core/Jobs/TaskManager.cs index e775abb5f..c9c29d904 100644 --- a/src/NzbDrone.Core/Jobs/TaskManager.cs +++ b/src/NzbDrone.Core/Jobs/TaskManager.cs @@ -93,7 +93,7 @@ public void Handle(CommandExecutedEvent message) if (scheduledTask != null) { - _logger.Trace("Updating last run time for: {0}", scheduledTask.TypeName); + _logger.Debug("Updating last run time for: {0}", scheduledTask.TypeName); _scheduledTaskRepository.SetLastExecutionTime(scheduledTask.Id, DateTime.UtcNow); } } diff --git a/src/NzbDrone.Core/Lifecycle/LifecycleService.cs b/src/NzbDrone.Core/Lifecycle/LifecycleService.cs index 1d02490c6..df5c017b1 100644 --- a/src/NzbDrone.Core/Lifecycle/LifecycleService.cs +++ b/src/NzbDrone.Core/Lifecycle/LifecycleService.cs @@ -1,9 +1,7 @@ -using System; -using NLog; +using NLog; using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Processes; -using NzbDrone.Core.Instrumentation; using NzbDrone.Core.Lifecycle.Commands; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Events; diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index 79d53a9a8..c03e8ec0d 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -1,11 +1,9 @@ -using System; -using System.IO; +using System.IO; using System.Linq; using NLog; -using NzbDrone.Common; using NzbDrone.Common.Disk; using NzbDrone.Core.Configuration; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.MediaFiles.Commands; using NzbDrone.Core.MediaFiles.EpisodeImport; using NzbDrone.Core.MediaFiles.Events; diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index cf82620de..b5531b32b 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -102,7 +102,7 @@ private List ProcessSubFolder(DirectoryInfo subfolderInfo) var cleanedUpName = GetCleanedUpFolderName(subfolderInfo.Name); var series = _parsingService.GetSeries(cleanedUpName); var quality = QualityParser.ParseQuality(cleanedUpName); - _logger.Trace("{0} folder quality: {1}", cleanedUpName, quality); + _logger.Debug("{0} folder quality: {1}", cleanedUpName, quality); if (series == null) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index 95fcd49bc..34eac41c4 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -50,7 +50,7 @@ public EpisodeFile MoveEpisodeFile(EpisodeFile episodeFile, Series series) var newFileName = _buildFileNames.BuildFilename(episodes, series, episodeFile); var filePath = _buildFileNames.BuildFilePath(series, episodes.First().SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path)); - _logger.Trace("Renaming episode file: {0} to {1}", episodeFile, filePath); + _logger.Debug("Renaming episode file: {0} to {1}", episodeFile, filePath); return MoveFile(episodeFile, series, episodes, filePath); } @@ -60,7 +60,7 @@ public EpisodeFile MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEp var newFileName = _buildFileNames.BuildFilename(localEpisode.Episodes, localEpisode.Series, episodeFile); var filePath = _buildFileNames.BuildFilePath(localEpisode.Series, localEpisode.SeasonNumber, newFileName, Path.GetExtension(episodeFile.Path)); - _logger.Trace("Moving episode file: {0} to {1}", episodeFile, filePath); + _logger.Debug("Moving episode file: {0} to {1}", episodeFile, filePath); return MoveFile(episodeFile, localEpisode.Series, localEpisode.Episodes, filePath); } @@ -110,14 +110,14 @@ private EpisodeFile MoveFile(EpisodeFile episodeFile, Series series, List GetDecisions(IEnumerable videoFiles, { if (quality != null && new QualityModelComparer(parsedEpisode.Series.QualityProfile).Compare(quality, parsedEpisode.Quality) > 0) { - _logger.Trace("Using quality from folder: {0}", quality); + _logger.Debug("Using quality from folder: {0}", quality); parsedEpisode.Quality = quality; } parsedEpisode.Size = _diskProvider.GetFileSize(file); - _logger.Trace("Size: {0}", parsedEpisode.Size); + _logger.Debug("Size: {0}", parsedEpisode.Size); decision = GetDecision(parsedEpisode); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs index 32d6b9054..bad570bf4 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs @@ -26,7 +26,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (localEpisode.ExistingFile) { - _logger.Trace("Skipping free space check for existing episode"); + _logger.Debug("Skipping free space check for existing episode"); return true; } @@ -35,7 +35,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) if (!freeSpace.HasValue) { - _logger.Trace("Free space check returned an invalid result for: {0}", path); + _logger.Debug("Free space check returned an invalid result for: {0}", path); return true; } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs index 0bd8418f4..c6a5e9f5e 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FullSeasonSpecification.cs @@ -21,7 +21,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (localEpisode.ParsedEpisodeInfo.FullSeason) { - _logger.Trace("Single episode file detected as containing all episodes in the season"); + _logger.Debug("Single episode file detected as containing all episodes in the season"); return false; } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotInUseSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotInUseSpecification.cs index ce9ee9ff5..8eb2beaed 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotInUseSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotInUseSpecification.cs @@ -21,13 +21,13 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (localEpisode.ExistingFile) { - _logger.Trace("{0} is in series folder, skipping in use check", localEpisode.Path); + _logger.Debug("{0} is in series folder, skipping in use check", localEpisode.Path); return true; } if (_diskProvider.IsFileLocked(localEpisode.Path)) { - _logger.Trace("{0} is in use"); + _logger.Debug("{0} is in use"); return false; } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs index 7e2fd7ed6..11c7ce7cd 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotSampleSpecification.cs @@ -37,19 +37,19 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (localEpisode.ExistingFile) { - _logger.Trace("Existing file, skipping sample check"); + _logger.Debug("Existing file, skipping sample check"); return true; } if (localEpisode.Series.SeriesType == SeriesTypes.Daily) { - _logger.Trace("Daily Series, skipping sample check"); + _logger.Debug("Daily Series, skipping sample check"); return true; } if (localEpisode.SeasonNumber == 0) { - _logger.Trace("Special, skipping sample check"); + _logger.Debug("Special, skipping sample check"); return true; } @@ -57,7 +57,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) if (extension != null && extension.Equals(".flv", StringComparison.InvariantCultureIgnoreCase)) { - _logger.Trace("Skipping sample check for .flv file"); + _logger.Debug("Skipping sample check for .flv file"); return true; } @@ -73,19 +73,19 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) if (runTime.TotalSeconds < 90) { - _logger.Trace("[{0}] appears to be a sample. Size: {1} Runtime: {2}", localEpisode.Path, localEpisode.Size, runTime); + _logger.Debug("[{0}] appears to be a sample. Size: {1} Runtime: {2}", localEpisode.Path, localEpisode.Size, runTime); return false; } } catch (DllNotFoundException) { - _logger.Trace("Falling back to file size detection"); + _logger.Debug("Falling back to file size detection"); return CheckSize(localEpisode); } - _logger.Trace("Runtime is over 90 seconds"); + _logger.Debug("Runtime is over 90 seconds"); return true; } @@ -95,14 +95,14 @@ private bool CheckSize(LocalEpisode localEpisode) { if (localEpisode.Size < SampleSizeLimit * 2) { - _logger.Trace("1080p file is less than sample limit"); + _logger.Debug("1080p file is less than sample limit"); return false; } } if (localEpisode.Size < SampleSizeLimit) { - _logger.Trace("File is less than sample limit"); + _logger.Debug("File is less than sample limit"); return false; } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs index 129cd07fc..3c52b1bb6 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/NotUnpackingSpecification.cs @@ -28,7 +28,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (localEpisode.ExistingFile) { - _logger.Trace("{0} is in series folder, unpacking check", localEpisode.Path); + _logger.Debug("{0} is in series folder, unpacking check", localEpisode.Path); return true; } @@ -38,13 +38,13 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) { if (OsInfo.IsMono) { - _logger.Trace("{0} is still being unpacked", localEpisode.Path); + _logger.Debug("{0} is still being unpacked", localEpisode.Path); return false; } if (_diskProvider.FileGetLastWriteUtc(localEpisode.Path) > DateTime.UtcNow.AddMinutes(-5)) { - _logger.Trace("{0} appears to be unpacking still", localEpisode.Path); + _logger.Debug("{0} appears to be unpacking still", localEpisode.Path); return false; } } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs index c637ac5cd..e8dfbeda9 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/UpgradeSpecification.cs @@ -22,7 +22,7 @@ public bool IsSatisfiedBy(LocalEpisode localEpisode) var qualityComparer = new QualityModelComparer(localEpisode.Series.QualityProfile); if (localEpisode.Episodes.Any(e => e.EpisodeFileId != 0 && qualityComparer.Compare(e.EpisodeFile.Value.Quality, localEpisode.Quality) > 0)) { - _logger.Trace("This file isn't an upgrade for all episodes. Skipping {0}", localEpisode.Path); + _logger.Debug("This file isn't an upgrade for all episodes. Skipping {0}", localEpisode.Path); return false; } diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs index a897a1582..a51121511 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs @@ -43,21 +43,21 @@ public void Execute(CleanMediaFileDb message) { if (!_diskProvider.FileExists(episodeFile.Path)) { - _logger.Trace("File [{0}] no longer exists on disk, removing from db", episodeFile.Path); + _logger.Debug("File [{0}] no longer exists on disk, removing from db", episodeFile.Path); _mediaFileService.Delete(episodeFile); continue; } if (!DiskProviderBase.IsParent(series.Path, episodeFile.Path)) { - _logger.Trace("File [{0}] does not belong to this series, removing from db", episodeFile.Path); + _logger.Debug("File [{0}] does not belong to this series, removing from db", episodeFile.Path); _mediaFileService.Delete(episodeFile); continue; } if (!episodes.Any(e => e.EpisodeFileId == episodeFile.Id)) { - _logger.Trace("File [{0}] is not assigned to any episodes, removing from db", episodeFile.Path); + _logger.Debug("File [{0}] is not assigned to any episodes, removing from db", episodeFile.Path); _mediaFileService.Delete(episodeFile); continue; } @@ -66,7 +66,7 @@ public void Execute(CleanMediaFileDb message) // // if (localEpsiode == null || episodes.Count != localEpsiode.Episodes.Count) // { -// _logger.Trace("File [{0}] parsed episodes has changed, removing from db", episodeFile.Path); +// _logger.Debug("File [{0}] parsed episodes has changed, removing from db", episodeFile.Path); // _mediaFileService.Delete(episodeFile); // continue; // } diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 8429a4dbc..83c5debac 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -36,7 +36,7 @@ public MediaInfoModel GetMediaInfo(string filename) try { mediaInfo = new MediaInfoLib.MediaInfo(); - _logger.Trace("Getting media info from {0}", filename); + _logger.Debug("Getting media info from {0}", filename); mediaInfo.Option("ParseSpeed", "0.2"); int open = mediaInfo.Open(filename); diff --git a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index b722df537..ac4fa3c3d 100644 --- a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -50,10 +50,10 @@ public void DeleteFolder(string path) { var destination = Path.Combine(recyclingBin, new DirectoryInfo(path).Name); - logger.Trace("Moving '{0}' to '{1}'", path, destination); + logger.Debug("Moving '{0}' to '{1}'", path, destination); _diskProvider.MoveFolder(path, destination); - logger.Trace("Setting last accessed: {0}", path); + logger.Debug("Setting last accessed: {0}", path); _diskProvider.FolderSetLastWriteTimeUtc(destination, DateTime.UtcNow); foreach (var file in _diskProvider.GetFiles(destination, SearchOption.AllDirectories)) { @@ -75,21 +75,21 @@ public void DeleteFile(string path) if (!OsInfo.IsMono) { - logger.Trace(_diskProvider.GetFileAttributes(path)); + logger.Debug(_diskProvider.GetFileAttributes(path)); } _diskProvider.DeleteFile(path); - logger.Trace("File has been permanently deleted: {0}", path); + logger.Debug("File has been permanently deleted: {0}", path); } else { var destination = Path.Combine(recyclingBin, new FileInfo(path).Name); - logger.Trace("Moving '{0}' to '{1}'", path, destination); + logger.Debug("Moving '{0}' to '{1}'", path, destination); _diskProvider.MoveFile(path, destination); _diskProvider.FileSetLastWriteTimeUtc(destination, DateTime.UtcNow); - logger.Trace("File has been moved to the recycling bin: {0}", destination); + logger.Debug("File has been moved to the recycling bin: {0}", destination); } } @@ -113,7 +113,7 @@ public void Empty() _diskProvider.DeleteFile(file); } - logger.Trace("Recycling Bin has been emptied."); + logger.Debug("Recycling Bin has been emptied."); } public void Cleanup() @@ -130,7 +130,7 @@ public void Cleanup() { if (_diskProvider.FolderGetLastWrite(folder).AddDays(7) > DateTime.UtcNow) { - logger.Trace("Folder hasn't expired yet, skipping: {0}", folder); + logger.Debug("Folder hasn't expired yet, skipping: {0}", folder); continue; } @@ -141,14 +141,14 @@ public void Cleanup() { if (_diskProvider.FileGetLastWriteUtc(file).AddDays(7) > DateTime.UtcNow) { - logger.Trace("File hasn't expired yet, skipping: {0}", file); + logger.Debug("File hasn't expired yet, skipping: {0}", file); continue; } _diskProvider.DeleteFile(file); } - logger.Trace("Recycling Bin has been cleaned up."); + logger.Debug("Recycling Bin has been cleaned up."); } public void HandleAsync(SeriesDeletedEvent message) diff --git a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs index d66298c8c..060f3c3ba 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs @@ -4,7 +4,7 @@ using System.Linq; using NLog; using NzbDrone.Common; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.MediaFiles.Commands; using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.Messaging.Commands; @@ -115,17 +115,17 @@ private void RenameFiles(List episodeFiles, Series series) { try { - _logger.Trace("Renaming episode file: {0}", episodeFile); + _logger.Debug("Renaming episode file: {0}", episodeFile); _episodeFileMover.MoveEpisodeFile(episodeFile, series); _mediaFileService.Update(episodeFile); renamed.Add(episodeFile); - _logger.Trace("Renamed episode file: {0}", episodeFile); + _logger.Debug("Renamed episode file: {0}", episodeFile); } catch (SameFilenameException ex) { - _logger.Trace("File not renamed, source and destination are the same: {0}", ex.Filename); + _logger.Debug("File not renamed, source and destination are the same: {0}", ex.Filename); } catch (Exception ex) { @@ -151,7 +151,7 @@ public void Execute(RenameFilesCommand message) public void Execute(RenameSeriesCommand message) { - _logger.Trace("Renaming all files for selected series"); + _logger.Debug("Renaming all files for selected series"); var seriesToRename = _seriesService.GetSeries(message.SeriesIds); foreach (var series in seriesToRename) diff --git a/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs b/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs index 735b3bbb0..79eae53c2 100644 --- a/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpdateEpisodeFileService.cs @@ -5,7 +5,7 @@ using NzbDrone.Common; using NzbDrone.Common.Disk; using NzbDrone.Core.Configuration; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.MediaFiles.Events; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.Tv; diff --git a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs index 7fa4d5612..c3cf4d208 100644 --- a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs @@ -46,7 +46,7 @@ public EpisodeFileMoveResult UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEp if (_diskProvider.FileExists(file.Path)) { - _logger.Trace("Removing existing episode file: {0}", file); + _logger.Debug("Removing existing episode file: {0}", file); _recycleBinProvider.DeleteFile(file.Path); } diff --git a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs index 53943bacd..7ccdad4d7 100644 --- a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs +++ b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs @@ -39,7 +39,7 @@ public void PublishCommand(TCommand command) where TCommand : Command if (_trackCommands.FindExisting(command) != null) { - _logger.Debug("Command is already in progress: {0}", command.GetType().Name); + _logger.Trace("Command is already in progress: {0}", command.GetType().Name); return; } @@ -64,7 +64,7 @@ public Command PublishCommandAsync(TCommand command) where TCommand : if (existingCommand != null) { - _logger.Debug("Command is already in progress: {0}", command.GetType().Name); + _logger.Trace("Command is already in progress: {0}", command.GetType().Name); return existingCommand; } diff --git a/src/NzbDrone.Core/Messaging/Commands/TestCommandExecutor.cs b/src/NzbDrone.Core/Messaging/Commands/TestCommandExecutor.cs index 8e0ebfb71..f6c6094b5 100644 --- a/src/NzbDrone.Core/Messaging/Commands/TestCommandExecutor.cs +++ b/src/NzbDrone.Core/Messaging/Commands/TestCommandExecutor.cs @@ -1,6 +1,6 @@ using System.Threading; using NLog; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; namespace NzbDrone.Core.Messaging.Commands { diff --git a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs index 2853dd57d..c5d41a047 100644 --- a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs +++ b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs @@ -83,7 +83,7 @@ private static string GetEventName(Type eventType) return eventType.Name; } - return string.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name); + return String.Format("{0}<{1}>", eventType.Name.Remove(eventType.Name.IndexOf('`')), eventType.GetGenericArguments()[0].Name); } } } diff --git a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs index d2bac9d22..4cc004bff 100644 --- a/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/MetaData/Consumers/Xbmc/XbmcMetadata.cs @@ -151,7 +151,7 @@ public override void AfterRename(Series series, List existingMetad else { - _logger.Trace("Unknown episode file metadata: {0}", metadataFile.RelativePath); + _logger.Debug("Unknown episode file metadata: {0}", metadataFile.RelativePath); continue; } @@ -237,7 +237,7 @@ public override MetadataFile FindMetadataFile(Series series, string path) private MetadataFile WriteTvShowNfo(Series series, List existingMetadataFiles) { - _logger.Trace("Generating tvshow.nfo for: {0}", series.Title); + _logger.Debug("Generating tvshow.nfo for: {0}", series.Title); var sb = new StringBuilder(); var xws = new XmlWriterSettings(); xws.OmitXmlDeclaration = true; @@ -310,7 +310,7 @@ private IEnumerable WriteSeriesImages(Series series, List !MediaFileExtensions.Extensions.Contains(Path.GetExtension(c).ToLower())).ToList(); @@ -60,13 +60,13 @@ public void Handle(SeriesUpdatedEvent message) if (localEpisode == null) { - _logger.Trace("Cannot find related episodes for: {0}", possibleMetadataFile); + _logger.Debug("Cannot find related episodes for: {0}", possibleMetadataFile); break; } if (localEpisode.Episodes.DistinctBy(e => e.EpisodeFileId).Count() > 1) { - _logger.Trace("Metadata file: {0} does not match existing files.", possibleMetadataFile); + _logger.Debug("Metadata file: {0} does not match existing files.", possibleMetadataFile); break; } diff --git a/src/NzbDrone.Core/Metadata/Files/MetadataFileService.cs b/src/NzbDrone.Core/Metadata/Files/MetadataFileService.cs index e53c403af..5aad2a1df 100644 --- a/src/NzbDrone.Core/Metadata/Files/MetadataFileService.cs +++ b/src/NzbDrone.Core/Metadata/Files/MetadataFileService.cs @@ -82,7 +82,7 @@ public void Delete(int id) public void HandleAsync(SeriesDeletedEvent message) { - _logger.Trace("Deleting Metadata from database for series: {0}", message.Series); + _logger.Debug("Deleting Metadata from database for series: {0}", message.Series); _repository.DeleteForSeries(message.Series.Id); } @@ -101,7 +101,7 @@ public void HandleAsync(EpisodeFileDeletedEvent message) } } - _logger.Trace("Deleting Metadata from database for episode file: {0}", episodeFile); + _logger.Debug("Deleting Metadata from database for episode file: {0}", episodeFile); _repository.DeleteForEpisodeFile(episodeFile.Id); } diff --git a/src/NzbDrone.Core/Metadata/MetadataBase.cs b/src/NzbDrone.Core/Metadata/MetadataBase.cs index 04be5860a..3bebd9d90 100644 --- a/src/NzbDrone.Core/Metadata/MetadataBase.cs +++ b/src/NzbDrone.Core/Metadata/MetadataBase.cs @@ -61,7 +61,7 @@ protected virtual void DownloadImage(Series series, string url, string path) { if (_diskProvider.FileExists(path)) { - _logger.Trace("Image already exists: {0}, will not download again.", path); + _logger.Debug("Image already exists: {0}, will not download again.", path); return; } diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index e103b144c..7e3e5b504 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -44,7 +44,7 @@ public void SendEmail(EmailSettings settings, string subject, string body, bool catch(Exception ex) { _logger.Error("Error sending email. Subject: {0}", email.Subject); - _logger.TraceException(ex.Message, ex); + _logger.DebugException(ex.Message, ex); } } diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs index cfcba9ba6..ce0ca87ef 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs @@ -35,13 +35,13 @@ public void SendNotification(string title, string message, string notificationTy _growlConnector = new GrowlConnector(password, hostname, port); - Logger.Trace("Sending Notification to: {0}:{1}", hostname, port); + Logger.Debug("Sending Notification to: {0}:{1}", hostname, port); _growlConnector.Notify(notification); } private void Register(string host, int port, string password) { - Logger.Trace("Registering NzbDrone with Growl host: {0}:{1}", host, port); + Logger.Debug("Registering NzbDrone with Growl host: {0}:{1}", host, port); _growlConnector = new GrowlConnector(password, host, port); _growlConnector.Register(_growlApplication, _notificationTypes.ToArray()); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs index 9ff7abc03..fc02d0cc7 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexService.cs @@ -42,7 +42,7 @@ public void UpdateLibrary(PlexServerSettings settings) { try { - _logger.Trace("Sending Update Request to Plex Server"); + _logger.Debug("Sending Update Request to Plex Server"); var sections = GetSectionKeys(settings); sections.ForEach(s => UpdateSection(settings, s)); } @@ -56,7 +56,7 @@ public void UpdateLibrary(PlexServerSettings settings) public List GetSectionKeys(PlexServerSettings settings) { - _logger.Trace("Getting sections from Plex host: {0}", settings.Host); + _logger.Debug("Getting sections from Plex host: {0}", settings.Host); var url = String.Format("http://{0}:{1}/library/sections", settings.Host, settings.Port); var xmlStream = _httpProvider.DownloadStream(url, null); var xDoc = XDocument.Load(xmlStream); @@ -68,7 +68,7 @@ public List GetSectionKeys(PlexServerSettings settings) public void UpdateSection(PlexServerSettings settings, int key) { - _logger.Trace("Updating Plex host: {0}, Section: {1}", settings.Host, key); + _logger.Debug("Updating Plex host: {0}, Section: {1}", settings.Host, key); var url = String.Format("http://{0}:{1}/library/sections/{2}/refresh", settings.Host, settings.Port, key); _httpProvider.DownloadString(url); } @@ -87,7 +87,7 @@ public string SendCommand(string host, int port, string command, string username public void Execute(TestPlexClientCommand message) { - _logger.Trace("Sending Test Notifcation to Plex Client: {0}", message.Host); + _logger.Debug("Sending Test Notifcation to Plex Client: {0}", message.Host); var command = String.Format("ExecBuiltIn(Notification({0}, {1}))", "Test Notification", "Success! Notifications are setup correctly"); var result = SendCommand(message.Host, message.Port, command, message.Username, message.Password); diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs index eb452f50a..7742b2f05 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs @@ -36,7 +36,7 @@ public void SendNotification(string title, string message, string apiKey, Notifi var client = new ProwlClient(); - _logger.Trace("Sending Prowl Notification"); + _logger.Debug("Sending Prowl Notification"); var notificationResult = client.SendNotification(notification); @@ -48,7 +48,7 @@ public void SendNotification(string title, string message, string apiKey, Notifi catch (Exception ex) { - _logger.TraceException(ex.Message, ex); + _logger.DebugException(ex.Message, ex); _logger.Warn("Invalid API Key: {0}", apiKey); } } @@ -62,7 +62,7 @@ public void Verify(string apiKey) var client = new ProwlClient(); - _logger.Trace("Verifying API Key: {0}", apiKey); + _logger.Debug("Verifying API Key: {0}", apiKey); var verificationResult = client.SendVerification(verificationRequest); if (!String.IsNullOrWhiteSpace(verificationResult.ErrorMessage) && @@ -74,7 +74,7 @@ public void Verify(string apiKey) catch (Exception ex) { - _logger.TraceException(ex.Message, ex); + _logger.DebugException(ex.Message, ex); _logger.Warn("Invalid API Key: {0}", apiKey); throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid"); } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs index 6178056f9..1cb2e70b4 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs @@ -33,7 +33,7 @@ public void Update(XbmcSettings settings, Series series) { if (!settings.AlwaysUpdate) { - _logger.Trace("Determining if there are any active players on XBMC host: {0}", settings.Address); + _logger.Debug("Determining if there are any active players on XBMC host: {0}", settings.Address); var activePlayers = GetActivePlayers(settings); if (activePlayers.Any(a => a.Type.Equals("video"))) @@ -77,7 +77,7 @@ public List GetActivePlayers(XbmcSettings settings) public bool CheckForError(string response) { - _logger.Trace("Looking for error in response: {0}", response); + _logger.Debug("Looking for error in response: {0}", response); if (String.IsNullOrWhiteSpace(response)) { @@ -92,7 +92,7 @@ public bool CheckForError(string response) var errorMessage = response.Substring(errorIndex + 6); errorMessage = errorMessage.Substring(0, errorMessage.IndexOfAny(new char[] { '<', ';' })); - _logger.Trace("Error found in response: {0}", errorMessage); + _logger.Debug("Error found in response: {0}", errorMessage); return true; } @@ -141,13 +141,13 @@ private void UpdateLibrary(XbmcSettings settings, Series series) { try { - _logger.Trace("Sending Update DB Request to XBMC Host: {0}", settings.Address); + _logger.Debug("Sending Update DB Request to XBMC Host: {0}", settings.Address); var xbmcSeriesPath = GetSeriesPath(settings, series); //If the path is found update it, else update the whole library if (!String.IsNullOrEmpty(xbmcSeriesPath)) { - _logger.Trace("Updating series [{0}] on XBMC host: {1}", series, settings.Address); + _logger.Debug("Updating series [{0}] on XBMC host: {1}", series, settings.Address); var command = BuildExecBuiltInCommand(String.Format("UpdateLibrary(video,{0})", xbmcSeriesPath)); SendCommand(settings, command); } @@ -155,7 +155,7 @@ private void UpdateLibrary(XbmcSettings settings, Series series) else { //Update the entire library - _logger.Trace("Series [{0}] doesn't exist on XBMC host: {1}, Updating Entire Library", series, settings.Address); + _logger.Debug("Series [{0}] doesn't exist on XBMC host: {1}, Updating Entire Library", series, settings.Address); var command = BuildExecBuiltInCommand("UpdateLibrary(video)"); SendCommand(settings, command); } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs index 58f28c7e4..99f40d830 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/JsonApiProvider.cs @@ -38,7 +38,7 @@ public void Update(XbmcSettings settings, Series series) { if (!settings.AlwaysUpdate) { - _logger.Trace("Determining if there are any active players on XBMC host: {0}", settings.Address); + _logger.Debug("Determining if there are any active players on XBMC host: {0}", settings.Address); var activePlayers = GetActivePlayers(settings); if (activePlayers.Any(a => a.Type.Equals("video"))) @@ -87,7 +87,7 @@ public List GetActivePlayers(XbmcSettings settings) public bool CheckForError(string response) { - _logger.Trace("Looking for error in response: {0}", response); + _logger.Debug("Looking for error in response: {0}", response); if (String.IsNullOrWhiteSpace(response)) { @@ -114,7 +114,7 @@ public string GetSeriesPath(XbmcSettings settings, Series series) if (!allSeries.Any()) { - _logger.Trace("No TV shows returned from XBMC"); + _logger.Debug("No TV shows returned from XBMC"); return null; } @@ -140,7 +140,7 @@ private void UpdateLibrary(XbmcSettings settings, Series series) if (seriesPath != null) { - _logger.Trace("Updating series {0} (Path: {1}) on XBMC host: {2}", series, seriesPath, settings.Address); + _logger.Debug("Updating series {0} (Path: {1}) on XBMC host: {2}", series, seriesPath, settings.Address); var parameters = new JObject(new JObject(new JProperty("directory", seriesPath))); postJson = BuildJsonRequest("VideoLibrary.Scan", parameters); @@ -148,7 +148,7 @@ private void UpdateLibrary(XbmcSettings settings, Series series) else { - _logger.Trace("Series {0} doesn't exist on XBMC host: {1}, Updating Entire Library", series, + _logger.Debug("Series {0} doesn't exist on XBMC host: {1}, Updating Entire Library", series, settings.Address); postJson = BuildJsonRequest("VideoLibrary.Scan"); @@ -158,12 +158,12 @@ private void UpdateLibrary(XbmcSettings settings, Series series) if (CheckForError(response)) return; - _logger.Trace(" from response"); + _logger.Debug(" from response"); var result = Json.Deserialize>(response); if (!result.Result.Equals("OK", StringComparison.InvariantCultureIgnoreCase)) { - _logger.Trace("Failed to update library for: {0}", settings.Address); + _logger.Debug("Failed to update library for: {0}", settings.Address); } } diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs index 3ffbeba98..3a1ac4249 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs @@ -61,7 +61,7 @@ public XbmcVersion GetJsonVersion(XbmcSettings settings) var response = _httpProvider.PostCommand(settings.Address, settings.Username, settings.Password, postJson.ToString()); - Logger.Trace("Getting version from response"); + Logger.Debug("Getting version from response"); var result = Json.Deserialize>(response); var versionObject = result.Result.Property("version"); @@ -108,9 +108,9 @@ public void Execute(TestXbmcCommand message) DisplayTime = message.DisplayTime }; - Logger.Trace("Determining version of XBMC Host: {0}", settings.Address); + Logger.Debug("Determining version of XBMC Host: {0}", settings.Address); var version = GetJsonVersion(settings); - Logger.Trace("Version is: {0}", version); + Logger.Debug("Version is: {0}", version); if (version == new XbmcVersion(0)) { diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 63df96700..e7cbf526a 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -308,6 +308,8 @@ + + @@ -368,7 +370,6 @@ - diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index c920bd8aa..332c851e2 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -29,5 +29,10 @@ private set } public int TvRageId { get; set; } + + public override string ToString() + { + return String.Format("[{0}] {1} [{2}]", PublishDate, Title, Size); + } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 58ea810f5..883b7af97 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; @@ -129,7 +128,7 @@ public static ParsedEpisodeInfo ParsePath(string path) if (result == null) { - Logger.Trace("Attempting to parse episode info using full path. {0}", fileInfo.FullName); + Logger.Debug("Attempting to parse episode info using full path. {0}", fileInfo.FullName); result = ParseTitle(fileInfo.FullName); } @@ -150,7 +149,7 @@ public static ParsedEpisodeInfo ParseTitle(string title) { if (!ValidateBeforeParsing(title)) return null; - Logger.Trace("Parsing string '{0}'", title); + Logger.Debug("Parsing string '{0}'", title); var simpleTitle = SimpleTitleRegex.Replace(title, String.Empty); foreach (var regex in ReportTitleRegex) @@ -166,20 +165,20 @@ public static ParsedEpisodeInfo ParseTitle(string title) if (result != null) { result.Language = ParseLanguage(title); - Logger.Trace("Language parsed: {0}", result.Language); + Logger.Debug("Language parsed: {0}", result.Language); result.Quality = QualityParser.ParseQuality(title); - Logger.Trace("Quality parsed: {0}", result.Quality); + Logger.Debug("Quality parsed: {0}", result.Quality); result.ReleaseGroup = ParseReleaseGroup(title); - Logger.Trace("Release Group parsed: {0}", result.ReleaseGroup); + Logger.Debug("Release Group parsed: {0}", result.ReleaseGroup); return result; } } catch (InvalidDateException ex) { - Logger.TraceException(ex.Message, ex); + Logger.DebugException(ex.Message, ex); break; } } @@ -191,13 +190,13 @@ public static ParsedEpisodeInfo ParseTitle(string title) Logger.ErrorException("An error has occurred while trying to parse " + title, e); } - Logger.Trace("Unable to parse {0}", title); + Logger.Debug("Unable to parse {0}", title); return null; } public static string ParseSeriesName(string title) { - Logger.Trace("Parsing string '{0}'", title); + Logger.Debug("Parsing string '{0}'", title); var parseResult = ParseTitle(title); @@ -402,7 +401,7 @@ private static ParsedEpisodeInfo ParseMatchCollection(MatchCollection matchColle result.SeriesTitle = CleanSeriesTitle(seriesName); result.SeriesTitleInfo = GetSeriesTitleInfo(result.SeriesTitle); - Logger.Trace("Episode Parsed. {0}", result); + Logger.Debug("Episode Parsed. {0}", result); return result; } @@ -492,7 +491,7 @@ private static bool ValidateBeforeParsing(string title) { if (title.ToLower().Contains("password") && title.ToLower().Contains("yenc")) { - Logger.Trace(""); + Logger.Debug(""); return false; } diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs index 7028a8f95..35f73caf8 100644 --- a/src/NzbDrone.Core/Parser/ParsingService.cs +++ b/src/NzbDrone.Core/Parser/ParsingService.cs @@ -66,7 +66,7 @@ public LocalEpisode GetLocalEpisode(string filename, Series series, bool sceneSo if (!episodes.Any()) { - _logger.Trace("No matching episodes found for: {0}", parsedEpisodeInfo); + _logger.Debug("No matching episodes found for: {0}", parsedEpisodeInfo); return null; } @@ -256,7 +256,7 @@ public ParsedEpisodeInfo ParseSpecialEpisodeTitle(string title, int tvRageId, Se if (series == null) { - _logger.Trace("No matching series {0}", title); + _logger.Debug("No matching series {0}", title); return null; } @@ -325,7 +325,7 @@ private Series GetSeries(ParsedEpisodeInfo parsedEpisodeInfo, int tvRageId) if (series == null) { - _logger.Trace("No matching series {0}", parsedEpisodeInfo.SeriesTitle); + _logger.Debug("No matching series {0}", parsedEpisodeInfo.SeriesTitle); return null; } diff --git a/src/NzbDrone.Core/Parser/QualityParser.cs b/src/NzbDrone.Core/Parser/QualityParser.cs index d5a1d4e13..c21cb3e19 100644 --- a/src/NzbDrone.Core/Parser/QualityParser.cs +++ b/src/NzbDrone.Core/Parser/QualityParser.cs @@ -28,7 +28,7 @@ public class QualityParser public static QualityModel ParseQuality(string name) { - Logger.Trace("Trying to parse quality for {0}", name); + Logger.Debug("Trying to parse quality for {0}", name); name = name.Trim(); var normalizedName = name.CleanSeriesTitle(); diff --git a/src/NzbDrone.Core/Queue/QueueService.cs b/src/NzbDrone.Core/Queue/QueueService.cs index 899b41b1a..e195f57e4 100644 --- a/src/NzbDrone.Core/Queue/QueueService.cs +++ b/src/NzbDrone.Core/Queue/QueueService.cs @@ -27,7 +27,7 @@ public List GetQueue() if (downloadClient == null) { - _logger.Trace("Download client is not configured."); + _logger.Debug("Download client is not configured."); return new List(); } diff --git a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs index b4b17510e..4f9c64e3b 100644 --- a/src/NzbDrone.Core/Rest/RestSharpExtensions.cs +++ b/src/NzbDrone.Core/Rest/RestSharpExtensions.cs @@ -23,7 +23,7 @@ public static IRestResponse ValidateResponse(this IRestResponse response, IRestC Ensure.That(response.Request, () => response.Request).IsNotNull(); Ensure.That(restClient, () => restClient).IsNotNull(); - Logger.Trace("Validating Responses from [{0}] [{1}] status: [{2}]", response.Request.Method, restClient.BuildUri(response.Request), response.StatusCode); + Logger.Debug("Validating Responses from [{0}] [{1}] status: [{2}]", response.Request.Method, restClient.BuildUri(response.Request), response.StatusCode); if (response.ResponseUri == null) { diff --git a/src/NzbDrone.Core/Tv/EpisodeService.cs b/src/NzbDrone.Core/Tv/EpisodeService.cs index f5a8f0c0e..402642e0a 100644 --- a/src/NzbDrone.Core/Tv/EpisodeService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeService.cs @@ -191,7 +191,7 @@ public void Handle(EpisodeFileDeletedEvent message) { foreach (var episode in GetEpisodesByFileId(message.EpisodeFile.Id)) { - _logger.Trace("Detaching episode {0} from file.", episode.Id); + _logger.Debug("Detaching episode {0} from file.", episode.Id); episode.EpisodeFileId = 0; if (!message.ForUpgrade && _configService.AutoUnmonitorPreviouslyDownloadedEpisodes) diff --git a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs index 8a1776642..b9c9a56cf 100644 --- a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs +++ b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs @@ -4,7 +4,7 @@ using System.Linq; using NLog; using NzbDrone.Core.DataAugmentation.DailySeries; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Messaging.Events; using NzbDrone.Core.MetadataSource; @@ -88,7 +88,7 @@ private List UpdateSeasons(Series series, Series seriesInfo) //Todo: Should this should use the previous season's monitored state? if (existingSeason == null) { - _logger.Trace("New season ({0}) for series: [{1}] {2}, setting monitored to true", season.SeasonNumber, series.TvdbId, series.Title); + _logger.Debug("New season ({0}) for series: [{1}] {2}, setting monitored to true", season.SeasonNumber, series.TvdbId, series.Title); season.Monitored = true; } diff --git a/src/NzbDrone.Core/Tv/SeriesService.cs b/src/NzbDrone.Core/Tv/SeriesService.cs index 59084ad74..b2cbf8ff6 100644 --- a/src/NzbDrone.Core/Tv/SeriesService.cs +++ b/src/NzbDrone.Core/Tv/SeriesService.cs @@ -141,10 +141,10 @@ public Series FindByTitleInexact(string title) // series are usually the first thing in release title, so we select the leftmost and longest match var match = query.First().series; - _logger.Trace("Multiple series matched {0} from title {1}", match.Title, title); + _logger.Debug("Multiple series matched {0} from title {1}", match.Title, title); foreach (var entry in list) { - _logger.Trace("Multiple series match candidate: {0} cleantitle: {1}", entry.Title, entry.CleanTitle); + _logger.Debug("Multiple series match candidate: {0} cleantitle: {1}", entry.Title, entry.CleanTitle); } return match; diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index 1df980c20..da353fa33 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -5,9 +5,9 @@ using NzbDrone.Common.Disk; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Processes; +using NzbDrone.Core.Instrumentation.Extensions; using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.Update.Commands; -using NzbDrone.Core.Instrumentation; namespace NzbDrone.Core.Update { diff --git a/src/NzbDrone.Core/Update/UpdateCheckService.cs b/src/NzbDrone.Core/Update/UpdateCheckService.cs index e8d853305..57cd97905 100644 --- a/src/NzbDrone.Core/Update/UpdateCheckService.cs +++ b/src/NzbDrone.Core/Update/UpdateCheckService.cs @@ -1,7 +1,7 @@ using NLog; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Core.Configuration; -using NzbDrone.Core.Instrumentation; +using NzbDrone.Core.Instrumentation.Extensions; namespace NzbDrone.Core.Update { diff --git a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs index 556f47baf..67aa04edd 100644 --- a/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs +++ b/src/NzbDrone.Host/AccessControl/FirewallAdapter.cs @@ -30,13 +30,13 @@ public void MakeAccessible() { if (!IsNzbDronePortOpen(_configFileProvider.Port)) { - _logger.Trace("Opening Port for NzbDrone: {0}", _configFileProvider.Port); + _logger.Debug("Opening Port for NzbDrone: {0}", _configFileProvider.Port); OpenFirewallPort(_configFileProvider.Port); } if (_configFileProvider.EnableSsl && !IsNzbDronePortOpen(_configFileProvider.SslPort)) { - _logger.Trace("Opening SSL Port for NzbDrone: {0}", _configFileProvider.SslPort); + _logger.Debug("Opening SSL Port for NzbDrone: {0}", _configFileProvider.SslPort); OpenFirewallPort(_configFileProvider.SslPort); } } diff --git a/src/NzbDrone.Host/Router.cs b/src/NzbDrone.Host/Router.cs index 900a3a062..72d1c8f67 100644 --- a/src/NzbDrone.Host/Router.cs +++ b/src/NzbDrone.Host/Router.cs @@ -27,20 +27,20 @@ public void Route(ApplicationModes applicationModes) { case ApplicationModes.Service: { - _logger.Trace("Service selected"); + _logger.Debug("Service selected"); _serviceProvider.Run(_nzbDroneServiceFactory.Build()); break; } case ApplicationModes.Interactive: { - _logger.Trace("Console selected"); + _logger.Debug("Console selected"); _nzbDroneServiceFactory.Start(); break; } case ApplicationModes.InstallService: { - _logger.Trace("Install Service selected"); + _logger.Debug("Install Service selected"); if (_serviceProvider.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)) { _consoleService.PrintServiceAlreadyExist(); @@ -54,7 +54,7 @@ public void Route(ApplicationModes applicationModes) } case ApplicationModes.UninstallService: { - _logger.Trace("Uninstall Service selected"); + _logger.Debug("Uninstall Service selected"); if (!_serviceProvider.ServiceExist(ServiceProvider.NZBDRONE_SERVICE_NAME)) { _consoleService.PrintServiceDoesNotExist(); diff --git a/src/NzbDrone.Mono/DiskProvider.cs b/src/NzbDrone.Mono/DiskProvider.cs index 0184e6669..2038d44c5 100644 --- a/src/NzbDrone.Mono/DiskProvider.cs +++ b/src/NzbDrone.Mono/DiskProvider.cs @@ -28,7 +28,7 @@ public class DiskProvider : DiskProviderBase if (driveInfo == null) { - Logger.Trace("Unable to get free space for '{0}', unable to find suitable drive", path); + Logger.Debug("Unable to get free space for '{0}', unable to find suitable drive", path); return null; } @@ -59,7 +59,7 @@ public override void InheritFolderPermissions(string filename) public override void SetPermissions(string path, string mask, string user, string group) { - Logger.Trace("Setting permissions: {0} on {1}", mask, path); + Logger.Debug("Setting permissions: {0} on {1}", mask, path); var filePermissions = NativeConvert.FromOctalPermissionString(mask); @@ -72,7 +72,7 @@ public override void SetPermissions(string path, string mask, string user, strin if (String.IsNullOrWhiteSpace(user) || String.IsNullOrWhiteSpace(group)) { - Logger.Trace("User or Group for chown not configured, skipping chown."); + Logger.Debug("User or Group for chown not configured, skipping chown."); return; }