Updated NLog to v4.2.3.

This commit is contained in:
Taloth Saldono 2016-02-11 22:13:42 +01:00
parent e01b2ef25c
commit 6a90035a4c
144 changed files with 305 additions and 5579 deletions

View file

@ -51,8 +51,9 @@
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -79,6 +80,7 @@
</ItemGroup>
<ItemGroup>
<None Include="fastJSON\license.txt" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>

View file

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NLog" version="2.1.0" targetFramework="net40" />
</packages>
<package id="NLog" version="4.2.3" targetFramework="net40" />
</packages>

View file

@ -26,7 +26,7 @@ public Response HandleException(NancyContext context, Exception exception)
if (apiException != null)
{
_logger.WarnException("API Error", apiException);
_logger.Warn(apiException, "API Error");
return apiException.ToErrorResponse();
}
@ -65,10 +65,10 @@ public Response HandleException(NancyContext context, Exception exception)
var sqlErrorMessage = string.Format("[{0} {1}]", context.Request.Method, context.Request.Path);
_logger.ErrorException(sqlErrorMessage, sqLiteException);
_logger.Error(sqLiteException, sqlErrorMessage);
}
_logger.FatalException("Request Failed", exception);
_logger.Fatal(exception, "Request Failed");
return new ErrorModel
{

View file

@ -60,7 +60,7 @@ private Response CompressResponse(Request request, Response response)
catch (Exception ex)
{
_logger.ErrorException("Unable to gzip response", ex);
_logger.Error(ex, "Unable to gzip response");
throw;
}
}

View file

@ -68,7 +68,7 @@ private Response DownloadRelease(ReleaseResource release)
}
catch (ReleaseDownloadException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
throw new NzbDroneClientException(HttpStatusCode.Conflict, "Getting release from indexer failed");
}
@ -96,7 +96,7 @@ private List<ReleaseResource> GetEpisodeReleases(int episodeId)
}
catch (Exception ex)
{
_logger.ErrorException("Episode search failed: " + ex.Message, ex);
_logger.Error(ex, "Episode search failed: " + ex.Message);
}
return new List<ReleaseResource>();

View file

@ -59,6 +59,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Data" />
@ -66,9 +70,6 @@
<Reference Include="DDay.iCal">
<HintPath>..\packages\DDay.iCal.1.0.2.575\lib\DDay.iCal.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Omu.ValueInjecter">
<HintPath>..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll</HintPath>
</Reference>
@ -278,4 +279,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -6,6 +6,6 @@
<package id="Nancy.Authentication.Basic" version="0.23.2" targetFramework="net40" />
<package id="Nancy.Authentication.Forms" version="0.23.2" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="ValueInjecter" version="2.3.3" targetFramework="net40" />
</packages>

View file

@ -45,6 +45,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -60,9 +64,6 @@
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ContainerFixture.cs" />

View file

@ -3,6 +3,6 @@
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NBuilder" version="3.0.1.1" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
</packages>

View file

@ -46,6 +46,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -58,9 +62,6 @@
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="WebDriver, Version=2.48.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Selenium.WebDriver.2.48.0\lib\net40\WebDriver.dll</HintPath>
@ -102,4 +103,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="Selenium.Support" version="2.48.0" targetFramework="net40" />
<package id="Selenium.WebDriver" version="2.48.0" targetFramework="net40" />

View file

@ -45,6 +45,10 @@
<HintPath>..\packages\FluentAssertions.4.2.1\lib\net40\FluentAssertions.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -60,9 +64,6 @@
<Reference Include="Moq">
<HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="CacheTests\CachedFixture.cs" />
@ -151,4 +152,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -2,6 +2,6 @@
<packages>
<package id="FluentAssertions" version="4.2.1" targetFramework="net40" />
<package id="Moq" version="4.0.10827" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
</packages>

View file

@ -304,7 +304,7 @@ public void SetPermissions(string filename, WellKnownSidType accountSid, FileSys
}
catch (Exception e)
{
Logger.WarnException(string.Format("Couldn't set permission for {0}. account:{1} rights:{2} accessControlType:{3}", filename, accountSid, rights, controlType), e);
Logger.Warn(e, string.Format("Couldn't set permission for {0}. account:{1} rights:{2} accessControlType:{3}", filename, accountSid, rights, controlType));
throw;
}
@ -394,7 +394,7 @@ public virtual IMount GetMount(string path)
}
catch (Exception ex)
{
Logger.DebugException(string.Format("Failed to get mount for path {0}", path), ex);
Logger.Debug(ex, string.Format("Failed to get mount for path {0}", path));
return null;
}
}

View file

@ -259,7 +259,7 @@ private void RollbackPartialMove(string sourcePath, string targetPath)
}
catch (Exception ex)
{
_logger.ErrorException(string.Format("Failed to properly rollback the file move [{0}] to [{1}], incomplete file may be left in target path.", sourcePath, targetPath), 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));
}
}
@ -275,7 +275,7 @@ private void RollbackMove(string sourcePath, string targetPath)
}
catch (Exception ex)
{
_logger.ErrorException(string.Format("Failed to properly rollback the file move [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath), 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));
}
}
@ -294,7 +294,7 @@ private void RollbackCopy(string sourcePath, string targetPath)
}
catch (Exception ex)
{
_logger.ErrorException(string.Format("Failed to properly rollback the file copy [{0}] to [{1}], file may be left in target path.", sourcePath, targetPath), 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));
}
}

View file

@ -43,7 +43,7 @@ private void SetPermissions()
}
catch (Exception ex)
{
_logger.WarnException("Coudn't set app folder permission", ex);
_logger.Warn(ex, "Coudn't set app folder permission");
}
}
}

