diff --git a/src/NzbDrone.Api/Indexers/ReleaseModule.cs b/src/NzbDrone.Api/Indexers/ReleaseModule.cs index 5729af932..6a31ec0b9 100644 --- a/src/NzbDrone.Api/Indexers/ReleaseModule.cs +++ b/src/NzbDrone.Api/Indexers/ReleaseModule.cs @@ -68,7 +68,7 @@ private Response DownloadRelease(ReleaseResource release) } catch (ReleaseDownloadException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed"); } @@ -96,7 +96,7 @@ private List GetEpisodeReleases(int episodeId) } catch (Exception ex) { - _logger.Error(ex, "Episode search failed: " + ex.Message); + _logger.Error(ex, "Episode search failed"); } return new List(); diff --git a/src/NzbDrone.Common/Disk/DiskProviderBase.cs b/src/NzbDrone.Common/Disk/DiskProviderBase.cs index 41de39866..6763709a5 100644 --- a/src/NzbDrone.Common/Disk/DiskProviderBase.cs +++ b/src/NzbDrone.Common/Disk/DiskProviderBase.cs @@ -108,16 +108,16 @@ public bool FileExists(string path, StringComparison stringComparison) switch (stringComparison) { - case StringComparison.CurrentCulture: - case StringComparison.InvariantCulture: - case StringComparison.Ordinal: - { - return File.Exists(path) && path == path.GetActualCasing(); - } + case StringComparison.CurrentCulture: + case StringComparison.InvariantCulture: + case StringComparison.Ordinal: + { + return File.Exists(path) && path == path.GetActualCasing(); + } default: - { - return File.Exists(path); - } + { + return File.Exists(path); + } } } @@ -128,7 +128,7 @@ public bool FolderWritable(string path) try { var testPath = Path.Combine(path, "sonarr_write_test.txt"); - var testContent = string.Format("This file was created to verify if '{0}' is writable. It should've been automatically deleted. Feel free to delete it.", path); + var testContent = $"This file was created to verify if '{path}' is writable. It should've been automatically deleted. Feel free to delete it."; File.WriteAllText(testPath, testContent); File.Delete(testPath); return true; diff --git a/src/NzbDrone.Common/Disk/DiskTransferService.cs b/src/NzbDrone.Common/Disk/DiskTransferService.cs index 3345d7f9b..8e7a05fe7 100644 --- a/src/NzbDrone.Common/Disk/DiskTransferService.cs +++ b/src/NzbDrone.Common/Disk/DiskTransferService.cs @@ -352,7 +352,7 @@ private void RollbackPartialMove(string sourcePath, string targetPath) } catch (Exception ex) { - _logger.Error(ex, string.Format("Failed to properly rollback the file move [{0}] to [{1}], incomplete file may be left in target path.", sourcePath, targetPath)); + _logger.Error(ex, "Failed to properly rollback the file move [{0}] to [{1}], incomplete file may be left in target path.", sourcePath, targetPath); } } @@ -368,7 +368,7 @@ private void RollbackMove(string sourcePath, string targetPath) } catch (Exception ex) { - _logger.Error(ex, string.Format("Failed to properly rollback the file move [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath)); + _logger.Error(ex, "Failed to properly rollback the file move [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath); } } @@ -387,7 +387,7 @@ private void RollbackCopy(string sourcePath, string targetPath) } catch (Exception ex) { - _logger.Error(ex, string.Format("Failed to properly rollback the file copy [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath)); + _logger.Error(ex, "Failed to properly rollback the file copy [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath); } } @@ -429,7 +429,7 @@ private bool TryCopyFileTransactional(string sourcePath, string targetPath, long if (i == RetryCount) { - _logger.Error("Failed to completely transfer [{0}] to [{1}], aborting.", sourcePath, targetPath, i + 1, RetryCount); + _logger.Error("Failed to completely transfer [{0}] to [{1}], aborting.", sourcePath, targetPath); } else { diff --git a/src/NzbDrone.Common/Http/HttpClient.cs b/src/NzbDrone.Common/Http/HttpClient.cs index 3a9e883cd..849647f64 100644 --- a/src/NzbDrone.Common/Http/HttpClient.cs +++ b/src/NzbDrone.Common/Http/HttpClient.cs @@ -90,7 +90,7 @@ public HttpResponse Execute(HttpRequest request) response.StatusCode == HttpStatusCode.MovedPermanently || response.StatusCode == HttpStatusCode.Found)) { - _logger.Error("Server requested a redirect to [" + response.Headers["Location"] + "]. Update the request URL to avoid this redirect."); + _logger.Error("Server requested a redirect to [{0}]. Update the request URL to avoid this redirect.", response.Headers["Location"]); } if (!request.SuppressHttpError && response.HasHttpError) diff --git a/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs b/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs index b56c306a9..fbcbf4dcb 100644 --- a/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs +++ b/src/NzbDrone.Common/Instrumentation/GlobalExceptionHandlers.cs @@ -19,7 +19,7 @@ private static void HandleTaskException(object sender, UnobservedTaskExceptionEv var exception = e.Exception; Console.WriteLine("Task Error: {0}", exception); - Logger.Error(exception, "Task Error: " + exception.Message); + Logger.Error(exception, "Task Error"); } private static void HandleAppDomainException(object sender, UnhandledExceptionEventArgs e) diff --git a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs index 07cc995e8..23237c6c8 100644 --- a/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/Sentry/SentryTarget.cs @@ -125,7 +125,7 @@ protected override void Write(LogEventInfo logEvent) } catch (Exception e) { - InternalLogger.Error("Unable to send Sentry request: {0}", e.Message); + InternalLogger.Error(e, "Unable to send Sentry request"); } } } diff --git a/src/NzbDrone.Common/Processes/PidFileProvider.cs b/src/NzbDrone.Common/Processes/PidFileProvider.cs index 17e781225..c04ff445f 100644 --- a/src/NzbDrone.Common/Processes/PidFileProvider.cs +++ b/src/NzbDrone.Common/Processes/PidFileProvider.cs @@ -37,7 +37,7 @@ public void Write() } catch (Exception ex) { - _logger.Error(ex, "Unable to write PID file: " + filename); + _logger.Error(ex, "Unable to write PID file {0}", filename); throw; } } diff --git a/src/NzbDrone.Common/Processes/ProcessProvider.cs b/src/NzbDrone.Common/Processes/ProcessProvider.cs index 79bb16769..49e61c621 100644 --- a/src/NzbDrone.Common/Processes/ProcessProvider.cs +++ b/src/NzbDrone.Common/Processes/ProcessProvider.cs @@ -98,9 +98,9 @@ public void OpenDefaultBrowser(string url) var process = new Process { StartInfo = new ProcessStartInfo(url) - { - UseShellExecute = true - } + { + UseShellExecute = true + } }; process.Start(); @@ -136,9 +136,9 @@ public Process Start(string path, string args = null, StringDictionary environme logger.Debug("Starting {0} {1}", path, args); var process = new Process - { - StartInfo = startInfo - }; + { + StartInfo = startInfo + }; process.OutputDataReceived += (sender, eventArgs) => { diff --git a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs index caa04ae42..44385a88f 100644 --- a/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Scene/SceneMappingService.cs @@ -181,7 +181,7 @@ private void UpdateMappings() } catch (Exception ex) { - _logger.Error(ex, "Failed to Update Scene Mappings:"); + _logger.Error(ex, "Failed to Update Scene Mappings."); } } diff --git a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs index d42ca07ea..c80cd8c92 100644 --- a/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs +++ b/src/NzbDrone.Core/DataAugmentation/Xem/XemService.cs @@ -83,7 +83,7 @@ private void PerformUpdate(Series series) } catch (Exception ex) { - _logger.Error(ex, "Error updating scene numbering mappings for: " + series); + _logger.Error(ex, "Error updating scene numbering mappings for {0}", series); } } diff --git a/src/NzbDrone.Core/Datastore/BasicRepository.cs b/src/NzbDrone.Core/Datastore/BasicRepository.cs index db36edc1e..b2afafdc4 100644 --- a/src/NzbDrone.Core/Datastore/BasicRepository.cs +++ b/src/NzbDrone.Core/Datastore/BasicRepository.cs @@ -85,7 +85,7 @@ public IEnumerable Get(IEnumerable ids) if (result.Count != idList.Count()) { - throw new ApplicationException("Expected query to return {0} rows but returned {1}".Inject(idList.Count(), result.Count)); + throw new ApplicationException($"Expected query to return {idList.Count} rows but returned {result.Count}"); } return result; diff --git a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs index 97201abee..3418dd921 100644 --- a/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs +++ b/src/NzbDrone.Core/Datastore/Migration/Framework/MigrationLogger.cs @@ -47,7 +47,7 @@ public void Error(string message) public void Error(Exception exception) { - _logger.Error(exception, exception.Message); + _logger.Error(exception); } public void Write(string message, bool escaped) diff --git a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs index d86653478..bb1a70873 100644 --- a/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs +++ b/src/NzbDrone.Core/DecisionEngine/DownloadDecisionMaker.cs @@ -84,7 +84,7 @@ private IEnumerable GetDecisions(List reports, Se } else if (remoteEpisode.Episodes.Empty()) { - decision = new DownloadDecision(remoteEpisode, new Rejection("Unable to parse episodes from release name")); + decision = new DownloadDecision(remoteEpisode, new Rejection("Unable to parse episodes from release name")); } else { @@ -143,8 +143,8 @@ private Rejection EvaluateSpec(IDecisionEngineSpecification spec, RemoteEpisode { e.Data.Add("report", remoteEpisode.Release.ToJson()); e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); - _logger.Error(e, "Couldn't evaluate decision on " + remoteEpisode.Release.Title); - return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); + _logger.Error(e, "Couldn't evaluate decision on {0}", remoteEpisode.Release.Title); + return new Rejection($"{spec.GetType().Name}: {e.Message}"); } return null; diff --git a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs index 39174d3b8..6e4d023a0 100644 --- a/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs +++ b/src/NzbDrone.Core/Download/Clients/Deluge/Deluge.cs @@ -94,7 +94,7 @@ public override IEnumerable GetItems() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex, "Couldn't get list of torrents"); return Enumerable.Empty(); } @@ -198,12 +198,12 @@ private ValidationFailure TestConnection() } catch (DownloadClientAuthenticationException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure("Password", "Authentication failed"); } catch (WebException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); switch (ex.Status) { case WebExceptionStatus.ConnectFailure: @@ -227,7 +227,7 @@ private ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -278,7 +278,7 @@ private ValidationFailure TestGetTorrents() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs index 6d45f0386..dc3595615 100644 --- a/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs +++ b/src/NzbDrone.Core/Download/Clients/NzbVortex/NzbVortex.cs @@ -166,7 +166,7 @@ private ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new ValidationFailure("Host", "Unable to connect to NZBVortex"); } @@ -187,7 +187,7 @@ private ValidationFailure TestApiVersion() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new ValidationFailure("Host", "Unable to connect to NZBVortex"); } diff --git a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs index 5b6d756cc..aa05aec26 100644 --- a/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs +++ b/src/NzbDrone.Core/Download/Clients/Nzbget/Nzbget.cs @@ -56,7 +56,7 @@ private IEnumerable GetQueue() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -120,7 +120,7 @@ private IEnumerable GetHistory() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -286,7 +286,7 @@ private ValidationFailure TestConnection() { return new ValidationFailure("Username", "Authentication failed"); } - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new ValidationFailure("Host", "Unable to connect to NZBGet"); } diff --git a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs index ecd75c911..55eec2682 100644 --- a/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/QBittorrent/QBittorrent.cs @@ -85,7 +85,7 @@ public override IEnumerable GetItems() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -226,7 +226,7 @@ private ValidationFailure TestConnection() } catch (DownloadClientAuthenticationException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = "Please verify your username and password." @@ -234,7 +234,7 @@ private ValidationFailure TestConnection() } catch (WebException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -246,7 +246,7 @@ private ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message); } @@ -261,7 +261,7 @@ private ValidationFailure TestGetTorrents() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs index 64a5e23de..dc97ef308 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/Sabnzbd.cs @@ -118,7 +118,7 @@ private IEnumerable GetHistory() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -381,7 +381,7 @@ private ValidationFailure TestConnectionAndVersion() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new ValidationFailure("Host", "Unable to connect to SABnzbd"); } } diff --git a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs index 8358e9e79..3fa69c06b 100644 --- a/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs +++ b/src/NzbDrone.Core/Download/Clients/Transmission/TransmissionBase.cs @@ -41,7 +41,7 @@ public override IEnumerable GetItems() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -204,7 +204,7 @@ protected ValidationFailure TestConnection() } catch (DownloadClientAuthenticationException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = string.Format("Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing {0} by WhiteList limitations in the {0} configuration.", Name) @@ -212,7 +212,7 @@ protected ValidationFailure TestConnection() } catch (WebException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -224,7 +224,7 @@ protected ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } } @@ -239,7 +239,7 @@ private ValidationFailure TestGetTorrents() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs index 041708a93..bfbc62cbe 100644 --- a/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/rTorrent/RTorrent.cs @@ -147,7 +147,7 @@ public override IEnumerable GetItems() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -196,7 +196,7 @@ private ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -211,7 +211,7 @@ private ValidationFailure TestGetTorrents() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs index da942b7f1..8f442eb7b 100644 --- a/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs +++ b/src/NzbDrone.Core/Download/Clients/uTorrent/UTorrent.cs @@ -105,7 +105,7 @@ public override IEnumerable GetItems() } catch (DownloadClientException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return Enumerable.Empty(); } @@ -232,7 +232,7 @@ private ValidationFailure TestConnection() } catch (DownloadClientAuthenticationException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure("Username", "Authentication failure") { DetailedDescription = "Please verify your username and password." @@ -240,7 +240,7 @@ private ValidationFailure TestConnection() } catch (WebException ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); if (ex.Status == WebExceptionStatus.ConnectFailure) { return new NzbDroneValidationFailure("Host", "Unable to connect") @@ -252,7 +252,7 @@ private ValidationFailure TestConnection() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message); } @@ -267,7 +267,7 @@ private ValidationFailure TestGetTorrents() } catch (Exception ex) { - _logger.Error(ex, ex.Message); + _logger.Error(ex); return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message); } diff --git a/src/NzbDrone.Core/Download/DownloadEventHub.cs b/src/NzbDrone.Core/Download/DownloadEventHub.cs index 6d910292c..f738f5c2e 100644 --- a/src/NzbDrone.Core/Download/DownloadEventHub.cs +++ b/src/NzbDrone.Core/Download/DownloadEventHub.cs @@ -74,7 +74,7 @@ private void RemoveFromDownloadClient(TrackedDownload trackedDownload) } catch (Exception e) { - _logger.Error(e, "Couldn't remove item from client " + trackedDownload.DownloadItem.Title); + _logger.Error(e, "Couldn't remove item from client {0}", trackedDownload.DownloadItem.Title); } } } diff --git a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs index cf9124d19..dcaefd073 100644 --- a/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs +++ b/src/NzbDrone.Core/Download/TrackedDownloads/DownloadMonitoringService.cs @@ -135,7 +135,7 @@ private List ProcessClientItems(IDownloadClient downloadClient, } catch (Exception e) { - _logger.Error(e, "Couldn't process tracked download " + downloadItem.Title); + _logger.Error(e, "Couldn't process tracked download {0}", downloadItem.Title); } return trackedDownloads; diff --git a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs index 9e9d472ab..99e384cb9 100644 --- a/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs +++ b/src/NzbDrone.Core/Extras/Metadata/Consumers/Xbmc/XbmcMetadata.cs @@ -58,11 +58,11 @@ public override MetadataFile FindMetadataFile(Series series, string path) if (filename == null) return null; var metadata = new MetadataFile - { - SeriesId = series.Id, - Consumer = GetType().Name, - RelativePath = series.Path.GetRelativePath(path) - }; + { + SeriesId = series.Id, + Consumer = GetType().Name, + RelativePath = series.Path.GetRelativePath(path) + }; if (SeriesImagesRegex.IsMatch(filename)) { @@ -93,7 +93,7 @@ public override MetadataFile FindMetadataFile(Series series, string path) { return null; } - + return metadata; } @@ -245,7 +245,7 @@ public override MetadataFileResult EpisodeMetadata(Series series, EpisodeFile ep var streamDetails = new XElement("streamdetails"); var video = new XElement("video"); - video.Add(new XElement("aspect", (float) episodeFile.MediaInfo.Width / (float) episodeFile.MediaInfo.Height)); + video.Add(new XElement("aspect", (float)episodeFile.MediaInfo.Width / (float)episodeFile.MediaInfo.Height)); video.Add(new XElement("bitrate", episodeFile.MediaInfo.VideoBitrate)); video.Add(new XElement("codec", episodeFile.MediaInfo.VideoCodec)); video.Add(new XElement("framerate", episodeFile.MediaInfo.VideoFps)); @@ -338,8 +338,8 @@ public override List EpisodeImages(Series series, EpisodeFile e } catch (Exception ex) { - _logger.Error(ex, "Unable to process episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath)); - + _logger.Error(ex, "Unable to process episode image for file: {0}", Path.Combine(series.Path, episodeFile.RelativePath)); + return new List(); } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs index f82e37e1b..d99eed1a3 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/DownloadClientCheck.cs @@ -33,10 +33,11 @@ public override HealthCheck Check() } catch (Exception ex) { - var message = String.Format("Unable to communicate with {0}.", downloadClient.Definition.Name); - _logger.Error(ex, message); - return new HealthCheck(GetType(), HealthCheckResult.Error, message + " " + ex.Message); + _logger.Error(ex, "Unable to communicate with {0}", downloadClient.Definition.Name); + + var message = $"Unable to communicate with {downloadClient.Definition.Name}."; + return new HealthCheck(GetType(), HealthCheckResult.Error, $"{message} {ex.Message}"); } } diff --git a/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs index 94ea38710..5b5a9f3f4 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/MediaInfoDllCheck.cs @@ -15,7 +15,7 @@ public override HealthCheck Check() } catch (Exception e) { - return new HealthCheck(GetType(), HealthCheckResult.Warning, "MediaInfo could not be loaded " + e.Message); + return new HealthCheck(GetType(), HealthCheckResult.Warning, $"MediaInfo Library could not be loaded {e.Message}"); } return new HealthCheck(GetType()); diff --git a/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs b/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs index 1732c549e..d9c4d700c 100644 --- a/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs +++ b/src/NzbDrone.Core/HealthCheck/Checks/ProxyCheck.cs @@ -30,7 +30,7 @@ public override HealthCheck Check() if (_configService.ProxyEnabled) { var addresses = Dns.GetHostAddresses(_configService.ProxyHostname); - if(!addresses.Any()) + if (!addresses.Any()) { return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format("Failed to resolve the IP Address for the Configured Proxy Host {0}", _configService.ProxyHostname)); } @@ -47,13 +47,13 @@ public override HealthCheck Check() if (response.StatusCode == HttpStatusCode.BadRequest) { _logger.Error("Proxy Health Check failed: {0}", response.StatusCode); - return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format("Failed to test proxy: StatusCode {1}", request.Url, response.StatusCode)); + return new HealthCheck(GetType(), HealthCheckResult.Error, $"Failed to test proxy. StatusCode: {response.StatusCode}"); } } catch (Exception ex) { - _logger.Error(ex, "Proxy Health Check failed: {0}", ex.Message); - return new HealthCheck(GetType(), HealthCheckResult.Error, string.Format("Failed to test proxy: {1}", request.Url, ex.Message)); + _logger.Error(ex, "Proxy Health Check failed"); + return new HealthCheck(GetType(), HealthCheckResult.Error, $"Failed to test proxy: {request.Url}"); } } diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs index f1744abec..0bd74614b 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/DeleteBadMediaCovers.cs @@ -54,7 +54,7 @@ public void Clean() } catch (Exception e) { - _logger.Error(e, "Couldn't validate image " + image.RelativePath); + _logger.Error(e, "Couldn't validate image {0}", image.RelativePath); } } } diff --git a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs index c36ace89d..eb8cedd9e 100644 --- a/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs +++ b/src/NzbDrone.Core/Housekeeping/HousekeepingService.cs @@ -34,7 +34,7 @@ private void Clean() } catch (Exception ex) { - _logger.Error(ex, "Error running housekeeping task: " + housekeeper.GetType().Name); + _logger.Error(ex, "Error running housekeeping task: {0}", housekeeper.GetType().Name); } } diff --git a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs index 4ae7418a8..6762fbaa2 100644 --- a/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/EpisodeSearchService.cs @@ -53,8 +53,7 @@ private void SearchForMissingEpisodes(List episodes, bool userInvokedSe } catch (Exception ex) { - var message = String.Format("Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key); - _logger.Error(ex, message); + _logger.Error(ex, "Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key); continue; } } @@ -67,8 +66,7 @@ private void SearchForMissingEpisodes(List episodes, bool userInvokedSe } catch (Exception ex) { - var message = String.Format("Unable to search for missing episode: [{0}]", season.First()); - _logger.Error(ex, message); + _logger.Error(ex, "Unable to search for missing episode: [{0}]", season.First()); continue; } } diff --git a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs index cff3e290c..7c5eb1060 100644 --- a/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs +++ b/src/NzbDrone.Core/IndexerSearch/NzbSearchService.cs @@ -120,7 +120,7 @@ public List SeasonSearch(int seriesId, int seasonNumber, bool { var episode = sceneSeasonEpisodes.First(); var searchSpec = Get(series, sceneSeasonEpisodes.ToList(), userInvokedSearch); - + searchSpec.SeasonNumber = sceneSeasonEpisodes.Key; searchSpec.MonitoredEpisodesOnly = true; @@ -160,7 +160,7 @@ public List SeasonSearch(int seriesId, int seasonNumber, bool private List SearchSingle(Series series, Episode episode, bool userInvokedSearch) { - var searchSpec = Get(series, new List{episode}, userInvokedSearch); + var searchSpec = Get(series, new List { episode }, userInvokedSearch); if (series.UseSceneNumbering && episode.SceneSeasonNumber.HasValue && episode.SceneEpisodeNumber.HasValue) { @@ -179,7 +179,7 @@ private List SearchSingle(Series series, Episode episode, bool private List SearchDaily(Series series, Episode episode, bool userInvokedSearch) { var airDate = DateTime.ParseExact(episode.AirDate, Episode.AIR_DATE_FORMAT, CultureInfo.InvariantCulture); - var searchSpec = Get(series, new List{ episode }, userInvokedSearch); + var searchSpec = Get(series, new List { episode }, userInvokedSearch); searchSpec.AirDate = airDate; return Dispatch(indexer => indexer.Fetch(searchSpec), searchSpec); @@ -272,7 +272,7 @@ private List Dispatch(Func> } catch (Exception e) { - _logger.Error(e, "Error while searching for " + criteriaBase); + _logger.Error(e, "Error while searching for {0}", criteriaBase); } }).LogExceptions()); } diff --git a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs index 99ad741ca..b88158b14 100644 --- a/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs +++ b/src/NzbDrone.Core/Indexers/HttpIndexerBase.cs @@ -260,14 +260,13 @@ protected virtual IList FetchReleases(IndexerPageableRequestChain p catch (IndexerException ex) { _indexerStatusService.RecordFailure(Definition.Id); - var message = string.Format("{0} - {1}", ex.Message, url); - _logger.Warn(ex, message); + _logger.Warn(ex, "{0}", url); } catch (Exception feedEx) { _indexerStatusService.RecordFailure(Definition.Id); feedEx.Data.Add("FeedUrl", url); - _logger.Error(feedEx, "An error occurred while processing feed. " + url); + _logger.Error(feedEx, "An error occurred while processing feed. {0}", url); } return CleanupReleases(releases); diff --git a/src/NzbDrone.Core/Indexers/RssParser.cs b/src/NzbDrone.Core/Indexers/RssParser.cs index d2c03cfa4..6006695db 100644 --- a/src/NzbDrone.Core/Indexers/RssParser.cs +++ b/src/NzbDrone.Core/Indexers/RssParser.cs @@ -66,7 +66,7 @@ public virtual IList ParseResponse(IndexerResponse indexerResponse) catch (Exception itemEx) { itemEx.Data.Add("Item", item.Title()); - _logger.Error(itemEx, "An error occurred while processing feed item from " + indexerResponse.Request.Url); + _logger.Error(itemEx, "An error occurred while processing feed item from {0}", indexerResponse.Request.Url); } } diff --git a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs index f69de8224..1c36b91a8 100644 --- a/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs +++ b/src/NzbDrone.Core/Instrumentation/DatabaseTarget.cs @@ -97,7 +97,7 @@ protected override void Write(LogEventInfo logEvent) } catch (SQLiteException ex) { - InternalLogger.Error("Unable to save log event to database: {0}", ex); + InternalLogger.Error(ex, "Unable to save log event to database"); throw; } } diff --git a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs index deb2b35a5..f8e7b652b 100644 --- a/src/NzbDrone.Core/MediaCover/MediaCoverService.cs +++ b/src/NzbDrone.Core/MediaCover/MediaCoverService.cs @@ -99,11 +99,11 @@ private void EnsureCovers(Series series) } catch (WebException e) { - _logger.Warn(string.Format("Couldn't download media cover for {0}. {1}", series, e.Message)); + _logger.Warn("Couldn't download media cover for {0}. {1}", series, e.Message); } catch (Exception e) { - _logger.Error(e, "Couldn't download media cover for " + series); + _logger.Error(e, "Couldn't download media cover for {0}", series); } EnsureResizedCovers(series, cover, !alreadyExists); diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs index 774ac202c..f2a0b9be6 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMovingService.cs @@ -64,7 +64,7 @@ public EpisodeFile MoveEpisodeFile(EpisodeFile episodeFile, Series series) EnsureEpisodeFolder(episodeFile, series, episodes.Select(v => v.SeasonNumber).First(), filePath); _logger.Debug("Renaming episode file: {0} to {1}", episodeFile, filePath); - + return TransferFile(episodeFile, series, episodes, filePath, TransferMode.Move); } @@ -76,7 +76,7 @@ public EpisodeFile MoveEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEp EnsureEpisodeFolder(episodeFile, localEpisode, filePath); _logger.Debug("Moving episode file: {0} to {1}", episodeFile.Path, filePath); - + return TransferFile(episodeFile, localEpisode.Series, localEpisode.Episodes, filePath, TransferMode.Move); } @@ -96,11 +96,11 @@ public EpisodeFile CopyEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEp _logger.Debug("Copying episode file: {0} to {1}", episodeFile.Path, filePath); return TransferFile(episodeFile, localEpisode.Series, localEpisode.Episodes, filePath, TransferMode.Copy); } - + private EpisodeFile TransferFile(EpisodeFile episodeFile, Series series, List episodes, string destinationFilePath, TransferMode mode) { Ensure.That(episodeFile, () => episodeFile).IsNotNull(); - Ensure.That(series,() => series).IsNotNull(); + Ensure.That(series, () => series).IsNotNull(); Ensure.That(destinationFilePath, () => destinationFilePath).IsValidPath(); var episodeFilePath = episodeFile.Path ?? Path.Combine(series.Path, episodeFile.RelativePath); @@ -206,7 +206,7 @@ private void CreateFolder(string directoryName) } catch (IOException ex) { - _logger.Error(ex, "Unable to create directory: " + directoryName); + _logger.Error(ex, "Unable to create directory: {0}", directoryName); } _mediaFileAttributeService.SetFolderPermissions(directoryName); diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs index b517cd76c..27492d56a 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/DetectSample.cs @@ -81,7 +81,6 @@ public bool IsSample(Series series, QualityModel quality, string path, long size private bool CheckSize(long size, QualityModel quality) { - if (_largeSampleSizeQualities.Contains(quality.Quality)) { if (size < SampleSizeLimit * 2) { diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index 8f03ca756..764e1b88f 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -111,7 +111,7 @@ private ImportDecision GetDecision(string file, Series series, ParsedEpisodeInfo } catch (Exception e) { - _logger.Error(e, "Couldn't import file. " + file); + _logger.Error(e, "Couldn't import file. {0}", file); var localEpisode = new LocalEpisode { Path = file }; decision = new ImportDecision(localEpisode, new Rejection("Unexpected error processing file")); @@ -143,8 +143,8 @@ private Rejection EvaluateSpec(IImportDecisionEngineSpecification spec, LocalEpi { //e.Data.Add("report", remoteEpisode.Report.ToJson()); //e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson()); - _logger.Error(e, "Couldn't evaluate decision on " + localEpisode.Path); - return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message)); + _logger.Error(e, "Couldn't evaluate decision on {0}", localEpisode.Path); + return new Rejection($"{spec.GetType().Name}: {e.Message}"); } return null; diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs index 158059e29..490bdb941 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/Specifications/FreeSpaceSpecification.cs @@ -14,7 +14,7 @@ public class FreeSpaceSpecification : IImportDecisionEngineSpecification private readonly IConfigService _configService; private readonly Logger _logger; - public FreeSpaceSpecification(IDiskProvider diskProvider, IConfigService configService, Logger logger) + public FreeSpaceSpecification(IDiskProvider diskProvider, IConfigService configService, Logger logger) { _diskProvider = diskProvider; _configService = configService; @@ -54,11 +54,11 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode) } catch (DirectoryNotFoundException ex) { - _logger.Error("Unable to check free disk space while importing. " + ex.Message); + _logger.Error(ex, "Unable to check free disk space while importing."); } catch (Exception ex) { - _logger.Error(ex, "Unable to check free disk space while importing: " + localEpisode.Path); + _logger.Error(ex, "Unable to check free disk space while importing. {0}", localEpisode.Path); } return Decision.Accept(); diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs index a76c43abd..1db110a15 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileAttributeService.cs @@ -42,12 +42,12 @@ public void SetFilePermissions(string path) { if (ex is UnauthorizedAccessException || ex is InvalidOperationException || ex is FileNotFoundException) { - _logger.Debug("Unable to apply folder permissions to: ", path); + _logger.Debug("Unable to apply folder permissions to {0}", path); _logger.Debug(ex, ex.Message); } else { - _logger.Warn("Unable to apply folder permissions to: ", path); + _logger.Warn("Unable to apply folder permissions to: {0}", path); _logger.Warn(ex, ex.Message); } } diff --git a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs index b275fb03e..0b7b2cba3 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaFileTableCleanupService.cs @@ -68,8 +68,7 @@ public void Clean(Series series, List filesOnDisk) catch (Exception ex) { - var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); - _logger.Error(ex, errorMessage); + _logger.Error(ex, "Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id); } } diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 618e1159e..a1bf6aa86 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -113,7 +113,7 @@ public MediaInfoModel GetMediaInfo(string filename) int.TryParse(aBitRate, out audioBitRate); int.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount); - + string audioChannelsStr = mediaInfo.Get(StreamKind.Audio, 0, "Channel(s)"); int aCindex = audioChannelsStr.IndexOf(" /", StringComparison.InvariantCultureIgnoreCase); @@ -138,25 +138,25 @@ public MediaInfoModel GetMediaInfo(string filename) int.TryParse(audioChannelsStr, out audioChannels); var mediaInfoModel = new MediaInfoModel - { - VideoCodec = mediaInfo.Get(StreamKind.Video, 0, "Codec/String"), - VideoBitrate = videoBitRate, - VideoBitDepth = videoBitDepth, - Height = height, - Width = width, - AudioFormat = mediaInfo.Get(StreamKind.Audio, 0, "Format"), - AudioBitrate = audioBitRate, - RunTime = GetBestRuntime(audioRuntime, videoRuntime, generalRuntime), - AudioStreamCount = streamCount, - AudioChannels = audioChannels, - AudioChannelPositions = audioChannelPositions, - AudioChannelPositionsText = audioChannelPositionsText, - AudioProfile = audioProfile.Trim(), - VideoFps = videoFrameRate, - AudioLanguages = audioLanguages, - Subtitles = subtitles, - ScanType = scanType - }; + { + VideoCodec = mediaInfo.Get(StreamKind.Video, 0, "Codec/String"), + VideoBitrate = videoBitRate, + VideoBitDepth = videoBitDepth, + Height = height, + Width = width, + AudioFormat = mediaInfo.Get(StreamKind.Audio, 0, "Format"), + AudioBitrate = audioBitRate, + RunTime = GetBestRuntime(audioRuntime, videoRuntime, generalRuntime), + AudioStreamCount = streamCount, + AudioChannels = audioChannels, + AudioChannelPositions = audioChannelPositions, + AudioChannelPositionsText = audioChannelPositionsText, + AudioProfile = audioProfile.Trim(), + VideoFps = videoFrameRate, + AudioLanguages = audioLanguages, + Subtitles = subtitles, + ScanType = scanType + }; return mediaInfoModel; } @@ -171,14 +171,11 @@ public MediaInfoModel GetMediaInfo(string filename) } catch (Exception ex) { - _logger.Error(ex, "Unable to parse media info from file: " + filename); + _logger.Error(ex, "Unable to parse media info from file: {0}", filename); } finally { - if (mediaInfo != null) - { - mediaInfo.Close(); - } + mediaInfo?.Close(); } return null; diff --git a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs index 78ba4e8a9..520fbf676 100644 --- a/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs +++ b/src/NzbDrone.Core/MediaFiles/RecycleBinProvider.cs @@ -117,8 +117,7 @@ public void DeleteFile(string path) } catch (IOException e) { - var message = string.Format("Unable to move '{0}' to the recycling bin: '{1}'", path, destination); - _logger.Error(e, message); + _logger.Error(e, "Unable to move '{0}' to the recycling bin: '{1}'", path, destination); throw; } diff --git a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs index 5bde0cab6..4cfe84b37 100644 --- a/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/RenameEpisodeFileService.cs @@ -96,14 +96,14 @@ private IEnumerable GetPreviews(Series series, List e.EpisodeNumber).ToList(), - EpisodeFileId = file.Id, - ExistingPath = file.RelativePath, - NewPath = series.Path.GetRelativePath(newPath) - }; + { + SeriesId = series.Id, + SeasonNumber = seasonNumber, + EpisodeNumbers = episodesInFile.Select(e => e.EpisodeNumber).ToList(), + EpisodeFileId = file.Id, + ExistingPath = file.RelativePath, + NewPath = series.Path.GetRelativePath(newPath) + }; } } } @@ -132,7 +132,7 @@ private void RenameFiles(List episodeFiles, Series series) } catch (Exception ex) { - _logger.Error(ex, "Failed to rename file: " + episodeFilePath); + _logger.Error(ex, "Failed to rename file {0}", episodeFilePath); } } diff --git a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs index ecb96d9be..15843ef7b 100644 --- a/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs +++ b/src/NzbDrone.Core/Messaging/Commands/CommandExecutor.cs @@ -38,22 +38,22 @@ private void ExecuteCommands() { try { - ExecuteCommand((dynamic) command.Body, command); + ExecuteCommand((dynamic)command.Body, command); } catch (Exception ex) { - _logger.Error(ex, "Error occurred while executing task " + command.Name); + _logger.Error(ex, "Error occurred while executing task {0}", command.Name); } } } catch (ThreadAbortException ex) { - _logger.Error(ex, "Thread aborted: " + ex.Message); + _logger.Error(ex); Thread.ResetAbort(); } catch (Exception ex) { - _logger.Error(ex, "Unknown error in thread: " + ex.Message); + _logger.Error(ex, "Unknown error in thread"); } } @@ -104,7 +104,7 @@ private void ExecuteCommand(TCommand command, CommandModel commandMode _logger.Trace("{0} <- {1} [{2}]", command.GetType().Name, handler.GetType().Name, commandModel.Duration.ToString()); } - + private void BroadcastCommandUpdate(CommandModel command) { if (command.Body.SendUpdatesToClient) diff --git a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs index 2ab68ceca..a66d22c2c 100644 --- a/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs +++ b/src/NzbDrone.Core/Messaging/Events/EventAggregator.cs @@ -21,7 +21,7 @@ public EventAggregator(Logger logger, IServiceFactory serviceFactory) _taskFactory = new TaskFactory(); } - public void PublishEvent(TEvent @event) where TEvent : class ,IEvent + public void PublishEvent(TEvent @event) where TEvent : class, IEvent { Ensure.That(@event, () => @event).IsNotNull(); @@ -58,7 +58,7 @@ public void PublishEvent(TEvent @event) where TEvent : class ,IEvent } catch (Exception e) { - _logger.Error(e, string.Format("{0} failed while processing [{1}]", handler.GetType().Name, eventName)); + _logger.Error(e, "{0} failed while processing [{1}]", handler.GetType().Name, eventName); } } diff --git a/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs b/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs index 86738fbcc..61cd7e663 100644 --- a/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs +++ b/src/NzbDrone.Core/Notifications/Boxcar/BoxcarProxy.cs @@ -52,16 +52,16 @@ public ValidationFailure Test(BoxcarSettings settings) { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.Error(ex, "Access Token is invalid: " + ex.Message); + _logger.Error(ex, "Access Token is invalid"); return new ValidationFailure("Token", "Access Token is invalid"); } - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Token", "Unable to send test message"); } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("", "Unable to send test message"); } } @@ -84,7 +84,7 @@ private void SendNotification(string title, string message, RestRequest request, { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.Error(ex, "Access Token is invalid: " + ex.Message); + _logger.Error(ex, "Access Token is invalid"); throw; } diff --git a/src/NzbDrone.Core/Notifications/Email/EmailService.cs b/src/NzbDrone.Core/Notifications/Email/EmailService.cs index f1469d2e9..2599e5de4 100644 --- a/src/NzbDrone.Core/Notifications/Email/EmailService.cs +++ b/src/NzbDrone.Core/Notifications/Email/EmailService.cs @@ -68,7 +68,7 @@ public ValidationFailure Test(EmailSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test email: " + ex.Message); + _logger.Error(ex, "Unable to send test email"); return new ValidationFailure("Server", "Unable to send test email"); } diff --git a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs index 73f6bc3b5..e4d6c3d08 100644 --- a/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs +++ b/src/NzbDrone.Core/Notifications/Growl/GrowlService.cs @@ -152,7 +152,7 @@ public ValidationFailure Test(GrowlSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Join/JoinProxy.cs b/src/NzbDrone.Core/Notifications/Join/JoinProxy.cs index 13451c912..548fe6bde 100644 --- a/src/NzbDrone.Core/Notifications/Join/JoinProxy.cs +++ b/src/NzbDrone.Core/Notifications/Join/JoinProxy.cs @@ -34,7 +34,7 @@ public void SendNotification(string title, string message, JoinSettings settings catch (JoinException ex) { _logger.Error(ex, "Unable to send Join message."); - throw ex; + throw; } } diff --git a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs index d133687d7..c1280c309 100644 --- a/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs +++ b/src/NzbDrone.Core/Notifications/MediaBrowser/MediaBrowserService.cs @@ -52,7 +52,7 @@ public ValidationFailure Test(MediaBrowserSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Host", "Unable to send test message: " + ex.Message); } diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index 6ae201fb2..985126f19 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -42,7 +42,7 @@ private string GetMessage(Series series, List episodes, QualityModel qu qualityString += " Proper"; } } - + if (series.SeriesType == SeriesTypes.Daily) { var episode = episodes.First(); @@ -69,7 +69,7 @@ private string GetMessage(Series series, List episodes, QualityModel qu private bool ShouldHandleSeries(ProviderDefinition definition, Series series) { - var notificationDefinition = (NotificationDefinition) definition; + var notificationDefinition = (NotificationDefinition)definition; if (notificationDefinition.Tags.Empty()) { @@ -90,7 +90,8 @@ private bool ShouldHandleSeries(ProviderDefinition definition, Series series) public void Handle(EpisodeGrabbedEvent message) { - var grabMessage = new GrabMessage { + var grabMessage = new GrabMessage + { Message = GetMessage(message.Episode.Series, message.Episode.Episodes, message.Episode.ParsedEpisodeInfo.Quality), Series = message.Episode.Series, Quality = message.Episode.ParsedEpisodeInfo.Quality, @@ -107,7 +108,7 @@ public void Handle(EpisodeGrabbedEvent message) catch (Exception ex) { - _logger.Error(ex, "Unable to send OnGrab notification to: " + notification.Definition.Name); + _logger.Error(ex, "Unable to send OnGrab notification to {0}", notification.Definition.Name); } } } diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs index ce4d97790..070cf1591 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroidProxy.cs @@ -75,7 +75,7 @@ public ValidationFailure Test(NotifyMyAndroidSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs index 76a6a6a0d..476b9d27d 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClientService.cs @@ -63,7 +63,7 @@ public ValidationFailure Test(PlexClientSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs index 727c63e35..891815529 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServerService.cs @@ -175,12 +175,12 @@ public ValidationFailure Test(PlexServerSettings settings) } catch(PlexAuthenticationException ex) { - _logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message); + _logger.Error(ex, "Unable to connect to Plex Server"); return new ValidationFailure("Username", "Incorrect username or password"); } catch (Exception ex) { - _logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message); + _logger.Error(ex, "Unable to connect to Plex Server"); return new ValidationFailure("Host", "Unable to connect to Plex Server"); } diff --git a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs index bf56dbad3..7b70a8b6e 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/ProwlService.cs @@ -94,7 +94,7 @@ public ValidationFailure Test(ProwlSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs index 753a95d2b..497d8e7f0 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBulletProxy.cs @@ -42,7 +42,7 @@ public void SendNotification(string title, string message, PushBulletSettings se } catch (PushBulletException ex) { - _logger.Error(ex, "Unable to send test message to: " + channelTag); + _logger.Error(ex, "Unable to send test message to {0}", channelTag); error = true; } } @@ -61,7 +61,7 @@ public void SendNotification(string title, string message, PushBulletSettings se } catch (PushBulletException ex) { - _logger.Error(ex, "Unable to send test message to: " + deviceId); + _logger.Error(ex, "Unable to send test message to {0}", deviceId); error = true; } } @@ -101,16 +101,16 @@ public ValidationFailure Test(PushBulletSettings settings) { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.Error(ex, "API Key is invalid: " + ex.Message); + _logger.Error(ex, "API Key is invalid"); return new ValidationFailure("ApiKey", "API Key is invalid"); } - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("ApiKey", "Unable to send test message"); } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("", "Unable to send test message"); } @@ -165,7 +165,7 @@ private void SendNotification(string title, string message, RestRequest request, { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.Error(ex, "API Key is invalid: " + ex.Message); + _logger.Error(ex, "API Key is invalid"); throw; } diff --git a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs index 97b3215d8..574441e65 100644 --- a/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs +++ b/src/NzbDrone.Core/Notifications/Pushalot/PushalotProxy.cs @@ -73,30 +73,30 @@ public ValidationFailure Test(PushalotSettings settings) { if (ex.Response.StatusCode == HttpStatusCode.Unauthorized) { - _logger.Error(ex, "Authentication Token is invalid: " + ex.Message); + _logger.Error(ex, "Authentication Token is invalid"); return new ValidationFailure("AuthToken", "Authentication Token is invalid"); } if (ex.Response.StatusCode == HttpStatusCode.NotAcceptable) { - _logger.Error(ex, "Message limit reached: " + ex.Message); + _logger.Error(ex, "Message limit reached"); return new ValidationFailure("AuthToken", "Message limit reached"); } if (ex.Response.StatusCode == HttpStatusCode.Gone) { - _logger.Error(ex, "Authorization Token is no longer valid: " + ex.Message); + _logger.Error(ex, "Authorization Token is no longer valid"); return new ValidationFailure("AuthToken", "Authorization Token is no longer valid, please use a new one."); } var response = Json.Deserialize(ex.Response.Content); - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("AuthToken", response.Description); } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs index 940ab9ffd..63684f012 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/PushoverService.cs @@ -59,7 +59,7 @@ public ValidationFailure Test(PushoverSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("ApiKey", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Notifications/Telegram/TelegramService.cs b/src/NzbDrone.Core/Notifications/Telegram/TelegramService.cs index e7259d753..a0cb33a82 100644 --- a/src/NzbDrone.Core/Notifications/Telegram/TelegramService.cs +++ b/src/NzbDrone.Core/Notifications/Telegram/TelegramService.cs @@ -51,7 +51,7 @@ public ValidationFailure Test(TelegramSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); var restException = ex as RestException; diff --git a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs index 6c894b228..cf3c687fa 100644 --- a/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs +++ b/src/NzbDrone.Core/Notifications/Twitter/TwitterService.cs @@ -131,7 +131,7 @@ public ValidationFailure Test(TwitterSettings settings) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Host", "Unable to send test message"); } return null; diff --git a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs index 84127f69f..d9cacf8f8 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/XbmcService.cs @@ -115,7 +115,7 @@ public ValidationFailure Test(XbmcSettings settings, string message) } catch (Exception ex) { - _logger.Error(ex, "Unable to send test message: " + ex.Message); + _logger.Error(ex, "Unable to send test message"); return new ValidationFailure("Host", "Unable to send test message"); } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index df9b19679..e40501e8b 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -401,7 +401,7 @@ public static ParsedEpisodeInfo ParseTitle(string title) catch (Exception e) { if (!title.ToLower().Contains("password") && !title.ToLower().Contains("yenc")) - Logger.Error(e, "An error has occurred while trying to parse " + title); + Logger.Error(e, "An error has occurred while trying to parse {0}", title); } Logger.Debug("Unable to parse {0}", title); @@ -500,7 +500,7 @@ public static string RemoveFileExtension(string title) return title; } - + private static SeriesTitleInfo GetSeriesTitleInfo(string title) { var seriesTitleInfo = new SeriesTitleInfo(); diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index f1a1145e9..851dddc8f 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -78,7 +78,7 @@ public List AllWithUnmappedFolders() //We don't want an exception to prevent the root folders from loading in the UI, so they can still be deleted catch (Exception ex) { - _logger.Error(ex, "Unable to get free space and unmapped folders for root folder: " + folder.Path); + _logger.Error(ex, "Unable to get free space and unmapped folders for root folder {0}", folder.Path); folder.FreeSpace = 0; folder.UnmappedFolders = new List(); } diff --git a/src/NzbDrone.Core/Tv/MoveSeriesService.cs b/src/NzbDrone.Core/Tv/MoveSeriesService.cs index 30abcb487..a6ffb0578 100644 --- a/src/NzbDrone.Core/Tv/MoveSeriesService.cs +++ b/src/NzbDrone.Core/Tv/MoveSeriesService.cs @@ -53,9 +53,7 @@ public void Execute(MoveSeriesCommand message) } catch (IOException ex) { - var errorMessage = string.Format("Unable to move series from '{0}' to '{1}'", source, destination); - - _logger.Error(ex, errorMessage); + _logger.Error(ex, "Unable to move series from '{0}' to '{1}'", source, destination); throw; } diff --git a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs index 5b4a07234..b81292219 100644 --- a/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs +++ b/src/NzbDrone.Core/Tv/RefreshEpisodeService.cs @@ -77,7 +77,7 @@ public void RefreshEpisodeInfo(Series series, IEnumerable remoteEpisode } catch (Exception e) { - _logger.Fatal(e, "An error has occurred while updating episode info for series {0}. {1}", series, episode)); + _logger.Fatal(e, "An error has occurred while updating episode info for series {0}. {1}", series, episode); failCount++; } } diff --git a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs index c39deeffb..f177b5857 100644 --- a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs +++ b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs @@ -51,7 +51,7 @@ private void RefreshSeriesInfo(Series series) _logger.ProgressInfo("Updating Info for {0}", series.Title); Tuple> tuple; - + try { tuple = _seriesInfo.GetSeriesInfo(series.TvdbId); @@ -167,7 +167,7 @@ public void Execute(RefreshSeriesCommand message) } catch (Exception e) { - _logger.Error(e, "Couldn't refresh info for {0}".Inject(series)); + _logger.Error(e, "Couldn't refresh info for {0}", series); } } @@ -180,7 +180,7 @@ public void Execute(RefreshSeriesCommand message) } catch (Exception e) { - _logger.Error(e, "Couldn't rescan series {0}".Inject(series)); + _logger.Error(e, "Couldn't rescan series {0}", series); } } } diff --git a/src/NzbDrone.Core/Update/InstallUpdateService.cs b/src/NzbDrone.Core/Update/InstallUpdateService.cs index e5ef7fa30..c4b345fcc 100644 --- a/src/NzbDrone.Core/Update/InstallUpdateService.cs +++ b/src/NzbDrone.Core/Update/InstallUpdateService.cs @@ -148,7 +148,7 @@ private void EnsureValidBranch(UpdatePackage package) } catch (Exception e) { - _logger.Error(e, string.Format("Couldn't change the branch from [{0}] to [{1}].", currentBranch, package.Branch)); + _logger.Error(e, "Couldn't change the branch from [{0}] to [{1}].", currentBranch, package.Branch); } } } diff --git a/src/NzbDrone.Host/BrowserService.cs b/src/NzbDrone.Host/BrowserService.cs index 1867421cf..7ccf23b59 100644 --- a/src/NzbDrone.Host/BrowserService.cs +++ b/src/NzbDrone.Host/BrowserService.cs @@ -43,7 +43,7 @@ public void LaunchWebUI() } catch (Exception e) { - _logger.Error(e, "Couldn't open default browser to " + url); + _logger.Error(e, "Couldn't open default browser to {0}", url); } } } diff --git a/src/NzbDrone.Host/PlatformValidation.cs b/src/NzbDrone.Host/PlatformValidation.cs index a4dce7bc8..ccd9ef145 100644 --- a/src/NzbDrone.Host/PlatformValidation.cs +++ b/src/NzbDrone.Host/PlatformValidation.cs @@ -9,7 +9,7 @@ namespace NzbDrone.Host { public static class PlatformValidation { - private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(PlatformValidation)); + private static readonly Logger Logger = NzbDroneLogger.GetLogger(typeof(PlatformValidation)); private const string DOWNLOAD_LINK = "http://www.microsoft.com/en-us/download/details.aspx?id=42643"; @@ -49,7 +49,7 @@ private static bool IsAssemblyAvailable(string assemblyString) } catch (Exception e) { - Logger.Warn("Couldn't load {0}", e.Message); + Logger.Warn(e, "Couldn't load {0}", assemblyString); return false; } diff --git a/src/NzbDrone.Mono/Disk/DiskProvider.cs b/src/NzbDrone.Mono/Disk/DiskProvider.cs index fc2a4e33d..d9f3cba29 100644 --- a/src/NzbDrone.Mono/Disk/DiskProvider.cs +++ b/src/NzbDrone.Mono/Disk/DiskProvider.cs @@ -54,7 +54,7 @@ public override IMount GetMount(string path) } catch (InvalidOperationException ex) { - Logger.Error(ex, "Couldn't get free space for " + path); + Logger.Error(ex, "Couldn't get free space for {0}", path); } return null; @@ -107,7 +107,7 @@ public override List GetMounts() } catch (InvalidOperationException e) { - Logger.Error(e, "Couldn't get total space for " + path); + Logger.Error(e, "Couldn't get total space for {0}", path); } return null; @@ -207,7 +207,7 @@ private uint GetGroupId(string group) return g.gr_gid; - + } } } diff --git a/src/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs b/src/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs index 0a1bc9147..279ee8a56 100644 --- a/src/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs +++ b/src/NzbDrone.Update/UpdateEngine/StartNzbDrone.cs @@ -40,7 +40,7 @@ public void Start(AppType appType, string installationFolder) } catch (InvalidOperationException e) { - _logger.Warn("Couldn't start NzbDrone Service (Most likely due to permission issues). falling back to console.", e); + _logger.Warn(e, "Couldn't start NzbDrone Service (Most likely due to permission issues). falling back to console."); StartConsole(installationFolder); } } diff --git a/src/NzbDrone.sln.DotSettings b/src/NzbDrone.sln.DotSettings index 260cae878..1d351d0ce 100644 --- a/src/NzbDrone.sln.DotSettings +++ b/src/NzbDrone.sln.DotSettings @@ -4,10 +4,12 @@ DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW + ERROR ERROR ERROR DO_NOT_SHOW ERROR + ERROR HINT WARNING WARNING