View file

@ -60,7 +60,7 @@ public bool IsAdmin
}
catch (Exception ex)
{
_logger.WarnException("Error checking if the current user is an administrator.", ex);
_logger.Warn(ex, "Error checking if the current user is an administrator.");
return false;
}
}

View file

@ -29,7 +29,7 @@ public static bool CheckAvailability()
}
catch (Exception ex)
{
_logger.TraceException("Initializing curl failed", ex);
_logger.Trace(ex, "Initializing curl failed");
return false;
}
}

View file

@ -177,7 +177,7 @@ public void DownloadFile(string url, string fileName)
}
catch (Exception e)
{
_logger.WarnException("Failed to get response from: " + url, e);
_logger.Warn(e, "Failed to get response from: " + url);
throw;
}
}

View file

@ -53,7 +53,7 @@ private string DownloadString(string url, ICredentials identity)
}
catch (Exception e)
{
_logger.WarnException("Failed to get response from: " + url, e);
_logger.Warn(e, "Failed to get response from: " + url);
throw;
}
}

View file

@ -19,7 +19,7 @@ private static void HandleTaskException(object sender, UnobservedTaskExceptionEv
var exception = e.Exception;
Console.WriteLine("Task Error: {0}", exception);
Logger.ErrorException("Task Error: " + exception.Message, exception);
Logger.Error(exception, "Task Error: " + exception.Message);
}
private static void HandleAppDomainException(object sender, UnhandledExceptionEventArgs e)
@ -40,13 +40,13 @@ private static void HandleAppDomainException(object sender, UnhandledExceptionEv
if (exception is TypeInitializationException && exception.InnerException is DllNotFoundException ||
exception is DllNotFoundException)
{
Logger.DebugException("Minor Fail: " + exception.Message, exception);
Logger.Debug(exception, "Minor Fail: " + exception.Message);
return;
}
}
Console.WriteLine("EPIC FAIL: {0}", exception);
Logger.FatalException("EPIC FAIL: " + exception.Message, exception);
Logger.Fatal(exception, "EPIC FAIL: " + exception.Message);
}
}
}

View file

@ -43,6 +43,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
@ -53,9 +57,6 @@
<Reference Include="ICSharpCode.SharpZipLib">
<HintPath>..\packages\ICSharpCode.SharpZipLib.Patched.0.86.5\lib\net20\ICSharpCode.SharpZipLib.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>

View file

@ -37,7 +37,7 @@ public void Write()
}
catch (Exception ex)
{
_logger.ErrorException("Unable to write PID file: " + filename, ex);
_logger.Error(ex, "Unable to write PID file: " + filename);
throw;
}
}

View file

@ -292,7 +292,7 @@ private ProcessInfo ConvertToProcessInfo(Process process)
}
catch (Win32Exception e)
{
_logger.WarnException("Couldn't get process info for " + process.ProcessName, e);
_logger.Warn(e, "Couldn't get process info for " + process.ProcessName);
}
return processInfo;

View file

@ -17,7 +17,7 @@ public static Task LogExceptions(this Task task)
var aggregateException = t.Exception.Flatten();
foreach (var exception in aggregateException.InnerExceptions)
{
Logger.ErrorException("Task Error", exception);
Logger.Error(exception, "Task Error");
}
}
}, TaskContinuationOptions.OnlyOnFaulted);

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="ICSharpCode.SharpZipLib.Patched" version="0.86.5" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
</packages>

View file

@ -32,7 +32,7 @@ public static void Main(string[] args)
{
System.Console.WriteLine("");
System.Console.WriteLine("");
Logger.FatalException("EPIC FAIL!", e);
Logger.Fatal(e, "EPIC FAIL!");
System.Console.WriteLine("Press any key to exit...");
System.Console.ReadLine();
Environment.Exit(1);

View file

@ -75,11 +75,12 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Owin">
<HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
</Reference>
@ -150,4 +151,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -3,6 +3,6 @@
<package id="Microsoft.Owin" version="2.1.0" targetFramework="net40" />
<package id="Microsoft.Owin.Hosting" version="2.1.0" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="Owin" version="1.0" targetFramework="net40" />
</packages>
</packages>

View file

@ -83,7 +83,7 @@ public void write_log_exception()
{
var ex = new InvalidOperationException("Fake Exception");
_logger.ErrorException(_uniqueMessage, ex);
_logger.Error(ex, _uniqueMessage);
VerifyLog(StoredModel, LogLevel.Error);
@ -102,7 +102,7 @@ public void exception_log_with_no_message_should_use_exceptions_message()
_uniqueMessage = string.Empty;
_logger.ErrorException(_uniqueMessage, ex);
_logger.Error(ex, _uniqueMessage);
StoredModel.Message.Should().Be(ex.Message);

View file

@ -68,6 +68,10 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Newtonsoft.Json.6.0.6\lib\net40\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="NLog, Version=4.0.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL">
<HintPath>..\packages\NLog.4.2.3\lib\net40\NLog.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
@ -96,9 +100,6 @@
<Reference Include="NCrunch.Framework">
<HintPath>..\packages\NCrunch.Framework.1.46.0.9\lib\net35\NCrunch.Framework.dll</HintPath>
</Reference>
<Reference Include="NLog">
<HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath>
</Reference>
<Reference Include="Prowlin">
<HintPath>..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll</HintPath>
</Reference>
@ -554,4 +555,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>

View file

@ -10,7 +10,7 @@
<package id="NBuilder" version="3.0.1.1" />
<package id="NCrunch.Framework" version="1.46.0.9" targetFramework="net40" />
<package id="Newtonsoft.Json" version="6.0.6" targetFramework="net40" />
<package id="NLog" version="2.1.0" targetFramework="net40" />
<package id="NLog" version="4.2.3" targetFramework="net40" />
<package id="NUnit" version="2.6.3" targetFramework="net40" />
<package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" />
<package id="Unity" version="2.1.505.2" targetFramework="net40" />

View file

@ -35,7 +35,7 @@ public IEnumerable<int> GetDailySeriesIds()
}
catch (Exception ex)
{
_logger.WarnException("Failed to get Daily Series", ex);
_logger.Warn(ex, "Failed to get Daily Series");
return new List<int>();
}
}

View file

@ -139,7 +139,7 @@ private void UpdateMappings()
}
catch (Exception ex)
{
_logger.ErrorException("Failed to Update Scene Mappings:", ex);
_logger.Error(ex, "Failed to Update Scene Mappings:");
}
}

View file

@ -84,7 +84,7 @@ private void PerformUpdate(Series series)
}
catch (Exception ex)
{
_logger.ErrorException("Error updating scene numbering mappings for: " + series, ex);
_logger.Error(ex, "Error updating scene numbering mappings for: " + series);
}
}

View file

@ -50,7 +50,7 @@ public void Vacuum()
}
catch (Exception e)
{
_logger.ErrorException("An Error occurred while vacuuming database.", e);
_logger.Error(e, "An Error occurred while vacuuming database.");
}
}
}

View file

@ -47,7 +47,7 @@ public void Error(string message)
public void Error(Exception exception)
{
_logger.ErrorException(exception.Message, exception);
_logger.Error(exception, exception.Message);
}
public void Write(string message, bool escaped)

View file

@ -95,7 +95,7 @@ private IEnumerable<DownloadDecision> GetDecisions(List<ReleaseInfo> reports, Se
}
catch (Exception e)
{
_logger.ErrorException("Couldn't process release.", e);
_logger.Error(e, "Couldn't process release.");
}
reportNumber++;
@ -140,7 +140,7 @@ private Rejection EvaluateSpec(IDecisionEngineSpecification spec, RemoteEpisode
{
e.Data.Add("report", remoteEpisode.Release.ToJson());
e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson());
_logger.ErrorException("Couldn't evaluate decision on " + remoteEpisode.Release.Title, e);
_logger.Error(e, "Couldn't evaluate decision on " + remoteEpisode.Release.Title);
return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message));
}

View file

@ -91,7 +91,7 @@ private IEnumerable<DiskSpace> GetDiskSpace(IEnumerable<string> paths, bool supp
{
if (!suppressWarnings)
{
_logger.WarnException("Unable to get free space for: " + path, ex);
_logger.Warn(ex, "Unable to get free space for: " + path);
}
}

View file

@ -100,7 +100,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -204,12 +204,12 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Password", "Authentication failed");
}
catch (WebException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
switch (ex.Status)
{
case WebExceptionStatus.ConnectFailure:
@ -233,7 +233,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -284,7 +284,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View file

@ -172,7 +172,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}
@ -193,7 +193,7 @@ private ValidationFailure TestApiVersion()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to NZBVortex");
}

View file

@ -56,7 +56,7 @@ private IEnumerable<DownloadClientItem> GetQueue()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -120,7 +120,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -284,7 +284,7 @@ private ValidationFailure TestConnection()
{
return new ValidationFailure("Username", "Authentication failed");
}
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to NZBGet");
}

View file

@ -107,7 +107,7 @@ private IEnumerable<DownloadClientItem> GetHistory()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -267,7 +267,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new ValidationFailure("Host", "Unable to connect to SABnzbd");
}

View file

@ -100,7 +100,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -218,7 +218,7 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = "Please verify your username and password. Also verify if the host running Sonarr isn't blocked from accessing Transmission by WhiteList limitations in the Transmission configuration."
@ -226,7 +226,7 @@ private ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -238,7 +238,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -253,7 +253,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View file

@ -98,7 +98,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -230,7 +230,7 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = "Please verify your username and password."
@ -238,7 +238,7 @@ private ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -250,7 +250,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(String.Empty, "Unknown exception: " + ex.Message);
}
@ -265,7 +265,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(String.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View file

@ -159,7 +159,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -208,7 +208,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -223,7 +223,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View file

@ -81,7 +81,7 @@ public override IEnumerable<DownloadClientItem> GetItems()
}
catch (DownloadClientException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return Enumerable.Empty<DownloadClientItem>();
}
@ -208,7 +208,7 @@ private ValidationFailure TestConnection()
}
catch (DownloadClientAuthenticationException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure("Username", "Authentication failure")
{
DetailedDescription = "Please verify your username and password."
@ -216,7 +216,7 @@ private ValidationFailure TestConnection()
}
catch (WebException ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
if (ex.Status == WebExceptionStatus.ConnectFailure)
{
return new NzbDroneValidationFailure("Host", "Unable to connect")
@ -228,7 +228,7 @@ private ValidationFailure TestConnection()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Unknown exception: " + ex.Message);
}
@ -243,7 +243,7 @@ private ValidationFailure TestGetTorrents()
}
catch (Exception ex)
{
_logger.ErrorException(ex.Message, ex);
_logger.Error(ex, ex.Message);
return new NzbDroneValidationFailure(string.Empty, "Failed to get the list of torrents: " + ex.Message);
}

View file

@ -127,7 +127,7 @@ protected virtual void DeleteItemData(string downloadId)
}
catch (Exception ex)
{
_logger.WarnException(string.Format("[{0}] Error occurred while trying to delete data from '{1}'.", item.Title, item.OutputPath), ex);
_logger.Warn(ex, string.Format("[{0}] Error occurred while trying to delete data from '{1}'.", item.Title, item.OutputPath));
}
}
@ -141,7 +141,7 @@ public ValidationResult Test()
}
catch (Exception ex)
{
_logger.ErrorException("Test aborted due to exception", ex);
_logger.Error(ex, "Test aborted due to exception");
failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
}

View file

@ -74,7 +74,7 @@ private void RemoveFromDownloadClient(TrackedDownload trackedDownload)
}
catch (Exception e)
{
_logger.ErrorException("Couldn't remove item from client " + trackedDownload.DownloadItem.Title, e);
_logger.Error(e, "Couldn't remove item from client " + trackedDownload.DownloadItem.Title);
}
}
}

View file

@ -78,7 +78,7 @@ public ProcessedDecisions ProcessDecisions(List<DownloadDecision> decisions)
{
//TODO: support for store & forward
//We'll need to differentiate between a download client error and an indexer error
_logger.WarnException("Couldn't add report to download queue. " + remoteEpisode, e);
_logger.Warn(e, "Couldn't add report to download queue. " + remoteEpisode);
}
}

View file

@ -130,15 +130,13 @@ private string DownloadFromWebUrl(RemoteEpisode remoteEpisode, string torrentUrl
}
catch (HttpException ex)
{
_logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})",
remoteEpisode.Release.Title, torrentUrl), ex);
_logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex);
}
catch (WebException ex)
{
_logger.ErrorException(string.Format("Downloading torrent file for episode '{0}' failed ({1})",
remoteEpisode.Release.Title, torrentUrl), ex);
_logger.Error(ex, "Downloading torrent file for episode '{0}' failed ({1})", remoteEpisode.Release.Title, torrentUrl);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading torrent failed", ex);
}
@ -168,8 +166,7 @@ private string DownloadFromMagnetUrl(RemoteEpisode remoteEpisode, string magnetU
}
catch (FormatException ex)
{
_logger.ErrorException(string.Format("Failed to parse magnetlink for episode '{0}': '{1}'",
remoteEpisode.Release.Title, magnetUrl), ex);
_logger.Error(ex, "Failed to parse magnetlink for episode '{0}': '{1}'", remoteEpisode.Release.Title, magnetUrl);
return null;
}

View file

@ -87,7 +87,7 @@ private List<TrackedDownload> ProcessClientDownloads(IDownloadClient downloadCli
}
catch (Exception ex)
{
_logger.WarnException("Unable to retrieve queue and history items from " + downloadClient.Definition.Name, ex);
_logger.Warn(ex, "Unable to retrieve queue and history items from " + downloadClient.Definition.Name);
}
foreach (var downloadItem in downloadClientHistory)
@ -135,7 +135,7 @@ private List<TrackedDownload> ProcessClientItems(IDownloadClient downloadClient,
}
catch (Exception e)
{
_logger.ErrorException("Couldn't process tracked download " + downloadItem.Title, e);
_logger.Error(e, "Couldn't process tracked download " + downloadItem.Title);
}
return trackedDownloads;

View file

@ -93,7 +93,7 @@ public TrackedDownload TrackDownload(DownloadClientDefinition downloadClient, Do
}
catch (Exception e)
{
_logger.DebugException("Failed to find episode for " + downloadItem.Title, e);
_logger.Debug(e, "Failed to find episode for " + downloadItem.Title);
return null;
}

View file

@ -53,15 +53,13 @@ public override string Download(RemoteEpisode remoteEpisode)
}
catch (HttpException ex)
{
_logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})",
remoteEpisode.Release.Title, url), ex);
_logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex);
}
catch (WebException ex)
{
_logger.ErrorException(string.Format("Downloading nzb for episode '{0}' failed ({1})",
remoteEpisode.Release.Title, url), ex);
_logger.Error(ex, "Downloading nzb for episode '{0}' failed ({1})", remoteEpisode.Release.Title, url);
throw new ReleaseDownloadException(remoteEpisode.Release, "Downloading nzb failed", ex);
}

View file

@ -35,7 +35,7 @@ public override HealthCheck Check()
{
var message = String.Format("Unable to communicate with {0}.", downloadClient.Definition.Name);
_logger.ErrorException(message, ex);
_logger.Error(ex, message);
return new HealthCheck(GetType(), HealthCheckResult.Error, message + " " + ex.Message);
}
}

View file

@ -50,7 +50,7 @@ public void Clean()
}
catch (Exception e)
{
_logger.ErrorException("Couldn't validate image " + image.RelativePath, e);
_logger.Error(e, "Couldn't validate image " + image.RelativePath);
}
}
}

View file

@ -37,7 +37,7 @@ private void Clean()
}
catch (Exception ex)
{
_logger.ErrorException("Error running housekeeping task: " + housekeeper.GetType().Name, ex);
_logger.Error(ex, "Error running housekeeping task: " + housekeeper.GetType().Name);
}
}

View file

@ -57,7 +57,7 @@ private void SearchForMissingEpisodes(List<Episode> episodes)
catch (Exception ex)
{
var message = String.Format("Unable to search for missing episodes in season {0} of [{1}]", season.Key, series.Key);
_logger.ErrorException(message, ex);
_logger.Error(ex, message);
continue;
}
}
@ -71,7 +71,7 @@ private void SearchForMissingEpisodes(List<Episode> episodes)
catch (Exception ex)
{
var message = String.Format("Unable to search for missing episode: [{0}]", season.First());
_logger.ErrorException(message, ex);
_logger.Error(ex, message);
continue;
}
}

View file

@ -272,7 +272,7 @@ private List<DownloadDecision> Dispatch(Func<IIndexer, IEnumerable<ReleaseInfo>>
}
catch (Exception e)
{
_logger.ErrorException("Error while searching for " + criteriaBase, e);
_logger.Error(e, "Error while searching for " + criteriaBase);
}
}).LogExceptions());
}

View file

@ -249,13 +249,13 @@ protected virtual IList<ReleaseInfo> FetchReleases(IndexerPageableRequestChain p
{
_indexerStatusService.RecordFailure(Definition.Id);
var message = string.Format("{0} - {1}", ex.Message, url);
_logger.WarnException(message, ex);
_logger.Warn(ex, message);
}
catch (Exception feedEx)
{
_indexerStatusService.RecordFailure(Definition.Id);
feedEx.Data.Add("FeedUrl", url);
_logger.ErrorException("An error occurred while processing feed. " + url, feedEx);
_logger.Error(feedEx, "An error occurred while processing feed. " + url);
}
return CleanupReleases(releases);
@ -315,19 +315,19 @@ protected virtual ValidationFailure TestConnection()
}
catch (UnsupportedFeedException ex)
{
_logger.WarnException("Indexer feed is not supported", ex);
_logger.Warn(ex, "Indexer feed is not supported");
return new ValidationFailure(string.Empty, "Indexer feed is not supported: " + ex.Message);
}
catch (IndexerException ex)
{
_logger.WarnException("Unable to connect to indexer", ex);
_logger.Warn(ex, "Unable to connect to indexer");
return new ValidationFailure(string.Empty, "Unable to connect to indexer. " + ex.Message);
}
catch (Exception ex)
{
_logger.WarnException("Unable to connect to indexer", ex);
_logger.Warn(ex, "Unable to connect to indexer");
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
}

View file

@ -106,7 +106,7 @@ public ValidationResult Test()
}
catch (Exception ex)
{
_logger.ErrorException("Test aborted due to exception", ex);
_logger.Error(ex, "Test aborted due to exception");
failures.Add(new ValidationFailure(string.Empty, "Test was aborted due to an error: " + ex.Message));
}

View file

@ -120,7 +120,7 @@ protected virtual ValidationFailure TestCapabilities()
}
catch (Exception ex)
{
_logger.WarnException("Unable to connect to indexer: " + ex.Message, ex);
_logger.Warn(ex, "Unable to connect to indexer: " + ex.Message);
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
}

View file

@ -56,7 +56,7 @@ private NewznabCapabilities FetchCapabilities(NewznabSettings indexerSettings)
}
catch (Exception ex)
{
_logger.DebugException(string.Format("Failed to get capabilities from {0}: {1}", indexerSettings.Url, ex.Message), ex);
_logger.Debug(ex, string.Format("Failed to get capabilities from {0}: {1}", indexerSettings.Url, ex.Message));
}
return capabilities;

View file

@ -63,7 +63,7 @@ public virtual IList<ReleaseInfo> ParseResponse(IndexerResponse indexerResponse)
catch (Exception itemEx)
{
itemEx.Data.Add("Item", item.Title());
_logger.ErrorException("An error occurred while processing feed item from " + indexerResponse.Request.Url, itemEx);
_logger.Error(itemEx, "An error occurred while processing feed item from " + indexerResponse.Request.Url);
}
}
@ -277,7 +277,7 @@ protected virtual string ParseUrl(string value)
}
catch (Exception ex)
{
_logger.DebugException(string.Format("Failed to parse Uri {0}, ignoring.", value), ex);
_logger.Debug(ex, string.Format("Failed to parse Uri {0}, ignoring.", value));
return null;
}
}

View file

@ -50,7 +50,7 @@ public TorrentRssIndexerParserSettings Detect(TorrentRssIndexerSettings indexerS
}
catch (Exception ex)
{
_logger.WarnException(string.Format("Unable to connect to indexer {0}: {1}", request.Url, ex.Message), ex);
_logger.Warn(ex, string.Format("Unable to connect to indexer {0}: {1}", request.Url, ex.Message));
return null;
}
@ -100,7 +100,7 @@ private TorrentRssIndexerParserSettings GetEzrssParserSettings(IndexerResponse r
}
catch (Exception ex)
{
_logger.TraceException("Feed wasn't parsable by Ezrss Parser", ex);
_logger.Trace(ex, "Feed wasn't parsable by Ezrss Parser");
return null;
}
}
@ -233,7 +233,7 @@ private TorrentInfo[] ParseResponse(IParseIndexerResponse parser, IndexerRespons
}
catch (Exception ex)
{
_logger.DebugException("Unable to parse indexer feed: " + ex.Message, ex);
_logger.Debug(ex, "Unable to parse indexer feed: " + ex.Message);
throw new UnsupportedFeedException("Unable to parse indexer: " + ex.Message);
}
}

View file

@ -111,12 +111,10 @@ protected virtual ValidationFailure TestCapabilities()
}
catch (Exception ex)
{
_logger.WarnException("Unable to connect to indexer: " + ex.Message, ex);
_logger.Warn(ex, "Unable to connect to indexer: " + ex.Message);
return new ValidationFailure(string.Empty, "Unable to connect to indexer, check the log for more details");
}
return null;
}
}
}

View file

@ -50,7 +50,7 @@ public static DateTime ParseDate(string dateString)
}
catch (FormatException e)
{
Logger.WarnException("Unable to parse " + dateString, e);
Logger.Warn(e, "Unable to parse " + dateString);
throw;
}
}

View file

@ -103,7 +103,7 @@ private void EnsureCovers(Series series)
}
catch (Exception e)
{
_logger.ErrorException("Couldn't download media cover for " + series, e);
_logger.Error(e, "Couldn't download media cover for " + series);
}
EnsureResizedCovers(series, cover, !alreadyExists);

View file

@ -155,8 +155,8 @@ private void SetPermissions(string path)
catch (Exception ex)
{
_logger.WarnException("Unable to apply permissions to: " + path, ex);
_logger.DebugException(ex.Message, ex);
_logger.Warn(ex, "Unable to apply permissions to: " + path);
_logger.Debug(ex, ex.Message);
}
}

View file

@ -135,7 +135,7 @@ private EpisodeFile TransferFile(EpisodeFile episodeFile, Series series, List<Ep
catch (Exception ex)
{
_logger.WarnException("Unable to set last write time", ex);
_logger.Warn(ex, "Unable to set last write time");
}
_mediaFileAttributeService.SetFilePermissions(destinationFilePath);
@ -206,7 +206,7 @@ private void CreateFolder(string directoryName)
}
catch (IOException ex)
{
_logger.ErrorException("Unable to create directory: " + directoryName, ex);
_logger.Error(ex, "Unable to create directory: " + directoryName);
}
_mediaFileAttributeService.SetFolderPermissions(directoryName);

View file

@ -114,7 +114,7 @@ public List<ImportResult> Import(List<ImportDecision> decisions, bool newDownloa
}
catch (Exception e)
{
_logger.WarnException("Couldn't import episode " + localEpisode, e);
_logger.Warn(e, "Couldn't import episode " + localEpisode);
importResults.Add(new ImportResult(importDecision, "Failed to import episode"));
}
}

View file

@ -111,7 +111,7 @@ private ImportDecision GetDecision(string file, Series series, ParsedEpisodeInfo
}
catch (Exception e)
{
_logger.ErrorException("Couldn't import file. " + file, e);
_logger.Error(e, "Couldn't import file. " + file);
}
return decision;
@ -140,7 +140,7 @@ private Rejection EvaluateSpec(IImportDecisionEngineSpecification spec, LocalEpi
{
//e.Data.Add("report", remoteEpisode.Report.ToJson());
//e.Data.Add("parsed", remoteEpisode.ParsedEpisodeInfo.ToJson());
_logger.ErrorException("Couldn't evaluate decision on " + localEpisode.Path, e);
_logger.Error(e, "Couldn't evaluate decision on " + localEpisode.Path);
return new Rejection(string.Format("{0}: {1}", spec.GetType().Name, e.Message));
}

View file

@ -58,7 +58,7 @@ public Decision IsSatisfiedBy(LocalEpisode localEpisode)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to check free disk space while importing: " + localEpisode.Path, ex);
_logger.Error(ex, "Unable to check free disk space while importing: " + localEpisode.Path);
}
return Decision.Accept();

View file

@ -43,12 +43,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.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
}
else
{
_logger.Warn("Unable to apply folder permissions to: ", path);
_logger.WarnException(ex.Message, ex);
_logger.Warn(ex, ex.Message);
}
}
}
@ -91,8 +91,8 @@ private void SetMonoPermissions(string path, string permissions)
catch (Exception ex)
{
_logger.WarnException("Unable to apply permissions to: " + path, ex);
_logger.DebugException(ex.Message, ex);
_logger.Warn(ex, "Unable to apply permissions to: " + path);
_logger.Debug(ex, ex.Message);
}
}
}

View file

@ -69,7 +69,7 @@ public void Clean(Series series, List<string> filesOnDisk)
catch (Exception ex)
{
var errorMessage = string.Format("Unable to cleanup EpisodeFile in DB: {0}", episodeFile.Id);
_logger.ErrorException(errorMessage, ex);
_logger.Error(ex, errorMessage);
}
}

View file

@ -151,11 +151,11 @@ public MediaInfoModel GetMediaInfo(string filename)
}
catch (DllNotFoundException ex)
{
_logger.ErrorException("mediainfo is required but was not found", ex);
_logger.Error(ex, "mediainfo is required but was not found");
}
catch (Exception ex)
{
_logger.ErrorException("Unable to parse media info from file: " + filename, ex);
_logger.Error(ex, "Unable to parse media info from file: " + filename);
}
finally
{

View file

@ -118,7 +118,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.ErrorException(message, e);
_logger.Error(e, message);
throw;
}

View file

@ -132,7 +132,7 @@ private void RenameFiles(List<EpisodeFile> episodeFiles, Series series)
}
catch (Exception ex)
{
_logger.ErrorException("Failed to rename file: " + episodeFilePath, ex);
_logger.Error(ex, "Failed to rename file: " + episodeFilePath);
}
}

View file

@ -135,7 +135,7 @@ private bool ChangeFileDateToLocalAirDate(string filePath, string fileDate, stri
catch (Exception ex)
{
_logger.WarnException("Unable to set date of file [" + filePath + "]", ex);
_logger.Warn(ex, "Unable to set date of file [" + filePath + "]");
}
}
}
@ -165,7 +165,7 @@ private bool ChangeFileDateToUtcAirDate(string filePath, DateTime airDateUtc)
catch (Exception ex)
{
ex.ExceptronIgnoreOnMono();
_logger.WarnException("Unable to set date of file [" + filePath + "]", ex);
_logger.Warn(ex, "Unable to set date of file [" + filePath + "]");
}
}

View file

@ -42,18 +42,18 @@ private void ExecuteCommands()
}
catch (Exception ex)
{
_logger.ErrorException("Error occurred while executing task " + command.Name, ex);
_logger.Error(ex, "Error occurred while executing task " + command.Name);
}
}
}
catch (ThreadAbortException ex)
{
_logger.ErrorException("Thread aborted: " + ex.Message, ex);
_logger.Error(ex, "Thread aborted: " + ex.Message);
Thread.ResetAbort();
}
catch (Exception ex)
{
_logger.ErrorException("Unknown error in thread: " + ex.Message, ex);
_logger.Error(ex, "Unknown error in thread: " + ex.Message);
}
}

View file

@ -58,7 +58,7 @@ public void PublishEvent<TEvent>(TEvent @event) where TEvent : class ,IEvent
}
catch (Exception e)
{
_logger.ErrorException(string.Format("{0} failed while processing [{1}]", handler.GetType().Name, eventName), e);
_logger.Error(e, string.Format("{0} failed while processing [{1}]", handler.GetType().Name, eventName));
}
}

View file

@ -335,7 +335,7 @@ public override List<ImageFileResult> EpisodeImages(Series series, EpisodeFile e
}
catch (Exception ex)
{
_logger.ErrorException("Unable to process episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath), ex);
_logger.Error(ex, "Unable to process episode image for file: " + Path.Combine(series.Path, episodeFile.RelativePath));
return new List<ImageFileResult>();
}

View file

@ -380,7 +380,7 @@ private void DownloadImage(Series series, string url, string path)
}
catch (Exception e)
{
_logger.ErrorException("Couldn't download image " + url + " for " + series, e);
_logger.Error(e, "Couldn't download image " + url + " for " + series);
}
}

View file

@ -95,7 +95,7 @@ public List<Series> SearchForNewSeries(string title)
}
catch (Exception ex)
{
_logger.WarnException(ex.Message, ex);
_logger.Warn(ex, ex.Message);
throw new SkyHookException("Search for '{0}' failed. Invalid response received from SkyHook.", title);
}
}

View file

@ -34,7 +34,7 @@ public void SendNotification(string title, string message, BoxcarSettings settin
}
catch (BoxcarException ex)
{
_logger.ErrorException("Unable to send message", ex);
_logger.Error(ex, "Unable to send message");
throw new BoxcarException("Unable to send Boxcar notifications");
}
}
@ -53,16 +53,16 @@ public ValidationFailure Test(BoxcarSettings settings)
{
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.ErrorException("Access Token is invalid: " + ex.Message, ex);
_logger.Error(ex, "Access Token is invalid: " + ex.Message);
return new ValidationFailure("Token", "Access Token is invalid");
}
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("Token", "Unable to send test message");
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.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.ErrorException("Access Token is invalid: " + ex.Message, ex);
_logger.Error(ex, "Access Token is invalid: " + ex.Message);
throw;
}

View file

@ -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.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
}
}
@ -61,7 +61,7 @@ private void Send(MailMessage email, string server, int port, bool ssl, NetworkC
catch (Exception ex)
{
_logger.ErrorException("There was an error sending an email.", ex);
_logger.Error(ex, "There was an error sending an email.");
throw;
}
}
@ -76,7 +76,7 @@ public ValidationFailure Test(EmailSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test email: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test email: " + ex.Message);
return new ValidationFailure("Server", "Unable to send test email");
}

View file

@ -152,7 +152,7 @@ public ValidationFailure Test(GrowlSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("Host", "Unable to send test message");
}

View file

@ -52,7 +52,7 @@ public ValidationFailure Test(MediaBrowserSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("Host", "Unable to send test message: " + ex.Message);
}

View file

@ -107,7 +107,7 @@ public void Handle(EpisodeGrabbedEvent message)
catch (Exception ex)
{
_logger.ErrorException("Unable to send OnGrab notification to: " + notification.Definition.Name, ex);
_logger.Error(ex, "Unable to send OnGrab notification to: " + notification.Definition.Name);
}
}
}
@ -136,7 +136,7 @@ public void Handle(EpisodeDownloadedEvent message)
catch (Exception ex)
{
_logger.WarnException("Unable to send OnDownload notification to: " + notification.Definition.Name, ex);
_logger.Warn(ex, "Unable to send OnDownload notification to: " + notification.Definition.Name);
}
}
}
@ -155,7 +155,7 @@ public void Handle(SeriesRenamedEvent message)
catch (Exception ex)
{
_logger.WarnException("Unable to send OnRename notification to: " + notification.Definition.Name, ex);
_logger.Warn(ex, "Unable to send OnRename notification to: " + notification.Definition.Name);
}
}
}

View file

@ -75,7 +75,7 @@ public ValidationFailure Test(NotifyMyAndroidSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("ApiKey", "Unable to send test message");
}

View file

@ -35,7 +35,7 @@ public void Notify(PlexClientSettings settings, string header, string message)
}
catch(Exception ex)
{
_logger.WarnException("Failed to send notification to Plex Client: " + settings.Host, ex);
_logger.Warn(ex, "Failed to send notification to Plex Client: " + settings.Host);
}
}
@ -67,7 +67,7 @@ public ValidationFailure Test(PlexClientSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("Host", "Unable to send test message");
}

View file

@ -81,7 +81,7 @@ private void Notify(XbmcSettings settings, string header, string message)
catch (SocketException ex)
{
var logMessage = string.Format("Unable to connect to PHT Host: {0}:{1}", Settings.Host, Settings.Port);
_logger.DebugException(logMessage, ex);
_logger.Debug(ex, logMessage);
}
}
}

View file

@ -52,7 +52,7 @@ public void UpdateLibrary(Series series, PlexServerSettings settings)
catch(Exception ex)
{
_logger.WarnException("Failed to Update Plex host: " + settings.Host, ex);
_logger.Warn(ex, "Failed to Update Plex host: " + settings.Host);
throw;
}
}
@ -86,7 +86,7 @@ private bool PartialUpdatesAllowed(PlexServerSettings settings)
}
catch (Exception ex)
{
_logger.WarnException("Unable to check if partial updates are allowed", ex);
_logger.Warn(ex, "Unable to check if partial updates are allowed");
}
return false;
@ -158,12 +158,12 @@ public ValidationFailure Test(PlexServerSettings settings)
}
catch(PlexAuthenticationException ex)
{
_logger.ErrorException("Unable to connect to Plex Server: " + ex.Message, ex);
_logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message);
return new ValidationFailure("Username", "Incorrect username or password");
}
catch (Exception ex)
{
_logger.ErrorException("Unable to connect to Plex Server: " + ex.Message, ex);
_logger.Error(ex, "Unable to connect to Plex Server: " + ex.Message);
return new ValidationFailure("Host", "Unable to connect to Plex Server");
}

View file

@ -49,7 +49,7 @@ public void SendNotification(string title, string message, string apiKey, Notifi
catch (Exception ex)
{
_logger.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
_logger.Warn("Invalid API Key: {0}", apiKey);
}
}
@ -75,7 +75,7 @@ public void Verify(string apiKey)
catch (Exception ex)
{
_logger.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
_logger.Warn("Invalid API Key: {0}", apiKey);
throw new InvalidApiKeyException("API Key: " + apiKey + " is invalid");
}
@ -94,7 +94,7 @@ public ValidationFailure Test(ProwlSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("ApiKey", "Unable to send test message");
}

View file

@ -41,7 +41,7 @@ public void SendNotification(string title, string message, PushBulletSettings se
}
catch (PushBulletException ex)
{
_logger.ErrorException("Unable to send test message to: " + channelTag, ex);
_logger.Error(ex, "Unable to send test message to: " + channelTag);
error = true;
}
}
@ -60,7 +60,7 @@ public void SendNotification(string title, string message, PushBulletSettings se
}
catch (PushBulletException ex)
{
_logger.ErrorException("Unable to send test message to: " + deviceId, ex);
_logger.Error(ex, "Unable to send test message to: " + deviceId);
error = true;
}
}
@ -75,7 +75,7 @@ public void SendNotification(string title, string message, PushBulletSettings se
}
catch (PushBulletException ex)
{
_logger.ErrorException("Unable to send test message to all devices", ex);
_logger.Error(ex, "Unable to send test message to all devices");
error = true;
}
}
@ -100,16 +100,16 @@ public ValidationFailure Test(PushBulletSettings settings)
{
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.ErrorException("API Key is invalid: " + ex.Message, ex);
_logger.Error(ex, "API Key is invalid: " + ex.Message);
return new ValidationFailure("ApiKey", "API Key is invalid");
}
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("ApiKey", "Unable to send test message");
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("", "Unable to send test message");
}
@ -164,7 +164,7 @@ private void SendNotification(string title, string message, RestRequest request,
{
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.ErrorException("API Key is invalid: " + ex.Message, ex);
_logger.Error(ex, "API Key is invalid: " + ex.Message);
throw;
}

View file

@ -73,30 +73,30 @@ public ValidationFailure Test(PushalotSettings settings)
{
if (ex.Response.StatusCode == HttpStatusCode.Unauthorized)
{
_logger.ErrorException("Authentication Token is invalid: " + ex.Message, ex);
_logger.Error(ex, "Authentication Token is invalid: " + ex.Message);
return new ValidationFailure("AuthToken", "Authentication Token is invalid");
}
if (ex.Response.StatusCode == HttpStatusCode.NotAcceptable)
{
_logger.ErrorException("Message limit reached: " + ex.Message, ex);
_logger.Error(ex, "Message limit reached: " + ex.Message);
return new ValidationFailure("AuthToken", "Message limit reached");
}
if (ex.Response.StatusCode == HttpStatusCode.Gone)
{
_logger.ErrorException("Authorization Token is no longer valid: " + ex.Message, ex);
_logger.Error(ex, "Authorization Token is no longer valid: " + ex.Message);
return new ValidationFailure("AuthToken", "Authorization Token is no longer valid, please use a new one.");
}
var response = Json.Deserialize<PushalotResponse>(ex.Response.Content);
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("AuthToken", response.Description);
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("", "Unable to send test message");
}

View file

@ -59,7 +59,7 @@ public ValidationFailure Test(PushoverSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("ApiKey", "Unable to send test message");
}

View file

@ -38,7 +38,7 @@ public bool Test()
}
catch (Exception ex)
{
_logger.WarnException("synoindex not available", ex);
_logger.Warn(ex, "synoindex not available");
return false;
}
}

View file

@ -131,7 +131,7 @@ public ValidationFailure Test(TwitterSettings settings)
}
catch (Exception ex)
{
_logger.ErrorException("Unable to send test message: " + ex.Message, ex);
_logger.Error(ex, "Unable to send test message: " + ex.Message);
return new ValidationFailure("Host", "Unable to send test message");
}
return null;

View file

@ -74,7 +74,7 @@ internal List<ActivePlayer> GetActivePlayers(XbmcSettings settings)
catch (Exception ex)
{
_logger.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
}
return new List<ActivePlayer>();
@ -163,7 +163,7 @@ private void UpdateLibrary(XbmcSettings settings, Series series)
catch (Exception ex)
{
_logger.DebugException(ex.Message, ex);
_logger.Debug(ex, ex.Message);
}
}

Some files were not shown because too many files have changed in this diff Show more