diff --git a/Gruntfile.js b/Gruntfile.js index 9780b6e71..e7ce977e4 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -105,69 +105,65 @@ module.exports = function (grunt) { }, copy: { - index : { + content: { cwd : srcRoot, expand: true, - src : '*ndex.html', + src : [ + 'index.html', + '**/*.css', + '**/*.png', + '**/*.jpg', + '**/*.ico', + '**/FontAwesome/*.*', + '**/fonts/*.*' + ], dest : outputDir }, scripts: { cwd : srcRoot, expand: true, - src : '**/*.js', - dest : outputDir - }, - styles : { - cwd : srcRoot, - expand: true, - src : '**/*.css', - dest : outputDir - }, - images : { - cwd : srcRoot, - expand: true, - src : '**/*.png', - dest : outputDir - }, - jpg : { - cwd : srcRoot, - expand: true, - src : '**/*.jpg', - dest : outputDir - }, - icon : { - cwd : srcRoot, - expand: true, - src : '**/*.ico', - dest : outputDir - }, - fontAwesome : { - cwd : srcRoot, - expand: true, - src : '**/FontAwesome/*.*', - dest : outputDir - }, - fonts : { - cwd : srcRoot, - expand: true, - src : '**/fonts/*.*', + src : [ + '**/*.js', + ], dest : outputDir } }, + jshint: { + options: { + '-W030': false, + '-W064': false, + '-W097': false, + '-W100': false, + 'undef': true, + 'globals': { + 'require': true, + 'define': true, + 'window': true, + 'document': true, + 'console': true + } + }, + all: [ + srcRoot + '**/*.js', + '!**/JsLibraries/*.js' + ] + }, + requirejs: { compile:{ options: { - mainConfigFile: "_output/UI/app.js", + mainConfigFile: "src/UI/app.js", fileExclusionRegExp: /^.*\.(?!js$)[^.]+$/, - preserveLicenseComments: true, - dir: "rjs/", + preserveLicenseComments: false, + dir: outputDir, optimize: 'none', removeCombined: true, inlineText: false, + keepBuildDir : true, modules: [{ name: 'app', - exclude: ['JsLibraries/jquery'] + exclude: ['JsLibraries/jquery', 'templates.js'] }], } @@ -190,37 +186,21 @@ module.exports = function (grunt) { files: '<%= handlebars.files.src %>', tasks: ['handlebars'] }, - copyIndex : { - files: '<%= copy.index.cwd %><%= copy.index.src %>', - tasks: ['copy:index'] + content : { + files: [ + '**/index.html', + '**/*.css', + '**/*.png', + '**/*.jpg', + '**/*.ico', + '**/FontAwesome/*.*', + '**/fonts/*.*' + ], + tasks: ['copy:content'] }, - copyScripts: { + scripts: { files: '<%= copy.scripts.cwd %><%= copy.scripts.src %>', tasks: ['copy:scripts'] - }, - copyStyles : { - files: '<%= copy.styles.cwd %><%= copy.styles.src %>', - tasks: ['copy:styles'] - }, - copyImages : { - files: '<%= copy.images.cwd %><%= copy.images.src %>', - tasks: ['copy:images'] - }, - copyJpg : { - files: '<%= copy.jpg.cwd %><%= copy.jpg.src %>', - tasks: ['copy:jpg'] - }, - copyIcon : { - files: '<%= copy.icon.cwd %><%= copy.icon.src %>', - tasks: ['copy:icon'] - }, - copyFontAwesome : { - files: '<%= copy.fontAwesome.cwd %><%= copy.fontAwesome.src %>', - tasks: ['copy:fontAwesome'] - }, - copyFonts : { - files: '<%= copy.fonts.cwd %><%= copy.fonts.src %>', - tasks: ['copy:fonts'] } } }); @@ -233,8 +213,10 @@ module.exports = function (grunt) { grunt.loadNpmTasks('grunt-notify'); grunt.loadNpmTasks('grunt-curl'); grunt.loadNpmTasks('grunt-contrib-requirejs'); + grunt.loadNpmTasks('grunt-contrib-jshint'); - grunt.registerTask('package', ['clean:output', 'copy', 'less', 'handlebars']); + grunt.registerTask('package', ['clean:output', 'jshint', 'handlebars', 'copy', 'less']); + grunt.registerTask('packagerjs', ['clean:output','jshint', 'handlebars', 'requirejs', 'copy:content', 'less']); grunt.registerTask('default', ['package', 'watch']); grunt.registerTask('update', ['curl']); diff --git a/NzbDrone.sln.DotSettings b/NzbDrone.sln.DotSettings new file mode 100644 index 000000000..e7d45a2a8 --- /dev/null +++ b/NzbDrone.sln.DotSettings @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 21934eff3..18d66faa2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -6,6 +6,8 @@ $testSearchPattern = '*.Test\bin\x86\Release' Function Build() { + Write-Host "##teamcity[progressStart 'Build']" + $clean = $msbuild + " src\nzbdrone.sln /t:Clean /m" $build = $msbuild + " src\nzbdrone.sln /p:Configuration=Release /p:Platform=x86 /t:Build /m" @@ -23,6 +25,8 @@ Function Build() CleanFolder $outputFolder AddJsonNet + + Write-Host "##teamcity[progressFinish 'Build']" } Function CleanFolder($path) @@ -53,6 +57,8 @@ Function CleanFolder($path) Function PackageMono() { + Write-Host "##teamcity[progressStart 'Creating Mono Package']" + if(Test-Path $outputFolderMono) { Remove-Item -Recurse -Force $outputFolderMono -ErrorAction Continue @@ -77,6 +83,8 @@ Function PackageMono() Write-Host Renaming NzbDrone.Console.exe to NzbDrone.exe get-childitem $outputFolderMono -File -Filter NzbDrone.exe -Recurse | foreach ($_) {remove-item $_.fullname} Rename-Item "$outputFolderMono\NzbDrone.Console.exe" "NzbDrone.exe" + + Write-Host "##teamcity[progressFinish 'Creating Mono Package']" } @@ -89,7 +97,9 @@ Function AddJsonNet() Function PackageTests() { + Write-Host Packaging Tests + Write-Host "##teamcity[progressStart 'Creating Mono Package']" if(Test-Path $testPackageFolder) { @@ -111,17 +121,22 @@ Function PackageTests() get-childitem $testPackageFolder -File -Filter *log.config | foreach ($_) {remove-item $_.fullname} CleanFolder $testPackageFolder + + Write-Host "##teamcity[progressFinish 'Creating Mono Package']" } Function RunGrunt() { + Write-Host "##teamcity[progressStart 'Running Grunt']" $gruntPath = [environment]::getfolderpath("applicationdata") + '\npm\node_modules\grunt-cli\bin\grunt' Invoke-Expression 'npm install' CheckExitCode Invoke-Expression ('node ' + $gruntPath + ' package') CheckExitCode + + Write-Host "##teamcity[progressFinish 'Running Grunt']" } Function CheckExitCode() diff --git a/package.json b/package.json index 13dce8658..71db95c3a 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "grunt-curl": "*", "grunt-notify": "*", "grunt-contrib-clean": "*", - "grunt-contrib-requirejs": "*" + "grunt-contrib-requirejs": "*", + "grunt-contrib-jshint": "*" } } diff --git a/src/.nuget/NuGet.exe b/src/.nuget/NuGet.exe index c296edf17..81511ebc5 100644 Binary files a/src/.nuget/NuGet.exe and b/src/.nuget/NuGet.exe differ diff --git a/src/.nuget/NuGet.targets b/src/.nuget/NuGet.targets index ad2b581e7..83fe90601 100644 --- a/src/.nuget/NuGet.targets +++ b/src/.nuget/NuGet.targets @@ -2,38 +2,62 @@ $(MSBuildProjectDirectory)\..\ + + + false - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) - $([System.IO.Path]::Combine($(SolutionDir), "packages")) + + false - - $(SolutionDir).nuget - packages.config - $(SolutionDir)packages + + true + + false + + + + + + + + + + + $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) + $([System.IO.Path]::Combine($(ProjectDir), "packages.config")) + + + + + $(SolutionDir).nuget + packages.config + + + - $(NuGetToolsPath)\nuget.exe + $(NuGetToolsPath)\NuGet.exe + @(PackageSource) + "$(NuGetExePath)" mono --runtime=v4.0.30319 $(NuGetExePath) $(TargetDir.Trim('\\')) - - - "http://build.nzbdrone.com/guestAuth/app/nuget/v1/FeedService.svc";"https://nuget.org/api/v2/" - - - false - - - false + + -RequireConsent + -NonInteractive + + "$(SolutionDir) " + "$(SolutionDir)" - $(NuGetCommand) install "$(PackagesConfig)" -source $(PackageSources) -o "$(PackagesDir)" - $(NuGetCommand) pack "$(ProjectPath)" -p Configuration=$(Configuration) -o "$(PackageOutputDir)" -symbols + $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) + $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols - + RestorePackages; $(BuildDependsOn); @@ -48,7 +72,17 @@ - + + + + + + + @@ -68,4 +102,35 @@ LogStandardErrorAsError="true" Condition=" '$(OS)' == 'Windows_NT' " /> + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs index 04e9263e2..236bcc8df 100644 --- a/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs +++ b/src/NzbDrone.Api/ErrorManagement/NzbDroneErrorPipeline.cs @@ -17,11 +17,10 @@ namespace NzbDrone.Api.ErrorManagement _logger = logger; } - public Response HandleException(NancyContext context, Exception aggregateException) + public Response HandleException(NancyContext context, Exception exception) { - var innerException = (aggregateException.InnerException).InnerException; - var apiException = innerException as ApiException; + var apiException = exception as ApiException; if (apiException != null) { @@ -29,7 +28,7 @@ namespace NzbDrone.Api.ErrorManagement return apiException.ToErrorResponse(); } - var validationException = innerException as ValidationException; + var validationException = exception as ValidationException; if (validationException != null) { @@ -38,23 +37,23 @@ namespace NzbDrone.Api.ErrorManagement return validationException.Errors.AsResponse(HttpStatusCode.BadRequest); } - var clientException = innerException as NzbDroneClientException; + var clientException = exception as NzbDroneClientException; if (clientException != null) { return new ErrorModel { - Message = innerException.Message, - Description = innerException.ToString() + Message = exception.Message, + Description = exception.ToString() }.AsResponse((HttpStatusCode)clientException.StatusCode); } - _logger.FatalException("Request Failed", innerException); + _logger.FatalException("Request Failed", exception); return new ErrorModel { - Message = innerException.Message, - Description = innerException.ToString() + Message = exception.Message, + Description = exception.ToString() }.AsResponse(HttpStatusCode.InternalServerError); } } diff --git a/src/NzbDrone.Api/Extensions/RequestExtensions.cs b/src/NzbDrone.Api/Extensions/RequestExtensions.cs index 3d0329522..02686deb6 100644 --- a/src/NzbDrone.Api/Extensions/RequestExtensions.cs +++ b/src/NzbDrone.Api/Extensions/RequestExtensions.cs @@ -1,7 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; using Nancy; namespace NzbDrone.Api.Extensions diff --git a/src/NzbDrone.Api/Mapping/ValueInjectorExtensions.cs b/src/NzbDrone.Api/Mapping/ValueInjectorExtensions.cs index d8ac662f5..3adee94c2 100644 --- a/src/NzbDrone.Api/Mapping/ValueInjectorExtensions.cs +++ b/src/NzbDrone.Api/Mapping/ValueInjectorExtensions.cs @@ -19,7 +19,6 @@ namespace NzbDrone.Api.Mapping source.GetType().GetGenericTypeDefinition() != null && source.GetType().GetGenericTypeDefinition().GetInterfaces().Contains(typeof(IEnumerable))) { - var result = new TTarget(); var listSubType = targetType.GetGenericArguments()[0]; diff --git a/src/NzbDrone.Api/NzbDrone.Api.csproj b/src/NzbDrone.Api/NzbDrone.Api.csproj index 2227fbe11..f5bf73cf7 100644 --- a/src/NzbDrone.Api/NzbDrone.Api.csproj +++ b/src/NzbDrone.Api/NzbDrone.Api.csproj @@ -38,29 +38,29 @@ - + False - ..\packages\FluentValidation.4.0.0.1\lib\Net40\FluentValidation.dll + ..\packages\FluentValidation.5.0.0.1\lib\Net40\FluentValidation.dll False ..\packages\Microsoft.AspNet.SignalR.Core.1.1.3\lib\net40\Microsoft.AspNet.SignalR.Core.dll - + False - ..\packages\Nancy.0.20.0\lib\net40\Nancy.dll + ..\packages\Nancy.0.21.1\lib\net40\Nancy.dll - + False - ..\packages\Nancy.Authentication.Basic.0.20.0\lib\net40\Nancy.Authentication.Basic.dll + ..\packages\Nancy.Authentication.Basic.0.21.1\lib\net40\Nancy.Authentication.Basic.dll False - ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll ..\packages\ValueInjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll diff --git a/src/NzbDrone.Api/RootFolders/RootFolderModule.cs b/src/NzbDrone.Api/RootFolders/RootFolderModule.cs index dd346d5de..6691032d8 100644 --- a/src/NzbDrone.Api/RootFolders/RootFolderModule.cs +++ b/src/NzbDrone.Api/RootFolders/RootFolderModule.cs @@ -1,15 +1,17 @@ using System.Collections.Generic; +using NzbDrone.Core.Messaging.Commands; using NzbDrone.Core.RootFolders; using NzbDrone.Api.Mapping; using NzbDrone.Api.Validation; namespace NzbDrone.Api.RootFolders { - public class RootFolderModule : NzbDroneRestModule + public class RootFolderModule : NzbDroneRestModuleWithSignalR { private readonly IRootFolderService _rootFolderService; - public RootFolderModule(IRootFolderService rootFolderService) + public RootFolderModule(IRootFolderService rootFolderService, ICommandExecutor commandExecutor) + : base(commandExecutor) { _rootFolderService = rootFolderService; @@ -18,7 +20,7 @@ namespace NzbDrone.Api.RootFolders CreateResource = CreateRootFolder; DeleteResource = DeleteFolder; - SharedValidator.RuleFor(c=>c.Path).IsValidPath(); + SharedValidator.RuleFor(c => c.Path).IsValidPath(); } private RootFolderResource GetRootFolder(int id) diff --git a/src/NzbDrone.Api/packages.config b/src/NzbDrone.Api/packages.config index 722ec5a8b..66d291dc8 100644 --- a/src/NzbDrone.Api/packages.config +++ b/src/NzbDrone.Api/packages.config @@ -1,10 +1,10 @@  - + - - - - + + + + \ No newline at end of file diff --git a/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj b/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj index 3581eb9cb..2b3db8178 100644 --- a/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj +++ b/src/NzbDrone.App.Test/NzbDrone.Host.Test.csproj @@ -44,9 +44,9 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll False diff --git a/src/NzbDrone.App.Test/packages.config b/src/NzbDrone.App.Test/packages.config index 6f925b437..c88b100c8 100644 --- a/src/NzbDrone.App.Test/packages.config +++ b/src/NzbDrone.App.Test/packages.config @@ -3,6 +3,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/AutomationTest.cs b/src/NzbDrone.Automation.Test/AutomationTest.cs new file mode 100644 index 000000000..0f1fd5742 --- /dev/null +++ b/src/NzbDrone.Automation.Test/AutomationTest.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using FluentAssertions; +using NLog; +using NLog.Config; +using NLog.Targets; +using NUnit.Framework; +using NzbDrone.Automation.Test.PageModel; +using NzbDrone.Common.EnvironmentInfo; +using NzbDrone.Test.Common; +using OpenQA.Selenium; +using OpenQA.Selenium.Firefox; +using OpenQA.Selenium.IE; +using OpenQA.Selenium.Remote; +using OpenQA.Selenium.Support.UI; + +namespace NzbDrone.Automation.Test +{ + [TestFixture] + [AutomationTest] + public abstract class AutomationTest + { + private NzbDroneRunner _runner; + protected RemoteWebDriver driver; + + public AutomationTest() + { + new StartupArguments(); + + LogManager.Configuration = new LoggingConfiguration(); + var consoleTarget = new ConsoleTarget { Layout = "${level}: ${message} ${exception}" }; + LogManager.Configuration.AddTarget(consoleTarget.GetType().Name, consoleTarget); + LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget)); + } + + [TestFixtureSetUp] + public void SmokeTestSetup() + { + driver = new FirefoxDriver(); + + _runner = new NzbDroneRunner(); + _runner.KillAll(); + _runner.Start(); + + + driver.Url = "http://localhost:8989"; + + var page = new PageBase(driver); + page.WaitForNoSpinner(); + + GetPageErrors().Should().BeEmpty(); + + } + + protected IEnumerable GetPageErrors() + { + return driver.FindElements(By.CssSelector("#errors div")) + .Select(e => e.Text); + } + + [TestFixtureTearDown] + public void SmokeTestTearDown() + { + _runner.KillAll(); + driver.Quit(); + } + + [TearDown] + public void AutomationTearDown() + { + GetPageErrors().Should().BeEmpty(); + } + } +} diff --git a/src/NzbDrone.Automation.Test/AutomationTestAttribute.cs b/src/NzbDrone.Automation.Test/AutomationTestAttribute.cs new file mode 100644 index 000000000..d1cf9faec --- /dev/null +++ b/src/NzbDrone.Automation.Test/AutomationTestAttribute.cs @@ -0,0 +1,13 @@ +using NUnit.Framework; + +namespace NzbDrone.Automation.Test +{ + public class AutomationTestAttribute : CategoryAttribute + { + public AutomationTestAttribute() + : base("AutomationTest") + { + + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/MainPagesTest.cs b/src/NzbDrone.Automation.Test/MainPagesTest.cs new file mode 100644 index 000000000..0b20f3c35 --- /dev/null +++ b/src/NzbDrone.Automation.Test/MainPagesTest.cs @@ -0,0 +1,81 @@ +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Automation.Test.PageModel; +using OpenQA.Selenium; + +namespace NzbDrone.Automation.Test +{ + [TestFixture] + public class MainPagesTest : AutomationTest + { + private PageBase page; + + + [SetUp] + public void Setup() + { + page = new PageBase(driver); + } + + + [Test] + public void series_page() + { + page.SeriesNavIcon.Click(); + page.WaitForNoSpinner(); + page.FindByClass("iv-series-index-seriesindexlayout").Should().NotBeNull(); + } + + [Test] + public void calendar_page() + { + page.CalendarNavIcon.Click(); + page.WaitForNoSpinner(); + + page.FindByClass("iv-calendar-calendarlayout").Should().NotBeNull(); + } + + [Test] + public void history_page() + { + page.HistoryNavIcon.Click(); + page.WaitForNoSpinner(); + + page.FindByClass("iv-history-historylayout").Should().NotBeNull(); + } + + [Test] + public void missing_page() + { + page.MissingNavIcon.Click(); + page.WaitForNoSpinner(); + + page.FindByClass("iv-missing-missinglayout").Should().NotBeNull(); + } + + [Test] + public void system_page() + { + page.SystemNavIcon.Click(); + page.WaitForNoSpinner(); + + page.FindByClass("iv-system-systemlayout").Should().NotBeNull(); + } + + + [Test] + public void add_series_page() + { + page.SeriesNavIcon.Click(); + page.WaitForNoSpinner(); + + page.Find(By.LinkText("Add Series")).Click(); + + page.WaitForNoSpinner(); + + page.FindByClass("iv-addseries-addserieslayout").Should().NotBeNull(); + } + + + } +} \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj new file mode 100644 index 000000000..e310da757 --- /dev/null +++ b/src/NzbDrone.Automation.Test/NzbDrone.Automation.Test.csproj @@ -0,0 +1,90 @@ + + + + + Debug + AnyCPU + {CC26800D-F67E-464B-88DE-8EB1A0C227A3} + Library + Properties + NzbDrone.Automation.Test + NzbDrone.Automation.Test + v4.0 + 512 + ..\ + true + + + true + bin\x86\Debug\ + DEBUG;TRACE + full + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + pdbonly + x86 + prompt + MinimumRecommendedRules.ruleset + + + + False + ..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll + + + ..\packages\NLog.2.1.0\lib\net40\NLog.dll + + + ..\packages\NUnit.2.6.2\lib\nunit.framework.dll + + + + + + + + + + + ..\packages\Selenium.WebDriver.2.37.0\lib\net40\WebDriver.dll + + + ..\packages\Selenium.Support.2.37.0\lib\net40\WebDriver.Support.dll + + + + + + + + + + + + {F2BE0FDF-6E47-4827-A420-DD4EF82407F8} + NzbDrone.Common + + + {CADDFCE0-7509-4430-8364-2074E1EEFCA2} + NzbDrone.Test.Common + + + + + + + + + \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/PageModel/PageBase.cs b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs new file mode 100644 index 000000000..3ed74c8fb --- /dev/null +++ b/src/NzbDrone.Automation.Test/PageModel/PageBase.cs @@ -0,0 +1,100 @@ +using System; +using System.Threading; +using OpenQA.Selenium; +using OpenQA.Selenium.Remote; +using OpenQA.Selenium.Support.UI; + +namespace NzbDrone.Automation.Test.PageModel +{ + public class PageBase + { + private readonly RemoteWebDriver _driver; + + public PageBase(RemoteWebDriver driver) + { + _driver = driver; + } + + public IWebElement FindByClass(string className, int timeout = 5) + { + return Find(By.ClassName(className), timeout); + } + + public IWebElement Find(By by, int timeout = 5) + { + var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(timeout)); + return wait.Until(d => d.FindElement(by)); + } + + + public void WaitForNoSpinner(int timeout = 20) + { + //give the spinner some time to show up. + Thread.Sleep(100); + + var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(timeout)); + wait.Until(d => + { + try + { + IWebElement element = d.FindElement(By.Id("followingBalls")); + return !element.Displayed; + } + catch (NoSuchElementException) + { + return true; + } + }); + } + + + public IWebElement SeriesNavIcon + { + get + { + return Find(By.LinkText("Series")); + } + } + + public IWebElement CalendarNavIcon + { + get + { + return Find(By.LinkText("Calendar")); + } + } + + public IWebElement HistoryNavIcon + { + get + { + return Find(By.LinkText("History")); + } + } + + public IWebElement MissingNavIcon + { + get + { + return Find(By.LinkText("Missing")); + } + } + + public IWebElement SettingNavIcon + { + get + { + return Find(By.LinkText("Settings")); + } + } + + public IWebElement SystemNavIcon + { + get + { + return Find(By.LinkText("System")); + } + } + + } +} \ No newline at end of file diff --git a/src/NzbDrone.Automation.Test/Properties/AssemblyInfo.cs b/src/NzbDrone.Automation.Test/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e99cbaa72 --- /dev/null +++ b/src/NzbDrone.Automation.Test/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NzbDrone.Automation.Test")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("NzbDrone.Automation.Test")] +[assembly: AssemblyCopyright("Copyright © 2013")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("6b8945f5-f5b5-4729-865d-f958fbd673d9")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NzbDrone.Automation.Test/packages.config b/src/NzbDrone.Automation.Test/packages.config new file mode 100644 index 000000000..f51e94b57 --- /dev/null +++ b/src/NzbDrone.Automation.Test/packages.config @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/src/NzbDrone.Common.Test/DiskProviderTests/DiskProviderFixture.cs b/src/NzbDrone.Common.Test/DiskProviderTests/DiskProviderFixture.cs index 4de222365..e759bdf10 100644 --- a/src/NzbDrone.Common.Test/DiskProviderTests/DiskProviderFixture.cs +++ b/src/NzbDrone.Common.Test/DiskProviderTests/DiskProviderFixture.cs @@ -155,10 +155,14 @@ namespace NzbDrone.Common.Test.DiskProviderTests [Test] public void folder_should_return_correct_value_for_last_write() { - var testFile = GetTestFilePath(); + var testDir = Path.Combine(SandboxFolder, "LastWrite"); + var testFile = Path.Combine(testDir, Path.GetRandomFileName()); + + Directory.CreateDirectory(testDir); TestLogger.Info("Path is: {0}", testFile); + Subject.WriteAllText(testFile, "Test"); Subject.GetLastFolderWrite(SandboxFolder).Should().BeOnOrAfter(DateTime.UtcNow.AddMinutes(-1)); diff --git a/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj b/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj index 1ec40855c..dcdca41b2 100644 --- a/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj +++ b/src/NzbDrone.Common.Test/NzbDrone.Common.Test.csproj @@ -41,9 +41,9 @@ ..\packages\Moq.4.0.10827\lib\NET40\Moq.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll False diff --git a/src/NzbDrone.Common.Test/packages.config b/src/NzbDrone.Common.Test/packages.config index 01e492eef..80b884496 100644 --- a/src/NzbDrone.Common.Test/packages.config +++ b/src/NzbDrone.Common.Test/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/src/NzbDrone.Common/DiskProvider.cs b/src/NzbDrone.Common/DiskProvider.cs index a3d9e0255..ecaabb46d 100644 --- a/src/NzbDrone.Common/DiskProvider.cs +++ b/src/NzbDrone.Common/DiskProvider.cs @@ -301,27 +301,18 @@ namespace NzbDrone.Common if (OsInfo.IsLinux) { - var drives = DriveInfo.GetDrives(); - - foreach (var drive in drives) + try { - try - { - if (drive.IsReady && path.StartsWith(drive.Name, StringComparison.CurrentCultureIgnoreCase)) - { - return drive.AvailableFreeSpace; - } - } - catch (InvalidOperationException e) - { - Logger.ErrorException("Couldn't get free space for " + path, e); - } + return GetDriveInfoLinux(path).AvailableFreeSpace; + } + catch (InvalidOperationException e) + { + Logger.ErrorException("Couldn't get free space for " + path, e); } return null; } - return DriveFreeSpaceEx(root); } @@ -471,27 +462,18 @@ namespace NzbDrone.Common if (OsInfo.IsLinux) { - var drives = DriveInfo.GetDrives(); - - foreach (var drive in drives) + try { - try - { - if (drive.IsReady && path.StartsWith(drive.Name, StringComparison.CurrentCultureIgnoreCase)) - { - return drive.TotalSize; - } - } - catch (InvalidOperationException e) - { - Logger.ErrorException("Couldn't get total space for " + path, e); - } + return GetDriveInfoLinux(path).TotalSize; + } + catch (InvalidOperationException e) + { + Logger.ErrorException("Couldn't get total space for " + path, e); } return null; } - return DriveTotalSizeEx(root); } @@ -554,5 +536,16 @@ namespace NzbDrone.Common return 0; } + + private DriveInfo GetDriveInfoLinux(string path) + { + var drives = DriveInfo.GetDrives(); + + return + drives.Where(drive => + drive.IsReady && path.StartsWith(drive.Name, StringComparison.CurrentCultureIgnoreCase)) + .OrderByDescending(drive => drive.Name.Length) + .First(); + } } } \ No newline at end of file diff --git a/src/NzbDrone.Common/EnsureThat/EnsureStringExtensions.cs b/src/NzbDrone.Common/EnsureThat/EnsureStringExtensions.cs index 411a31f41..78435ee00 100644 --- a/src/NzbDrone.Common/EnsureThat/EnsureStringExtensions.cs +++ b/src/NzbDrone.Common/EnsureThat/EnsureStringExtensions.cs @@ -92,7 +92,6 @@ namespace NzbDrone.Common.EnsureThat throw ExceptionFactory.CreateForParamValidation(param.Name, string.Format("value [{0}] is not a valid relative path. relative paths can not start with \\", param.Value)); } - return param; } diff --git a/src/NzbDrone.Common/NzbDrone.Common.csproj b/src/NzbDrone.Common/NzbDrone.Common.csproj index 869176ecb..6a6cc35f4 100644 --- a/src/NzbDrone.Common/NzbDrone.Common.csproj +++ b/src/NzbDrone.Common/NzbDrone.Common.csproj @@ -46,11 +46,11 @@ False - ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll diff --git a/src/NzbDrone.Common/packages.config b/src/NzbDrone.Common/packages.config index 7252d18f7..4e193d0ba 100644 --- a/src/NzbDrone.Common/packages.config +++ b/src/NzbDrone.Common/packages.config @@ -1,7 +1,7 @@  - - + + \ No newline at end of file diff --git a/src/NzbDrone.Console/NzbDrone.Console.csproj b/src/NzbDrone.Console/NzbDrone.Console.csproj index f4351791a..dedc46e2f 100644 --- a/src/NzbDrone.Console/NzbDrone.Console.csproj +++ b/src/NzbDrone.Console/NzbDrone.Console.csproj @@ -81,11 +81,11 @@ False - ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll False diff --git a/src/NzbDrone.Console/packages.config b/src/NzbDrone.Console/packages.config index 19f3a3d8b..8c5b8f6f8 100644 --- a/src/NzbDrone.Console/packages.config +++ b/src/NzbDrone.Console/packages.config @@ -4,7 +4,7 @@ - - + + - \ No newline at end of file + diff --git a/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecsFixture.cs b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecsFixture.cs new file mode 100644 index 000000000..52134d539 --- /dev/null +++ b/src/NzbDrone.Core.Test/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecsFixture.cs @@ -0,0 +1,37 @@ +using FizzWare.NBuilder; +using FluentAssertions; +using NUnit.Framework; +using NzbDrone.Core.Housekeeping.Housekeepers; +using NzbDrone.Core.Organizer; +using NzbDrone.Core.Test.Framework; + +namespace NzbDrone.Core.Test.Housekeeping.Housekeepers +{ + [TestFixture] + public class CleanupAdditionalNamingSpecsFixture : DbTest + { + [Test] + public void should_delete_additional_naming_configs() + { + var specs = Builder.CreateListOfSize(5) + .BuildListOfNew(); + + Db.InsertMany(specs); + + Subject.Clean(); + AllStoredModels.Should().HaveCount(1); + } + + [Test] + public void should_not_delete_if_only_one_spec() + { + var spec = Builder.CreateNew() + .BuildNew(); + + Db.Insert(spec); + + Subject.Clean(); + AllStoredModels.Should().HaveCount(1); + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs index 09e51ac3a..f00c6830a 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/DownloadedEpisodesImportServiceFixture.cs @@ -124,7 +124,7 @@ namespace NzbDrone.Core.Test.MediaFiles imported.Add(new ImportDecision(localEpisode)); Mocker.GetMock() - .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), true)) + .Setup(s => s.GetImportDecisions(It.IsAny>(), It.IsAny(), true, null)) .Returns(imported); Mocker.GetMock() diff --git a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs index 68dfdc5db..edcfa1a14 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/EpisodeImport/ImportDecisionMakerFixture.cs @@ -9,6 +9,7 @@ using NzbDrone.Core.MediaFiles; using NzbDrone.Core.MediaFiles.EpisodeImport; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.Qualities; using NzbDrone.Core.Test.Framework; using NzbDrone.Core.Tv; using NzbDrone.Test.Common; @@ -21,6 +22,7 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport private List _videoFiles; private LocalEpisode _localEpisode; private Series _series; + private QualityModel _quality; private Mock _pass1; private Mock _pass2; @@ -62,7 +64,13 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport _videoFiles = new List { @"C:\Test\Unsorted\The.Office.S03E115.DVDRip.XviD-OSiTV.avi" }; _series = new Series(); - _localEpisode = new LocalEpisode { Series = _series, Path = @"C:\Test\Unsorted\The.Office.S03E115.DVDRip.XviD-OSiTV.avi" }; + _quality = new QualityModel(Quality.DVD); + _localEpisode = new LocalEpisode + { + Series = _series, + Quality = _quality, + Path = @"C:\Test\Unsorted\The.Office.S03E115.DVDRip.XviD-OSiTV.avi" + }; Mocker.GetMock() .Setup(c => c.GetEpisodes(It.IsAny(), It.IsAny(), It.IsAny())) @@ -161,5 +169,38 @@ namespace NzbDrone.Core.Test.MediaFiles.EpisodeImport ExceptionVerification.ExpectedErrors(3); } + + [Test] + public void should_use_file_quality_if_folder_quality_is_null() + { + GivenSpecifications(_pass1, _pass2, _pass3); + var expectedQuality = QualityParser.ParseQuality(_videoFiles.Single()); + + var result = Subject.GetImportDecisions(_videoFiles, new Series(), false, null); + + result.Single().LocalEpisode.Quality.Should().Be(expectedQuality); + } + + [Test] + public void should_use_file_quality_if_folder_quality_is_lower_than_file_quality() + { + GivenSpecifications(_pass1, _pass2, _pass3); + var expectedQuality = QualityParser.ParseQuality(_videoFiles.Single()); + + var result = Subject.GetImportDecisions(_videoFiles, new Series(), false, new QualityModel(Quality.SDTV)); + + result.Single().LocalEpisode.Quality.Should().Be(expectedQuality); + } + + [Test] + public void should_use_folder_quality_when_it_is_greater_than_file_quality() + { + GivenSpecifications(_pass1, _pass2, _pass3); + var expectedQuality = new QualityModel(Quality.Bluray1080p); + + var result = Subject.GetImportDecisions(_videoFiles, new Series(), false, expectedQuality); + + result.Single().LocalEpisode.Quality.Should().Be(expectedQuality); + } } } \ No newline at end of file diff --git a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs index 9c6596be4..30b5f804a 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/ImportApprovedEpisodesFixture.cs @@ -46,13 +46,14 @@ namespace NzbDrone.Core.Test.MediaFiles { Series = series, Episodes = new List {episode}, - Path = @"C:\Test\TV\30 Rock\30 Rock - S01E01 - Pilit.avi".AsOsAgnostic(), + Path = @"C:\Test\TV\30 Rock\30 Rock - S01E01 - Pilot.avi".AsOsAgnostic(), Quality = new QualityModel(Quality.Bluray720p) })); } Mocker.GetMock() - .Setup(s => s.UpgradeEpisodeFile(It.IsAny(), It.IsAny())); + .Setup(s => s.UpgradeEpisodeFile(It.IsAny(), It.IsAny())) + .Returns(new EpisodeFileMoveResult()); } [Test] diff --git a/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs b/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs index 6594a3c77..84761a0a5 100644 --- a/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs +++ b/src/NzbDrone.Core.Test/MediaFiles/UpgradeMediaFileServiceFixture.cs @@ -1,5 +1,6 @@ using System.Linq; using FizzWare.NBuilder; +using FluentAssertions; using Marr.Data; using Moq; using NUnit.Framework; @@ -149,5 +150,21 @@ namespace NzbDrone.Core.Test.MediaFiles Mocker.GetMock().Verify(v => v.DeleteFile(It.IsAny()), Times.Never()); } + + [Test] + public void should_return_old_episode_file_in_oldFiles() + { + GivenSingleEpisodeWithSingleEpisodeFile(); + + Subject.UpgradeEpisodeFile(_episodeFile, _localEpisode).OldFiles.Count.Should().Be(1); + } + + [Test] + public void should_return_old_episode_files_in_oldFiles() + { + GivenMultipleEpisodesWithMultipleEpisodeFiles(); + + Subject.UpgradeEpisodeFile(_episodeFile, _localEpisode).OldFiles.Count.Should().Be(2); + } } } diff --git a/src/NzbDrone.Core.Test/NotificationTests/Xbmc/OnDownloadFixture.cs b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/OnDownloadFixture.cs new file mode 100644 index 000000000..fff54ac02 --- /dev/null +++ b/src/NzbDrone.Core.Test/NotificationTests/Xbmc/OnDownloadFixture.cs @@ -0,0 +1,73 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using FizzWare.NBuilder; +using Moq; +using NUnit.Framework; +using NzbDrone.Core.MediaFiles; +using NzbDrone.Core.Notifications; +using NzbDrone.Core.Notifications.Xbmc; +using NzbDrone.Core.Test.Framework; +using NzbDrone.Core.Tv; + +namespace NzbDrone.Core.Test.NotificationTests.Xbmc +{ + [TestFixture] + public class OnDownloadFixture : CoreTest + { + private DownloadMessage _downloadMessage; + + [SetUp] + public void Setup() + { + var series = Builder.CreateNew() + .Build(); + + var episodeFile = Builder.CreateNew() + .Build(); + + _downloadMessage = Builder.CreateNew() + .With(d => d.Series = series) + .With(d => d.EpisodeFile = episodeFile) + .With(d => d.OldFiles = new List()) + .Build(); + + Subject.Definition = new NotificationDefinition(); + Subject.Definition.Settings = new XbmcSettings + { + UpdateLibrary = true + }; + } + + private void GivenOldFiles() + { + _downloadMessage.OldFiles = Builder.CreateListOfSize(1) + .Build() + .ToList(); + + Subject.Definition.Settings = new XbmcSettings + { + UpdateLibrary = true, + CleanLibrary = true + }; + } + + [Test] + public void should_not_clean_if_no_episode_was_replaced() + { + Subject.OnDownload(_downloadMessage); + + Mocker.GetMock().Verify(v => v.Clean(It.IsAny()), Times.Never()); + } + + [Test] + public void should_clean_if_episode_was_replaced() + { + GivenOldFiles(); + Subject.OnDownload(_downloadMessage); + + Mocker.GetMock().Verify(v => v.Clean(It.IsAny()), Times.Once()); + } + } +} diff --git a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj index 66bd95291..23a7f3ea0 100644 --- a/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj +++ b/src/NzbDrone.Core.Test/NzbDrone.Core.Test.csproj @@ -55,8 +55,9 @@ False ..\packages\FluentMigrator.1.1.1.0\tools\FluentMigrator.Runner.dll - - ..\packages\FluentValidation.4.0.0.1\lib\Net40\FluentValidation.dll + + False + ..\packages\FluentValidation.5.0.0.1\lib\Net40\FluentValidation.dll @@ -79,11 +80,11 @@ False - ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll False @@ -131,6 +132,7 @@ + @@ -167,6 +169,7 @@ + diff --git a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs index 5652f3b6c..c80d578b9 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParserFixture.cs @@ -120,7 +120,7 @@ namespace NzbDrone.Core.Test.ParserTests ExceptionVerification.IgnoreWarns(); } - [TestCase("[DmonHiro] The Severing Crime Edge - Cut 02 - Portrait Of Heresy [BD, 720p] [BE36E9E0]")] + [TestCase("THIS SHOULD NEVER PARSE")] public void unparsable_title_should_log_warn_and_return_null(string title) { Parser.Parser.ParseTitle(title).Should().BeNull(); @@ -147,7 +147,9 @@ namespace NzbDrone.Core.Test.ParserTests [TestCase("Hell.on.Wheels.S02E09-E10.720p.HDTV.x264-EVOLVE", "Hell on Wheels", 2, new[] { 9, 10 })] [TestCase("Grey's Anatomy - 8x01_02 - Free Falling", "Grey's Anatomy", 8, new [] { 1,2 })] [TestCase("8x01_02 - Free Falling", "", 8, new[] { 1, 2 })] - [TestCase("Kaamelott.S01E91-E100", "Kaamelott", 1,new[] { 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 })] + [TestCase("Kaamelott.S01E91-E100", "Kaamelott", 1, new[] { 91, 92, 93, 94, 95, 96, 97, 98, 99, 100 })] + [TestCase("Neighbours.S29E161-E165.PDTV.x264-FQM", "Neighbours", 29, new[] { 161, 162, 163, 164, 165 })] + [TestCase("Shortland.Street.S22E5363-E5366.HDTV.x264-FiHTV", "Shortland Street", 22, new[] { 5363, 5364, 5365, 5366 })] public void TitleParse_multi(string postTitle, string title, int season, int[] episodes) { var result = Parser.Parser.ParseTitle(postTitle); @@ -174,7 +176,39 @@ namespace NzbDrone.Core.Test.ParserTests result.Should().NotBeNull(); result.SeriesTitle.Should().Be(title.CleanSeriesTitle()); result.AirDate.Should().Be(airDate.ToString(Episode.AIR_DATE_FORMAT)); - result.EpisodeNumbers.Should().BeNull(); + result.EpisodeNumbers.Should().BeEmpty(); + } + + [TestCase("[SubDESU]_High_School_DxD_07_(1280x720_x264-AAC)_[6B7FD717]", "High School DxD", 7, 0, 0)] + [TestCase("[Chihiro]_Working!!_-_06_[848x480_H.264_AAC][859EEAFA]", "Working!!", 6, 0, 0)] + [TestCase("[Commie]_Senki_Zesshou_Symphogear_-_11_[65F220B4]", "Senki_Zesshou_Symphogear", 11, 0, 0)] + [TestCase("[Underwater]_Rinne_no_Lagrange_-_12_(720p)_[5C7BC4F9]", "Rinne_no_Lagrange", 12, 0, 0)] + [TestCase("[Commie]_Rinne_no_Lagrange_-_15_[E76552EA]", "Rinne_no_Lagrange", 15, 0, 0)] + [TestCase("[HorribleSubs]_Hunter_X_Hunter_-_33_[720p]", "Hunter_X_Hunter", 33, 0, 0)] + [TestCase("[HorribleSubs]_Fairy_Tail_-_145_[720p]", "Fairy_Tail", 145, 0, 0)] + [TestCase("[HorribleSubs] Tonari no Kaibutsu-kun - 13 [1080p].mkv", "Tonari no Kaibutsu-kun", 13, 0, 0)] + [TestCase("[Doremi].Yes.Pretty.Cure.5.Go.Go!.31.[1280x720].[C65D4B1F].mkv", "Yes.Pretty.Cure.5.Go.Go!", 31, 0, 0)] + [TestCase("[K-F] One Piece 214", "One Piece", 214, 0, 0)] + [TestCase("[K-F] One Piece S10E14 214", "One Piece", 214, 10, 14)] + [TestCase("[K-F] One Piece 10x14 214", "One Piece", 214, 10, 14)] + [TestCase("[K-F] One Piece 214 10x14", "One Piece", 214, 10, 14)] + [TestCase("One Piece S10E14 214", "One Piece", 214, 10, 14)] + [TestCase("One Piece 10x14 214", "One Piece", 214, 10, 14)] + [TestCase("One Piece 214 10x14", "One Piece", 214, 10, 14)] + [TestCase("214 One Piece 10x14", "One Piece", 214, 10, 14)] + [TestCase("Bleach - 031 - The Resolution to Kill [Lunar].avi", "Bleach", 31, 0, 0)] + [TestCase("Bleach - 031 - The Resolution to Kill [Lunar]", "Bleach", 31, 0, 0)] + [TestCase("[ACX]Hack Sign 01 Role Play [Kosaka] [9C57891E].mkv", "Hack Sign", 1, 0, 0)] + [TestCase("[SFW-sage] Bakuman S3 - 12 [720p][D07C91FC]", "Bakuman S3", 12, 0, 0)] + [TestCase("ducktales_e66_time_is_money_part_one_marking_time", "DuckTales", 66, 0, 0)] + public void parse_absolute_numbers(string postTitle, string title, int absoluteEpisodeNumber, int seasonNumber, int episodeNumber) + { + var result = Parser.Parser.ParseTitle(postTitle); + result.Should().NotBeNull(); + result.AbsoluteEpisodeNumbers.First().Should().Be(absoluteEpisodeNumber); + result.SeasonNumber.Should().Be(seasonNumber); + result.EpisodeNumbers.FirstOrDefault().Should().Be(episodeNumber); + result.SeriesTitle.Should().Be(title.CleanSeriesTitle()); } diff --git a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs index b1d235dee..59f6d031f 100644 --- a/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs +++ b/src/NzbDrone.Core.Test/ParserTests/ParsingServiceTests/GetEpisodesFixture.cs @@ -38,7 +38,8 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests { SeriesTitle = _series.Title, SeasonNumber = 1, - EpisodeNumbers = new[] { 1 } + EpisodeNumbers = new[] { 1 }, + AbsoluteEpisodeNumbers = new int[0] }; _singleEpisodeSearchCriteria = new SingleEpisodeSearchCriteria @@ -69,6 +70,11 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests _series.UseSceneNumbering = true; } + private void GivenAbsoluteNumberingSeries() + { + _parsedEpisodeInfo.AbsoluteEpisodeNumbers = new[] { 1 }; + } + [Test] public void should_get_daily_episode_episode_when_search_criteria_is_null() { @@ -105,6 +111,17 @@ namespace NzbDrone.Core.Test.ParserTests.ParsingServiceTests .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Once()); } + [Test] + public void should_use_search_criteria_episode_when_it_matches_absolute() + { + GivenAbsoluteNumberingSeries(); + + Subject.Map(_parsedEpisodeInfo, _series.TvRageId, _singleEpisodeSearchCriteria); + + Mocker.GetMock() + .Verify(v => v.FindEpisode(It.IsAny(), It.IsAny()), Times.Never()); + } + [Test] public void should_use_scene_numbering_when_series_uses_scene_numbering() { diff --git a/src/NzbDrone.Core.Test/RootFolderTests/FreeSpaceOnDrivesFixture.cs b/src/NzbDrone.Core.Test/RootFolderTests/FreeSpaceOnDrivesFixture.cs index ec5ade721..f236c103f 100644 --- a/src/NzbDrone.Core.Test/RootFolderTests/FreeSpaceOnDrivesFixture.cs +++ b/src/NzbDrone.Core.Test/RootFolderTests/FreeSpaceOnDrivesFixture.cs @@ -21,7 +21,7 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void should_return_one_drive_when_only_one_root_dir_exists() { - Mocker.GetMock>() + Mocker.GetMock() .Setup(s => s.All()) .Returns(new List { new RootFolder { Id = 1, Path = @"C:\Test\TV" } }); @@ -41,7 +41,7 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void should_return_one_drive_when_two_rootDirs_on_the_same_drive_exist() { - Mocker.GetMock>() + Mocker.GetMock() .Setup(s => s.All()) .Returns(new List { new RootFolder { Id = 1, Path = @"C:\Test\TV" }, new RootFolder { Id = 2, Path = @"C:\Test\TV2" }}); @@ -62,7 +62,7 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void should_return_two_drives_when_two_rootDirs_on_the_different_drive_exist() { - Mocker.GetMock>() + Mocker.GetMock() .Setup(s => s.All()) .Returns(new List { new RootFolder { Id = 1, Path = @"C:\Test\TV" }, new RootFolder { Id = 2, Path = @"D:\Test\TV" }}); @@ -87,7 +87,7 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void should_skip_rootDir_if_not_found_on_disk() { - Mocker.GetMock>() + Mocker.GetMock() .Setup(s => s.All()) .Returns(new List { new RootFolder { Id = 1, Path = @"C:\Test\TV" } }); diff --git a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs index 6ffbfde6c..7e09f1519 100644 --- a/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs +++ b/src/NzbDrone.Core.Test/RootFolderTests/RootFolderServiceFixture.cs @@ -1,13 +1,10 @@ - - -using System; +using System; using System.Collections.Generic; using System.IO; using FluentAssertions; using Moq; using NUnit.Framework; using NzbDrone.Common; -using NzbDrone.Core.Datastore; using NzbDrone.Core.RootFolders; using NzbDrone.Core.Test.Framework; using NzbDrone.Test.Common; @@ -25,7 +22,7 @@ namespace NzbDrone.Core.Test.RootFolderTests .Setup(m => m.FolderExists(It.IsAny())) .Returns(true); - Mocker.GetMock>() + Mocker.GetMock() .Setup(s => s.All()) .Returns(new List()); } @@ -45,7 +42,7 @@ namespace NzbDrone.Core.Test.RootFolderTests Subject.Add(root); - Mocker.GetMock>().Verify(c => c.Insert(root), Times.Once()); + Mocker.GetMock().Verify(c => c.Insert(root), Times.Once()); } [Test] @@ -60,14 +57,15 @@ namespace NzbDrone.Core.Test.RootFolderTests public void should_be_able_to_remove_root_dir() { Subject.Remove(1); - Mocker.GetMock>().Verify(c => c.Delete(1), Times.Once()); + Mocker.GetMock().Verify(c => c.Delete(1), Times.Once()); } + [Test] public void None_existing_folder_returns_empty_list() { WithNoneExistingFolder(); - Mocker.GetMock>().Setup(c => c.All()).Returns(new List()); + Mocker.GetMock().Setup(c => c.All()).Returns(new List()); const string path = "d:\\bad folder"; @@ -97,7 +95,7 @@ namespace NzbDrone.Core.Test.RootFolderTests [Test] public void adding_duplicated_root_folder_should_throw() { - Mocker.GetMock>().Setup(c => c.All()).Returns(new List { new RootFolder { Path = "C:\\TV".AsOsAgnostic() } }); + Mocker.GetMock().Setup(c => c.All()).Returns(new List { new RootFolder { Path = "C:\\TV".AsOsAgnostic() } }); Assert.Throws(() => Subject.Add(new RootFolder { Path = @"C:\TV".AsOsAgnostic() })); } diff --git a/src/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/FindEpisodeFixture.cs b/src/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/FindEpisodeFixture.cs index 21fa4c91a..217e23ab8 100644 --- a/src/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/FindEpisodeFixture.cs +++ b/src/NzbDrone.Core.Test/TvTests/EpisodeRepositoryTests/FindEpisodeFixture.cs @@ -20,6 +20,7 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests .With(e => e.SeasonNumber = 1) .With(e => e.SceneSeasonNumber = 2) .With(e => e.EpisodeNumber = 3) + .With(e => e.AbsoluteEpisodeNumber = 3) .With(e => e.SceneEpisodeNumber = 4) .Build(); @@ -51,5 +52,14 @@ namespace NzbDrone.Core.Test.TvTests.EpisodeRepositoryTests .Should() .BeNull(); } + + [Test] + public void should_find_episode_by_absolute_numbering() + { + Subject.Find(_episode.SeriesId, _episode.AbsoluteEpisodeNumber.Value) + .Id + .Should() + .Be(_episode.Id); + } } } diff --git a/src/NzbDrone.Core.Test/packages.config b/src/NzbDrone.Core.Test/packages.config index b751901cd..88c7a8242 100644 --- a/src/NzbDrone.Core.Test/packages.config +++ b/src/NzbDrone.Core.Test/packages.config @@ -4,12 +4,12 @@ - + - - + + diff --git a/src/NzbDrone.Core/Datastore/BasicRepository.cs b/src/NzbDrone.Core/Datastore/BasicRepository.cs index f3e35930f..f82a68354 100644 --- a/src/NzbDrone.Core/Datastore/BasicRepository.cs +++ b/src/NzbDrone.Core/Datastore/BasicRepository.cs @@ -116,6 +116,8 @@ namespace NzbDrone.Core.Datastore DataMapper.Insert(model); + ModelCreated(model); + return model; } @@ -127,12 +129,15 @@ namespace NzbDrone.Core.Datastore } DataMapper.Update(model, c => c.Id == model.Id); + + ModelUpdated(model); + return model; } public void Delete(TModel model) { - DataMapper.Delete(c => c.Id == model.Id); + Delete(model.Id); } public void InsertMany(IList models) @@ -199,6 +204,8 @@ namespace NzbDrone.Core.Datastore .ColumnsIncluding(properties) .Entity(model) .Execute(); + + ModelUpdated(model); } public virtual PagingSpec GetPaged(PagingSpec pagingSpec) diff --git a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs index f1d348b17..9da0d90ac 100644 --- a/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs +++ b/src/NzbDrone.Core/Download/Clients/Sabnzbd/SabCommunicationProxy.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using NLog; using NzbDrone.Common.Serializer; using NzbDrone.Core.Configuration; using RestSharp; @@ -16,10 +17,12 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd public class SabCommunicationProxy : ISabCommunicationProxy { private readonly IConfigService _configService; + private readonly Logger _logger; - public SabCommunicationProxy(IConfigService configService) + public SabCommunicationProxy(IConfigService configService, Logger logger) { _configService = configService; + _logger = logger; } public string DownloadNzb(Stream nzb, string title, string category, int priority) @@ -44,7 +47,8 @@ namespace NzbDrone.Core.Download.Clients.Sabnzbd { var client = BuildClient(action); var response = client.Execute(restRequest); - + _logger.Trace("Response: {0}", response); + CheckForError(response); return response.Content; diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs new file mode 100644 index 000000000..ece5ce6c7 --- /dev/null +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupAdditionalNamingSpecs.cs @@ -0,0 +1,29 @@ +using NLog; +using NzbDrone.Core.Datastore; + +namespace NzbDrone.Core.Housekeeping.Housekeepers +{ + public class CleanupAdditionalNamingSpecs : IHousekeepingTask + { + private readonly IDatabase _database; + private readonly Logger _logger; + + public CleanupAdditionalNamingSpecs(IDatabase database, Logger logger) + { + _database = database; + _logger = logger; + } + + public void Clean() + { + _logger.Trace("Running naming spec cleanup"); + + var mapper = _database.GetDataMapper(); + + mapper.ExecuteNonQuery(@"DELETE FROM NamingConfig + WHERE ID NOT IN ( + SELECT ID FROM NamingConfig + LIMIT 1)"); + } + } +} diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs index 0965fc33c..a75a69ded 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedEpisodes.cs @@ -1,6 +1,5 @@ using NLog; using NzbDrone.Core.Datastore; -using NzbDrone.Core.Tv; namespace NzbDrone.Core.Housekeeping.Housekeepers { diff --git a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs index 11567a2ba..f715665fb 100644 --- a/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs +++ b/src/NzbDrone.Core/Housekeeping/Housekeepers/CleanupOrphanedHistoryItems.cs @@ -1,6 +1,5 @@ using NLog; using NzbDrone.Core.Datastore; -using NzbDrone.Core.History; namespace NzbDrone.Core.Housekeeping.Housekeepers { diff --git a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs index a9cf5eca2..8de08902b 100644 --- a/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs +++ b/src/NzbDrone.Core/Indexers/Newznab/Newznab.cs @@ -101,10 +101,10 @@ namespace NzbDrone.Core.Indexers.Newznab { if (tvRageId > 0) { - return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM/dd}", url, tvRageId, date)).ToList(); + return RecentFeed.Select(url => String.Format("{0}&limit=100&rid={1}&season={2:yyyy}&ep={2:MM}/{2:dd}", url, tvRageId, date)).ToList(); } - return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM/dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList(); + return RecentFeed.Select(url => String.Format("{0}&limit=100&q={1}&season={2:yyyy}&ep={2:MM}/{2:dd}", url, NewsnabifyTitle(seriesTitle), date)).ToList(); } public override IEnumerable GetSeasonSearchUrls(string seriesTitle, int tvRageId, int seasonNumber, int offset) diff --git a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs index 069bc18e3..80df872a2 100644 --- a/src/NzbDrone.Core/MediaFiles/DiskScanService.cs +++ b/src/NzbDrone.Core/MediaFiles/DiskScanService.cs @@ -54,6 +54,7 @@ namespace NzbDrone.Core.MediaFiles var decisions = _importDecisionMaker.GetImportDecisions(mediaFileList, series, false); _importApprovedEpisodes.Import(decisions); + _logger.Info("Completed scanning disk for {0}", series.Title); } public string[] GetVideoFiles(string path, bool allDirectories = true) @@ -65,7 +66,7 @@ namespace NzbDrone.Core.MediaFiles var mediaFileList = filesOnDisk.Where(c => MediaFileExtensions.Extensions.Contains(Path.GetExtension(c).ToLower())).ToList(); - _logger.Trace("{0} video files were found in {1}", mediaFileList.Count, path); + _logger.Debug("{0} video files were found in {1}", mediaFileList.Count, path); return mediaFileList.ToArray(); } diff --git a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs index 4cb226005..194aaeef3 100644 --- a/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs +++ b/src/NzbDrone.Core/MediaFiles/DownloadedEpisodesImportService.cs @@ -99,6 +99,7 @@ namespace NzbDrone.Core.MediaFiles { var cleanedUpName = GetCleanedUpFolderName(subfolderInfo.Name); var series = _parsingService.GetSeries(cleanedUpName); + var quality = QualityParser.ParseQuality(cleanedUpName); if (series == null) { @@ -108,7 +109,7 @@ namespace NzbDrone.Core.MediaFiles var videoFiles = _diskScanService.GetVideoFiles(subfolderInfo.FullName); - return ProcessFiles(series, videoFiles); + return ProcessFiles(series, quality, videoFiles); } private void ProcessVideoFile(string videoFile) @@ -127,12 +128,12 @@ namespace NzbDrone.Core.MediaFiles return; } - ProcessFiles(series, videoFile); + ProcessFiles(series, null, videoFile); } - private List ProcessFiles(Series series, params string[] videoFiles) + private List ProcessFiles(Series series, QualityModel quality, params string[] videoFiles) { - var decisions = _importDecisionMaker.GetImportDecisions(videoFiles, series, true); + var decisions = _importDecisionMaker.GetImportDecisions(videoFiles, series, true, quality); return _importApprovedEpisodes.Import(decisions, true); } diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeFileMoveResult.cs b/src/NzbDrone.Core/MediaFiles/EpisodeFileMoveResult.cs new file mode 100644 index 000000000..978d60930 --- /dev/null +++ b/src/NzbDrone.Core/MediaFiles/EpisodeFileMoveResult.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; + +namespace NzbDrone.Core.MediaFiles +{ + public class EpisodeFileMoveResult + { + public EpisodeFileMoveResult() + { + OldFiles = new List(); + } + + public String Path { get; set; } + public List OldFiles { get; set; } + } +} diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs index ce14d7054..325bf8223 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportApprovedEpisodes.cs @@ -44,6 +44,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport foreach (var importDecision in qualifiedImports.OrderByDescending(e => e.LocalEpisode.Size)) { var localEpisode = importDecision.LocalEpisode; + var oldFiles = new List(); try { @@ -65,11 +66,12 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport episodeFile.SeasonNumber = localEpisode.SeasonNumber; episodeFile.Episodes = localEpisode.Episodes; - if (newDownload) { episodeFile.SceneName = Path.GetFileNameWithoutExtension(localEpisode.Path.CleanFilePath()); - episodeFile.Path = _episodeFileUpgrader.UpgradeEpisodeFile(episodeFile, localEpisode); + var moveResult = _episodeFileUpgrader.UpgradeEpisodeFile(episodeFile, localEpisode); + episodeFile.Path = moveResult.Path; + oldFiles = moveResult.OldFiles; } _mediaFileService.Add(episodeFile); @@ -78,7 +80,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport if (newDownload) { _eventAggregator.PublishEvent(new EpisodeImportedEvent(localEpisode, episodeFile)); - _eventAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode)); + _eventAggregator.PublishEvent(new EpisodeDownloadedEvent(localEpisode, episodeFile, oldFiles)); } } catch (Exception e) diff --git a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs index 1566acbe0..8263533ea 100644 --- a/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs +++ b/src/NzbDrone.Core/MediaFiles/EpisodeImport/ImportDecisionMaker.cs @@ -6,6 +6,7 @@ using NzbDrone.Common; using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Parser; using NzbDrone.Core.Parser.Model; +using NzbDrone.Core.Qualities; using NzbDrone.Core.Tv; @@ -13,7 +14,7 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport { public interface IMakeImportDecision { - List GetImportDecisions(IEnumerable videoFiles, Series series, bool sceneSource); + List GetImportDecisions(IEnumerable videoFiles, Series series, bool sceneSource, QualityModel quality = null); } public class ImportDecisionMaker : IMakeImportDecision @@ -38,16 +39,16 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport _logger = logger; } - public List GetImportDecisions(IEnumerable videoFiles, Series series, bool sceneSource) + public List GetImportDecisions(IEnumerable videoFiles, Series series, bool sceneSource, QualityModel quality = null) { var newFiles = _mediaFileService.FilterExistingFiles(videoFiles.ToList(), series.Id); _logger.Debug("Analysing {0}/{1} files.", newFiles.Count, videoFiles.Count()); - return GetDecisions(newFiles, series, sceneSource).ToList(); + return GetDecisions(newFiles, series, sceneSource, quality).ToList(); } - private IEnumerable GetDecisions(IEnumerable videoFiles, Series series, bool sceneSource) + private IEnumerable GetDecisions(IEnumerable videoFiles, Series series, bool sceneSource, QualityModel quality = null) { foreach (var file in videoFiles) { @@ -59,6 +60,11 @@ namespace NzbDrone.Core.MediaFiles.EpisodeImport if (parsedEpisode != null) { + if (quality != null && quality > parsedEpisode.Quality) + { + parsedEpisode.Quality = quality; + } + parsedEpisode.Size = _diskProvider.GetFileSize(file); decision = GetDecision(parsedEpisode); } diff --git a/src/NzbDrone.Core/MediaFiles/Events/EpisodeDownloadedEvent.cs b/src/NzbDrone.Core/MediaFiles/Events/EpisodeDownloadedEvent.cs index b7b80e4fd..af22b63fb 100644 --- a/src/NzbDrone.Core/MediaFiles/Events/EpisodeDownloadedEvent.cs +++ b/src/NzbDrone.Core/MediaFiles/Events/EpisodeDownloadedEvent.cs @@ -1,4 +1,5 @@ -using NzbDrone.Common.Messaging; +using System.Collections.Generic; +using NzbDrone.Common.Messaging; using NzbDrone.Core.Parser.Model; namespace NzbDrone.Core.MediaFiles.Events @@ -6,10 +7,14 @@ namespace NzbDrone.Core.MediaFiles.Events public class EpisodeDownloadedEvent : IEvent { public LocalEpisode Episode { get; private set; } + public EpisodeFile EpisodeFile { get; private set; } + public List OldFiles { get; private set; } - public EpisodeDownloadedEvent(LocalEpisode episode) + public EpisodeDownloadedEvent(LocalEpisode episode, EpisodeFile episodeFile, List oldFiles) { Episode = episode; + EpisodeFile = episodeFile; + OldFiles = oldFiles; } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs index 4879218d0..ce8170a95 100644 --- a/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs +++ b/src/NzbDrone.Core/MediaFiles/MediaInfo/VideoFileInfoReader.cs @@ -61,7 +61,7 @@ namespace NzbDrone.Core.MediaFiles.MediaInfo aBitRate = aBitRate.Remove(ABindex); Int32.TryParse(aBitRate, out audioBitRate); - Int32.TryParse(mediaInfo.Get(StreamKind.General, 0, "PlayTime"), out runTime); + Int32.TryParse(mediaInfo.Get(StreamKind.Video, 0, "PlayTime"), out runTime); Int32.TryParse(mediaInfo.Get(StreamKind.Audio, 0, "StreamCount"), out streamCount); string audioChannelsStr = mediaInfo.Get(StreamKind.Audio, 0, "Channel(s)"); diff --git a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs index 75ee6869e..6a299d511 100644 --- a/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs +++ b/src/NzbDrone.Core/MediaFiles/UpgradeMediaFileService.cs @@ -7,7 +7,7 @@ namespace NzbDrone.Core.MediaFiles { public interface IUpgradeMediaFiles { - string UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode); + EpisodeFileMoveResult UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode); } public class UpgradeMediaFileService : IUpgradeMediaFiles @@ -31,8 +31,9 @@ namespace NzbDrone.Core.MediaFiles _logger = logger; } - public string UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) + public EpisodeFileMoveResult UpgradeEpisodeFile(EpisodeFile episodeFile, LocalEpisode localEpisode) { + var moveFileResult = new EpisodeFileMoveResult(); var existingFiles = localEpisode.Episodes .Where(e => e.EpisodeFileId > 0) .Select(e => e.EpisodeFile.Value) @@ -48,11 +49,14 @@ namespace NzbDrone.Core.MediaFiles _recycleBinProvider.DeleteFile(file.Path); } + moveFileResult.OldFiles.Add(file); _mediaFileService.Delete(file, true); } _logger.Trace("Moving episode file: {0}", episodeFile); - return _episodeFileMover.MoveEpisodeFile(episodeFile, localEpisode); + moveFileResult.Path = _episodeFileMover.MoveEpisodeFile(episodeFile, localEpisode); + + return moveFileResult; } } } diff --git a/src/NzbDrone.Core/MetadataSource/Trakt/FullShow.cs b/src/NzbDrone.Core/MetadataSource/Trakt/FullShow.cs index 32c60c5fb..c35ceee3f 100644 --- a/src/NzbDrone.Core/MetadataSource/Trakt/FullShow.cs +++ b/src/NzbDrone.Core/MetadataSource/Trakt/FullShow.cs @@ -25,6 +25,7 @@ namespace NzbDrone.Core.MetadataSource.Trakt public int tvrage_id { get; set; } public int last_updated { get; set; } public string poster { get; set; } + public bool? ended { get; set; } public Images images { get; set; } public List genres { get; set; } public List seasons { get; set; } diff --git a/src/NzbDrone.Core/MetadataSource/TraktProxy.cs b/src/NzbDrone.Core/MetadataSource/TraktProxy.cs index a283a32c2..ff8dfb940 100644 --- a/src/NzbDrone.Core/MetadataSource/TraktProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/TraktProxy.cs @@ -78,7 +78,7 @@ namespace NzbDrone.Core.MetadataSource series.Network = show.network; series.AirTime = show.air_time_utc; series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", ""); - series.Status = GetSeriesStatus(show.status); + series.Status = GetSeriesStatus(show.status, show.ended); series.Seasons = show.seasons.Select(s => new Tv.Season { @@ -135,9 +135,17 @@ namespace NzbDrone.Core.MetadataSource return withoutExtension + "-300" + extension; } - private static SeriesStatusType GetSeriesStatus(string status) + private static SeriesStatusType GetSeriesStatus(string status, bool? ended) { - if (string.IsNullOrWhiteSpace(status)) return SeriesStatusType.Continuing; + if (string.IsNullOrWhiteSpace(status)) + { + if (ended.HasValue && ended.Value) + { + return SeriesStatusType.Ended; + } + + return SeriesStatusType.Continuing; + } if (status.Equals("Ended", StringComparison.InvariantCultureIgnoreCase)) return SeriesStatusType.Ended; return SeriesStatusType.Continuing; } diff --git a/src/NzbDrone.Core/Notifications/DownloadMessage.cs b/src/NzbDrone.Core/Notifications/DownloadMessage.cs new file mode 100644 index 000000000..5e5ba6768 --- /dev/null +++ b/src/NzbDrone.Core/Notifications/DownloadMessage.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using NzbDrone.Core.MediaFiles; +using NzbDrone.Core.Tv; + +namespace NzbDrone.Core.Notifications +{ + public class DownloadMessage + { + public String Message { get; set; } + public Series Series { get; set; } + public EpisodeFile EpisodeFile { get; set; } + public List OldFiles { get; set; } + + public override string ToString() + { + return Message; + } + } +} diff --git a/src/NzbDrone.Core/Notifications/Email/Email.cs b/src/NzbDrone.Core/Notifications/Email/Email.cs index 30a4e2d23..d92c21a18 100644 --- a/src/NzbDrone.Core/Notifications/Email/Email.cs +++ b/src/NzbDrone.Core/Notifications/Email/Email.cs @@ -25,10 +25,10 @@ namespace NzbDrone.Core.Notifications.Email _smtpProvider.SendEmail(Settings, subject, body); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string subject = "NzbDrone [TV] - Downloaded"; - var body = String.Format("{0} Downloaded and sorted.", message); + var body = String.Format("{0} Downloaded and sorted.", message.Message); _smtpProvider.SendEmail(Settings, subject, body); } diff --git a/src/NzbDrone.Core/Notifications/Growl/Growl.cs b/src/NzbDrone.Core/Notifications/Growl/Growl.cs index ac8bef299..9682a5acb 100644 --- a/src/NzbDrone.Core/Notifications/Growl/Growl.cs +++ b/src/NzbDrone.Core/Notifications/Growl/Growl.cs @@ -23,11 +23,11 @@ namespace NzbDrone.Core.Notifications.Growl _growlProvider.SendNotification(title, message, "GRAB", Settings.Host, Settings.Port, Settings.Password); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string title = "Episode Downloaded"; - _growlProvider.SendNotification(title, message, "DOWNLOAD", Settings.Host, Settings.Port, Settings.Password); + _growlProvider.SendNotification(title, message.Message, "DOWNLOAD", Settings.Host, Settings.Port, Settings.Password); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/INotification.cs b/src/NzbDrone.Core/Notifications/INotification.cs index 5b5fd5a13..97ee4dc0a 100644 --- a/src/NzbDrone.Core/Notifications/INotification.cs +++ b/src/NzbDrone.Core/Notifications/INotification.cs @@ -8,7 +8,7 @@ namespace NzbDrone.Core.Notifications string Link { get; } void OnGrab(string message); - void OnDownload(string message, Series series); + void OnDownload(DownloadMessage message); void AfterRename(Series series); } } diff --git a/src/NzbDrone.Core/Notifications/NotificationBase.cs b/src/NzbDrone.Core/Notifications/NotificationBase.cs index 22e992ded..61377a483 100644 --- a/src/NzbDrone.Core/Notifications/NotificationBase.cs +++ b/src/NzbDrone.Core/Notifications/NotificationBase.cs @@ -28,7 +28,7 @@ namespace NzbDrone.Core.Notifications public abstract string Link { get; } public abstract void OnGrab(string message); - public abstract void OnDownload(string message, Series series); + public abstract void OnDownload(DownloadMessage message); public abstract void AfterRename(Series series); protected TSettings Settings diff --git a/src/NzbDrone.Core/Notifications/NotificationService.cs b/src/NzbDrone.Core/Notifications/NotificationService.cs index f0b24a264..2c016b1f7 100644 --- a/src/NzbDrone.Core/Notifications/NotificationService.cs +++ b/src/NzbDrone.Core/Notifications/NotificationService.cs @@ -73,13 +73,17 @@ namespace NzbDrone.Core.Notifications public void Handle(EpisodeDownloadedEvent message) { - var messageBody = GetMessage(message.Episode.Series, message.Episode.Episodes, message.Episode.ParsedEpisodeInfo.Quality); + var downloadMessage = new DownloadMessage(); + downloadMessage.Message = GetMessage(message.Episode.Series, message.Episode.Episodes, message.Episode.ParsedEpisodeInfo.Quality); + downloadMessage.Series = message.Episode.Series; + downloadMessage.EpisodeFile = message.EpisodeFile; + downloadMessage.OldFiles = message.OldFiles; foreach (var notification in _notificationFactory.OnDownloadEnabled()) { try { - notification.OnDownload(messageBody, message.Episode.Series); + notification.OnDownload(downloadMessage); } catch (Exception ex) diff --git a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs index d1a10a8a6..ffc1aa6ab 100644 --- a/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs +++ b/src/NzbDrone.Core/Notifications/NotifyMyAndroid/NotifyMyAndroid.cs @@ -23,11 +23,11 @@ namespace NzbDrone.Core.Notifications.NotifyMyAndroid _notifyMyAndroidProxy.SendNotification(title, message, Settings.ApiKey, (NotifyMyAndroidPriority)Settings.Priority); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string title = "Episode Downloaded"; - _notifyMyAndroidProxy.SendNotification(title, message, Settings.ApiKey, (NotifyMyAndroidPriority)Settings.Priority); + _notifyMyAndroidProxy.SendNotification(title, message.Message, Settings.ApiKey, (NotifyMyAndroidPriority)Settings.Priority); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs b/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs index 72023baa0..322af1f06 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexClient.cs @@ -22,10 +22,10 @@ namespace NzbDrone.Core.Notifications.Plex _plexProvider.Notify(Settings, header, message); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string header = "NzbDrone [TV] - Downloaded"; - _plexProvider.Notify(Settings, header, message); + _plexProvider.Notify(Settings, header, message.Message); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs b/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs index 57d359880..31ff31aaf 100644 --- a/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs +++ b/src/NzbDrone.Core/Notifications/Plex/PlexServer.cs @@ -20,7 +20,7 @@ namespace NzbDrone.Core.Notifications.Plex { } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { UpdateIfEnabled(); } diff --git a/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs b/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs index f8cd93e9b..b5264412a 100644 --- a/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs +++ b/src/NzbDrone.Core/Notifications/Prowl/Prowl.cs @@ -24,11 +24,11 @@ namespace NzbDrone.Core.Notifications.Prowl _prowlProvider.SendNotification(title, message, Settings.ApiKey, (NotificationPriority)Settings.Priority); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string title = "Episode Downloaded"; - _prowlProvider.SendNotification(title, message, Settings.ApiKey, (NotificationPriority)Settings.Priority); + _prowlProvider.SendNotification(title, message.Message, Settings.ApiKey, (NotificationPriority)Settings.Priority); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs b/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs index db64a7445..5f3931075 100644 --- a/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs +++ b/src/NzbDrone.Core/Notifications/PushBullet/PushBullet.cs @@ -23,11 +23,11 @@ namespace NzbDrone.Core.Notifications.PushBullet _pushBulletProxy.SendNotification(title, message, Settings.ApiKey, Settings.DeviceId); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string title = "Episode Downloaded"; - _pushBulletProxy.SendNotification(title, message, Settings.ApiKey, Settings.DeviceId); + _pushBulletProxy.SendNotification(title, message.Message, Settings.ApiKey, Settings.DeviceId); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs b/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs index 0a8f1d1c6..a9f447c0f 100644 --- a/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs +++ b/src/NzbDrone.Core/Notifications/Pushover/Pushover.cs @@ -23,11 +23,11 @@ namespace NzbDrone.Core.Notifications.Pushover _pushoverProxy.SendNotification(title, message, Settings.UserKey, (PushoverPriority)Settings.Priority); } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string title = "Episode Downloaded"; - _pushoverProxy.SendNotification(title, message, Settings.UserKey, (PushoverPriority)Settings.Priority); + _pushoverProxy.SendNotification(title, message.Message, Settings.UserKey, (PushoverPriority)Settings.Priority); } public override void AfterRename(Series series) diff --git a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs index e0a2fa260..6178056f9 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/HttpApiProvider.cs @@ -119,7 +119,7 @@ namespace NzbDrone.Core.Notifications.Xbmc return String.Empty; var xDoc = XDocument.Load(new StringReader(response.Replace("&", "&"))); - var xml = (from x in xDoc.Descendants("xml") select x).FirstOrDefault(); + var xml = xDoc.Descendants("xml").Select(x => x).FirstOrDefault(); if (xml == null) return null; diff --git a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs index f6b3a6abe..f111ae7b4 100644 --- a/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs +++ b/src/NzbDrone.Core/Notifications/Xbmc/Xbmc.cs @@ -1,4 +1,5 @@ -using NzbDrone.Core.Tv; +using System.Linq; +using NzbDrone.Core.Tv; namespace NzbDrone.Core.Notifications.Xbmc { @@ -26,16 +27,16 @@ namespace NzbDrone.Core.Notifications.Xbmc } } - public override void OnDownload(string message, Series series) + public override void OnDownload(DownloadMessage message) { const string header = "NzbDrone [TV] - Downloaded"; if (Settings.Notify) { - _xbmcProvider.Notify(Settings, header, message); + _xbmcProvider.Notify(Settings, header, message.Message); } - UpdateAndClean(series); + UpdateAndClean(message.Series, message.OldFiles.Any()); } public override void AfterRename(Series series) @@ -43,14 +44,14 @@ namespace NzbDrone.Core.Notifications.Xbmc UpdateAndClean(series); } - private void UpdateAndClean(Series series) + private void UpdateAndClean(Series series, bool clean = true) { if (Settings.UpdateLibrary) { _xbmcProvider.Update(Settings, series); } - if (Settings.CleanLibrary) + if (clean && Settings.CleanLibrary) { _xbmcProvider.Clean(Settings); } diff --git a/src/NzbDrone.Core/NzbDrone.Core.csproj b/src/NzbDrone.Core/NzbDrone.Core.csproj index 9007ad74e..1664adc77 100644 --- a/src/NzbDrone.Core/NzbDrone.Core.csproj +++ b/src/NzbDrone.Core/NzbDrone.Core.csproj @@ -67,9 +67,9 @@ False ..\packages\FluentMigrator.1.1.1.0\tools\FluentMigrator.Runner.dll - + False - ..\packages\FluentValidation.4.0.0.1\lib\Net40\FluentValidation.dll + ..\packages\FluentValidation.5.0.0.1\lib\Net40\FluentValidation.dll ..\packages\Growl.0.6\lib\Growl.Connector.dll @@ -83,11 +83,11 @@ False - ..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll + ..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - + False - ..\packages\NLog.2.0.1.2\lib\net40\NLog.dll + ..\packages\NLog.2.1.0\lib\net40\NLog.dll ..\packages\valueinjecter.2.3.3\lib\net35\Omu.ValueInjecter.dll @@ -96,9 +96,9 @@ False ..\packages\Prowlin.0.9.4456.26422\lib\net40\Prowlin.dll - + False - ..\packages\RestSharp.104.2.0\lib\net4\RestSharp.dll + ..\packages\RestSharp.104.3.3\lib\net4\RestSharp.dll @@ -247,6 +247,7 @@ + @@ -274,6 +275,7 @@ + @@ -289,6 +291,7 @@ + @@ -436,6 +439,7 @@ + diff --git a/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs b/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs index 14fd53a80..d4bbefaac 100644 --- a/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ParsedEpisodeInfo.cs @@ -11,11 +11,27 @@ namespace NzbDrone.Core.Parser.Model public QualityModel Quality { get; set; } public int SeasonNumber { get; set; } public int[] EpisodeNumbers { get; set; } + public int[] AbsoluteEpisodeNumbers { get; set; } public String AirDate { get; set; } public Language Language { get; set; } - public bool FullSeason { get; set; } + public ParsedEpisodeInfo() + { + EpisodeNumbers = new int[0]; + AbsoluteEpisodeNumbers = new int[0]; + } + + public bool IsDaily() + { + return !String.IsNullOrWhiteSpace(AirDate); + } + + public bool IsAbsoluteNumbering() + { + return AbsoluteEpisodeNumbers.Any(); + } + public override string ToString() { string episodeString = "[Unknown Episode]"; @@ -35,10 +51,5 @@ namespace NzbDrone.Core.Parser.Model return string.Format("{0} - {1} {2}", SeriesTitle, episodeString, Quality); } - - public bool IsDaily() - { - return !String.IsNullOrWhiteSpace(AirDate); - } } } \ No newline at end of file diff --git a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs index e5b3d9ed8..b5ae81ad8 100644 --- a/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs +++ b/src/NzbDrone.Core/Parser/Model/ReleaseInfo.cs @@ -19,6 +19,13 @@ namespace NzbDrone.Core.Parser.Model { return DateTime.UtcNow.Subtract(PublishDate).Days; } + + //This prevents manually downloading a release from blowing up in mono + //TODO: Is there a better way? + private set + { + + } } public string ReleaseGroup { get; set; } diff --git a/src/NzbDrone.Core/Parser/Parser.cs b/src/NzbDrone.Core/Parser/Parser.cs index 9122245ab..ef62d9034 100644 --- a/src/NzbDrone.Core/Parser/Parser.cs +++ b/src/NzbDrone.Core/Parser/Parser.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Linq; using System.Text.RegularExpressions; @@ -20,6 +21,22 @@ namespace NzbDrone.Core.Parser new Regex(@"^(?.+?)?\W*(?<airyear>\d{4})\W+(?<airmonth>[0-1][0-9])\W+(?<airday>[0-3][0-9])(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Anime - Absolute Episode Number + Title + Season+Episode + new Regex(@"^(?:(?<absoluteepisode>\d{2,3})(?:_|-|\s|\.)+)+(?<title>.+?)(?:\W|_)+(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2}(?!\d+)))+)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //Anime - [SubGroup] Title Absolute Episode Number + Season+Episode + new Regex(@"^(?:\[(?<subgroup>.+?)\](?:_|-|\s|\.))?(?<title>.+?)(?:(?:\W|_)+(?<absoluteepisode>\d{2,3}))+(?:_|-|\s|\.)+(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2}(?!\d+)))+)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //Anime - [SubGroup] Title Season+Episode + Absolute Episode Number + new Regex(@"^(?:\[(?<subgroup>.+?)\](?:_|-|\s|\.))?(?<title>.+?)(?:\W|_)+(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]){1,2}(?<episode>\d{2}(?!\d+)))+)(?:\s|\.)(?:(?<absoluteepisode>\d{2,3})(?:_|-|\s|\.|$)+)+", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //Anime - [SubGroup] Title Absolute Episode Number + new Regex(@"^\[(?<subgroup>.+?)\](?:_|-|\s|\.)?(?<title>.+?)(?:(?:\W|_)+(?<absoluteepisode>\d{2,}))+", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Multi-Part episodes without a title (S01E05.S01E06) new Regex(@"^(?:\W*S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:[ex]){1,2}(?<episode>\d{1,3}(?!\d+)))+){2,}(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), @@ -44,6 +61,10 @@ namespace NzbDrone.Core.Parser new Regex(@"^(?<title>.*?)(?:\W?S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]){1,2}(?<episode>\d{1}))+)+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Anime - Title Absolute Episode Number [SubGroup] + new Regex(@"^(?<title>.+?)(?:(?:_|-|\s|\.)+(?<absoluteepisode>\d{2,3}))+(?:.+?)\[(?<subgroup>.+?)\](?:\.|$)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + //Supports 103/113 naming new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+)\d{1})(?<episode>\d{2}(?!p|i|\d+)))+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), @@ -53,7 +74,7 @@ namespace NzbDrone.Core.Parser RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports 1103/1113 naming - new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+|\(|\[)\d{2})(?<episode>\d{2}(?!p|i|\d+|\)|\]|\W\d+)))+(\W+|_|$)(?!\\)", + new Regex(@"^(?<title>.+?)?(?:\W?(?<season>(?<!\d+|\(|\[|e|x)\d{2})(?<episode>(?<!e|x)\d{2}(?!p|i|\d+|\)|\]|\W\d+)))+(\W+|_|$)(?!\\)", RegexOptions.IgnoreCase | RegexOptions.Compiled), //Supports Season 01 Episode 03 @@ -62,7 +83,20 @@ namespace NzbDrone.Core.Parser //Supports Season only releases new Regex(@"^(?<title>.+?)\W(?:S|Season)\W?(?<season>\d{1,2}(?!\d+))(\W+|_|$)(?<extras>EXTRAS|SUBPACK)?(?!\\)", - RegexOptions.IgnoreCase | RegexOptions.Compiled) + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //4-digit episode number + //Episodes without a title, Single (S01E05, 1x05) AND Multi (S01E04E05, 1x04x05, etc) + new Regex(@"^(?:S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]|_){1,2}(?<episode>\d{4}(?!\d+|i|p)))+)(\W+|_|$)(?!\\)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //Episodes with a title, Single episodes (S01E05, 1x05, etc) & Multi-episode (S01E05E06, S01E05-06, S01E05 E06, etc) + new Regex(@"^(?<title>.+?)(?:(\W|_)+S?(?<season>(?<!\d+)\d{1,2}(?!\d+))(?:(?:\-|[ex]|\W[ex]|_){1,2}(?<episode>\d{4}(?!\d+|i|p)))+)\W?(?!\\)", + RegexOptions.IgnoreCase | RegexOptions.Compiled), + + //Anime - Title Absolute Episode Number + new Regex(@"^(?<title>.+?)(?:(?:_|-|\s|\.)+e(?<absoluteepisode>\d{2,3}))+", + RegexOptions.IgnoreCase | RegexOptions.Compiled), }; private static readonly Regex NormalizeRegex = new Regex(@"((^|\W|_)(a|an|the|and|or|of)($|\W|_))|\W|_|(?:(?<=[^0-9]+)|\b)(?!(?:19\d{2}|20\d{2}))\d+(?=[^0-9ip]+|\b)", @@ -114,6 +148,7 @@ namespace NzbDrone.Core.Parser if (match.Count != 0) { + Debug.WriteLine(regex); try { var result = ParseMatchCollection(match); @@ -226,11 +261,13 @@ namespace NzbDrone.Core.Parser { SeasonNumber = seasons.First(), EpisodeNumbers = new int[0], + AbsoluteEpisodeNumbers = new int[0] }; foreach (Match matchGroup in matchCollection) { var episodeCaptures = matchGroup.Groups["episode"].Captures.Cast<Capture>().ToList(); + var absoluteEpisodeCaptures = matchGroup.Groups["absoluteepisode"].Captures.Cast<Capture>().ToList(); //Allows use to return a list of 0 episodes (We can handle that as a full season release) if (episodeCaptures.Any()) @@ -246,6 +283,20 @@ namespace NzbDrone.Core.Parser var count = last - first + 1; result.EpisodeNumbers = Enumerable.Range(first, count).ToArray(); } + + if (absoluteEpisodeCaptures.Any()) + { + var first = Convert.ToInt32(absoluteEpisodeCaptures.First().Value); + var last = Convert.ToInt32(absoluteEpisodeCaptures.Last().Value); + + if (first > last) + { + return null; + } + + var count = last - first + 1; + result.AbsoluteEpisodeNumbers = Enumerable.Range(first, count).ToArray(); + } else { //Check to see if this is an "Extras" or "SUBPACK" release, if it is, return NULL @@ -256,6 +307,10 @@ namespace NzbDrone.Core.Parser result.FullSeason = true; } } + if (result.AbsoluteEpisodeNumbers.Any() && !result.EpisodeNumbers.Any()) + { + result.SeasonNumber = 0; + } } else diff --git a/src/NzbDrone.Core/Parser/ParsingService.cs b/src/NzbDrone.Core/Parser/ParsingService.cs index 3cd3aa407..ee544d789 100644 --- a/src/NzbDrone.Core/Parser/ParsingService.cs +++ b/src/NzbDrone.Core/Parser/ParsingService.cs @@ -129,6 +129,26 @@ namespace NzbDrone.Core.Parser return result; } + if (parsedEpisodeInfo.IsAbsoluteNumbering()) + { + foreach (var absoluteEpisodeNumber in parsedEpisodeInfo.AbsoluteEpisodeNumbers) + { + var episodeInfo = _episodeService.FindEpisode(series.Id, absoluteEpisodeNumber); + + if (episodeInfo != null) + { + _logger.Info("Using absolute episode number {0} for: {1} - TVDB: {2}x{3:00}", + absoluteEpisodeNumber, + series.Title, + episodeInfo.SeasonNumber, + episodeInfo.EpisodeNumber); + result.Add(episodeInfo); + } + } + + return result; + } + if (parsedEpisodeInfo.EpisodeNumbers == null) return result; diff --git a/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs b/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs new file mode 100644 index 000000000..e15fa0bd3 --- /dev/null +++ b/src/NzbDrone.Core/RootFolders/RootFolderRepository.cs @@ -0,0 +1,27 @@ +using NzbDrone.Core.Datastore; +using NzbDrone.Core.Messaging.Events; + +namespace NzbDrone.Core.RootFolders +{ + public interface IRootFolderRepository : IBasicRepository<RootFolder> + { + + } + + public class RootFolderRepository : BasicRepository<RootFolder>, IRootFolderRepository + { + + public RootFolderRepository(IDatabase database, IEventAggregator eventAggregator) + : base(database, eventAggregator) + { + } + + protected override bool PublishModelEvents + { + get + { + return true; + } + } + } +} \ No newline at end of file diff --git a/src/NzbDrone.Core/RootFolders/RootFolderService.cs b/src/NzbDrone.Core/RootFolders/RootFolderService.cs index 9e441d91d..fe5be8169 100644 --- a/src/NzbDrone.Core/RootFolders/RootFolderService.cs +++ b/src/NzbDrone.Core/RootFolders/RootFolderService.cs @@ -25,15 +25,15 @@ namespace NzbDrone.Core.RootFolders public class RootFolderService : IRootFolderService { private static readonly Logger Logger = NzbDroneLogger.GetLogger(); - private readonly IBasicRepository<RootFolder> _rootFolderRepository; + private readonly IRootFolderRepository _rootFolderRepository; private readonly IDiskProvider _diskProvider; private readonly ISeriesRepository _seriesRepository; private readonly IConfigService _configService; - private static readonly HashSet<string> SpecialFolders = new HashSet<string> { "$recycle.bin", "system volume information", "recycler" }; + private static readonly HashSet<string> SpecialFolders = new HashSet<string> { "$recycle.bin", "system volume information", "recycler", "lost+found" }; - public RootFolderService(IBasicRepository<RootFolder> rootFolderRepository, + public RootFolderService(IRootFolderRepository rootFolderRepository, IDiskProvider diskProvider, ISeriesRepository seriesRepository, IConfigService configService) diff --git a/src/NzbDrone.Core/Tv/EpisodeRepository.cs b/src/NzbDrone.Core/Tv/EpisodeRepository.cs index daba4d5e0..58099d8c3 100644 --- a/src/NzbDrone.Core/Tv/EpisodeRepository.cs +++ b/src/NzbDrone.Core/Tv/EpisodeRepository.cs @@ -11,6 +11,7 @@ namespace NzbDrone.Core.Tv public interface IEpisodeRepository : IBasicRepository<Episode> { Episode Find(int seriesId, int season, int episodeNumber); + Episode Find(int seriesId, int absoluteEpisodeNumber); Episode Get(int seriesId, String date); Episode Find(int seriesId, String date); List<Episode> GetEpisodes(int seriesId); @@ -39,6 +40,11 @@ namespace NzbDrone.Core.Tv return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.SeasonNumber == season && s.EpisodeNumber == episodeNumber); } + public Episode Find(int seriesId, int absoluteEpisodeNumber) + { + return Query.SingleOrDefault(s => s.SeriesId == seriesId && s.AbsoluteEpisodeNumber == absoluteEpisodeNumber); + } + public Episode Get(int seriesId, String date) { return Query.Single(s => s.SeriesId == seriesId && s.AirDate == date); diff --git a/src/NzbDrone.Core/Tv/EpisodeService.cs b/src/NzbDrone.Core/Tv/EpisodeService.cs index 9ef46761f..96bfb1e52 100644 --- a/src/NzbDrone.Core/Tv/EpisodeService.cs +++ b/src/NzbDrone.Core/Tv/EpisodeService.cs @@ -14,6 +14,7 @@ namespace NzbDrone.Core.Tv { Episode GetEpisode(int id); Episode FindEpisode(int seriesId, int seasonNumber, int episodeNumber, bool useScene = false); + Episode FindEpisode(int seriesId, int absoluteEpisodeNumber); Episode GetEpisode(int seriesId, String date); Episode FindEpisode(int seriesId, String date); List<Episode> GetEpisodeBySeries(int seriesId); @@ -62,6 +63,11 @@ namespace NzbDrone.Core.Tv return _episodeRepository.Find(seriesId, seasonNumber, episodeNumber); } + public Episode FindEpisode(int seriesId, int absoluteEpisodeNumber) + { + return _episodeRepository.Find(seriesId, absoluteEpisodeNumber); + } + public Episode GetEpisode(int seriesId, String date) { return _episodeRepository.Get(seriesId, date); diff --git a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs index 881c24b75..acee4ee85 100644 --- a/src/NzbDrone.Core/Tv/RefreshSeriesService.cs +++ b/src/NzbDrone.Core/Tv/RefreshSeriesService.cs @@ -106,7 +106,7 @@ namespace NzbDrone.Core.Tv } else { - var allSeries = _seriesService.GetAllSeries().OrderBy(c => c.LastInfoSync).ToList(); + var allSeries = _seriesService.GetAllSeries().OrderBy(c => c.Title).ToList(); foreach (var series in allSeries) { diff --git a/src/NzbDrone.Core/packages.config b/src/NzbDrone.Core/packages.config index b0bc75532..36fbe4d0a 100644 --- a/src/NzbDrone.Core/packages.config +++ b/src/NzbDrone.Core/packages.config @@ -1,12 +1,12 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="FluentMigrator" version="1.1.1.0" targetFramework="net40" /> - <package id="FluentValidation" version="4.0.0.1" targetFramework="net40" /> + <package id="FluentValidation" version="5.0.0.1" targetFramework="net40" /> <package id="Growl" version="0.6" /> <package id="MediaInfoNet" version="0.3" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="Prowlin" version="0.9.4456.26422" targetFramework="net40" /> - <package id="RestSharp" version="104.2.0" targetFramework="net40" /> + <package id="RestSharp" version="104.3.3" targetFramework="net40" /> <package id="valueinjecter" version="2.3.3" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.Host/MainAppContainerBuilder.cs b/src/NzbDrone.Host/MainAppContainerBuilder.cs index 299de7925..cbb9778c1 100644 --- a/src/NzbDrone.Host/MainAppContainerBuilder.cs +++ b/src/NzbDrone.Host/MainAppContainerBuilder.cs @@ -22,7 +22,6 @@ namespace NzbDrone.Host AutoRegisterImplementations<NzbDronePersistentConnection>(); - Container.Register(typeof(IBasicRepository<RootFolder>), typeof(BasicRepository<RootFolder>)); Container.Register(typeof(IBasicRepository<NamingConfig>), typeof(BasicRepository<NamingConfig>)); Container.Register<INancyBootstrapper, NancyBootstrapper>(); diff --git a/src/NzbDrone.Host/NLog.xsd b/src/NzbDrone.Host/NLog.xsd index 2203f4ede..49dd62049 100644 --- a/src/NzbDrone.Host/NLog.xsd +++ b/src/NzbDrone.Host/NLog.xsd @@ -224,6 +224,84 @@ <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> + <xs:complexType name="AspNetBufferingWrapper"> + <xs:complexContent> + <xs:extension base="WrapperTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="growBufferAsNeeded" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferGrowLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="growBufferAsNeeded" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether buffer should grow as needed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="bufferSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Number of log events to be buffered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="bufferGrowLimit" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum number of log events that the buffer can keep.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="AspNetTrace"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="AspResponse"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="addComments" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="addComments" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to add <!-- --> comments around all written texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> <xs:complexType name="AsyncWrapper"> <xs:complexContent> <xs:extension base="WrapperTargetBase"> @@ -289,8 +367,8 @@ <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="slidingTimeout" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="flushTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -302,14 +380,14 @@ <xs:documentation>Indicates whether to use sliding timeout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="flushTimeout" type="xs:integer"> <xs:annotation> - <xs:documentation>Number of log events to be buffered.</xs:documentation> + <xs:documentation>Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="flushTimeout" type="xs:integer"> + <xs:attribute name="bufferSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes.</xs:documentation> + <xs:documentation>Number of log events to be buffered.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> @@ -321,21 +399,22 @@ <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> - <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -347,11 +426,6 @@ <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Instance of that is used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> <xs:annotation> <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> @@ -367,9 +441,9 @@ <xs:documentation>Encoding to be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>Instance of that is used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="address" type="SimpleLayoutAttribute"> @@ -377,14 +451,24 @@ <xs:documentation>Network address.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="keepConnection" type="xs:boolean"> <xs:annotation> <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:attribute name="maxQueueSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> + <xs:documentation>Maximum queue size.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="includeCallSite" type="xs:boolean"> @@ -397,9 +481,9 @@ <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ndcItemSeparator" type="xs:string"> + <xs:attribute name="includeNLogData" type="xs:boolean"> <xs:annotation> - <xs:documentation>NDC item separator.</xs:documentation> + <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="includeNdc" type="xs:boolean"> @@ -407,14 +491,14 @@ <xs:documentation>Indicates whether to include stack contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNLogData" type="xs:boolean"> + <xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> + <xs:documentation>NDC item separator.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:attribute name="includeSourceInfo" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> + <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> @@ -443,26 +527,24 @@ </xs:annotation> </xs:attribute> </xs:complexType> - <xs:complexType name="Console"> + <xs:complexType name="ColoredConsole"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="highlight-row" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleRowHighlightingRule" /> + <xs:element name="highlight-word" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleWordHighlightingRule" /> + <xs:element name="useDefaultRowHighlightingRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Footer.</xs:documentation> @@ -473,102 +555,233 @@ <xs:documentation>Header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="error" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to send the log messages to the standard error instead of the standard output.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="Database"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> - <xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> - <xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbUserName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbProvider" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the database provider.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="useTransactions" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to use database transactions. Some data providers require this.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="connectionStringName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the connection string (as specified in <connectionStrings> configuration section.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="connectionString" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbDatabase" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbPassword" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbHost" type="SimpleLayoutAttribute"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="installConnectionString" type="SimpleLayoutAttribute"> + <xs:attribute name="useDefaultRowHighlightingRules" type="xs:boolean"> <xs:annotation> - <xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation> + <xs:documentation>Indicates whether to use default row highlighting rules.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="commandText" type="SimpleLayoutAttribute"> + <xs:attribute name="errorStream" type="xs:boolean"> <xs:annotation> - <xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation> + <xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="System.Data.CommandType"> + <xs:simpleType name="NLog.Targets.ConsoleOutputColor"> <xs:restriction base="xs:string"> - <xs:enumeration value="StoredProcedure" /> - <xs:enumeration value="TableDirect" /> - <xs:enumeration value="Text" /> + <xs:enumeration value="Black" /> + <xs:enumeration value="DarkBlue" /> + <xs:enumeration value="DarkGreen" /> + <xs:enumeration value="DarkCyan" /> + <xs:enumeration value="DarkRed" /> + <xs:enumeration value="DarkMagenta" /> + <xs:enumeration value="DarkYellow" /> + <xs:enumeration value="Gray" /> + <xs:enumeration value="DarkGray" /> + <xs:enumeration value="Blue" /> + <xs:enumeration value="Green" /> + <xs:enumeration value="Cyan" /> + <xs:enumeration value="Red" /> + <xs:enumeration value="Magenta" /> + <xs:enumeration value="Yellow" /> + <xs:enumeration value="White" /> + <xs:enumeration value="NoChange" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NLog.Targets.ConsoleRowHighlightingRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> + <xs:annotation> + <xs:documentation>Condition that must be met in order to set the specified foreground and background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Foreground color.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="NLog.Targets.ConsoleWordHighlightingRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="regex" type="xs:string"> + <xs:annotation> + <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="text" type="xs:string"> + <xs:annotation> + <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="wholeWords" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to match whole words only.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Foreground color.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="Console"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Footer.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Text to be rendered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="error" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to send the log messages to the standard error instead of the standard output.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="Database"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> + <xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> + <xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" /> + <xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbUserName" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbProvider" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the database provider.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="useTransactions" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to use database transactions. Some data providers require this.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbPassword" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionStringName" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the connection string (as specified in <connectionStrings> configuration section.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionString" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbHost" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbDatabase" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="installConnectionString" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="commandText" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:simpleType name="System.Data.CommandType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Text" /> + <xs:enumeration value="StoredProcedure" /> + <xs:enumeration value="TableDirect" /> </xs:restriction> </xs:simpleType> <xs:complexType name="NLog.Targets.DatabaseCommandInfo"> @@ -634,11 +847,13 @@ </xs:annotation> </xs:attribute> </xs:complexType> - <xs:complexType name="Debug"> + <xs:complexType name="Debugger"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -646,64 +861,55 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Footer.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="FallbackGroup"> + <xs:complexType name="Debug"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="returnToFirstOnSuccess" type="xs:boolean"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="File"> + <xs:complexType name="EventLog"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="lineEnding" minOccurs="0" maxOccurs="1" type="NLog.Targets.LineEndingMode" /> - <xs:element name="archiveAboveSize" minOccurs="0" maxOccurs="1" type="xs:long" /> - <xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="archiveFileName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="archiveNumbering" minOccurs="0" maxOccurs="1" type="NLog.Targets.ArchiveNumberingMode" /> - <xs:element name="archiveEvery" minOccurs="0" maxOccurs="1" type="NLog.Targets.FileArchivePeriod" /> - <xs:element name="replaceFileContentsOnEachWrite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="fileAttributes" minOccurs="0" maxOccurs="1" type="NLog.Targets.Win32FileAttributes" /> - <xs:element name="fileName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="deleteOldFileOnStartup" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="enableFileDelete" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="createDirs" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="concurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="concurrentWriteAttempts" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="keepFileOpen" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="machineName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="source" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="log" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="category" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="eventId" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -712,17 +918,92 @@ </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="machineName" type="xs:string"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Name of the machine on which Event Log service is running.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="source" type="xs:string"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> + <xs:documentation>Value to be used as the event Source.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="log" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the Event Log to write to. This can be System, Application or any user-defined name.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="category" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that renders event Category.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="eventId" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that renders event ID.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="FallbackGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="returnToFirstOnSuccess" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="File"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="lineEnding" minOccurs="0" maxOccurs="1" type="NLog.Targets.LineEndingMode" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="archiveEvery" minOccurs="0" maxOccurs="1" type="NLog.Targets.FileArchivePeriod" /> + <xs:element name="archiveAboveSize" minOccurs="0" maxOccurs="1" type="xs:long" /> + <xs:element name="archiveFileName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="archiveNumbering" minOccurs="0" maxOccurs="1" type="NLog.Targets.ArchiveNumberingMode" /> + <xs:element name="forceManaged" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="fileAttributes" minOccurs="0" maxOccurs="1" type="NLog.Targets.Win32FileAttributes" /> + <xs:element name="deleteOldFileOnStartup" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="enableFileDelete" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="createDirs" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="replaceFileContentsOnEachWrite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="fileName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="concurrentWriteAttempts" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="concurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="keepFileOpen" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="encoding" type="xs:string"> @@ -735,14 +1016,29 @@ <xs:documentation>Line ending mode.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveAboveSize" type="xs:long"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size in bytes above which log files will be automatically archived.</xs:documentation> + <xs:documentation>Footer.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxArchiveFiles" type="xs:integer"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Maximum number of archive files that should be kept.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="archiveEvery" type="NLog.Targets.FileArchivePeriod"> + <xs:annotation> + <xs:documentation>Indicates whether to automatically archive log files every time the specified time passes.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="archiveAboveSize" type="xs:long"> + <xs:annotation> + <xs:documentation>Size in bytes above which log files will be automatically archived.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="archiveFileName" type="SimpleLayoutAttribute"> @@ -750,19 +1046,19 @@ <xs:documentation>Name of the file to be used for an archive.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveNumbering" type="NLog.Targets.ArchiveNumberingMode"> + <xs:attribute name="maxArchiveFiles" type="xs:integer"> <xs:annotation> - <xs:documentation>Way file archives are numbered.</xs:documentation> + <xs:documentation>Maximum number of archive files that should be kept.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveEvery" type="NLog.Targets.FileArchivePeriod"> + <xs:attribute name="archiveNumbering" type="NLog.Targets.ArchiveNumberingMode"> <xs:annotation> - <xs:documentation>Indicates whether to automatically archive log files every time the specified time passes.</xs:documentation> + <xs:documentation>Way file archives are numbered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="replaceFileContentsOnEachWrite" type="xs:boolean"> + <xs:attribute name="forceManaged" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to replace file contents on each write instead of appending log message at the end.</xs:documentation> + <xs:documentation>Gets ors set a value indicating whether a managed file stream is forced, instead of used the native implementation.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="fileAttributes" type="NLog.Targets.Win32FileAttributes"> @@ -770,11 +1066,6 @@ <xs:documentation>File attributes (Windows only).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="fileName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Name of the file to write to.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="deleteOldFileOnStartup" type="xs:boolean"> <xs:annotation> <xs:documentation>Indicates whether to delete old log file on startup.</xs:documentation> @@ -790,9 +1081,14 @@ <xs:documentation>Indicates whether to create directories if they don't exist.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="concurrentWrites" type="xs:boolean"> + <xs:attribute name="replaceFileContentsOnEachWrite" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on the same host.</xs:documentation> + <xs:documentation>Indicates whether to replace file contents on each write instead of appending log message at the end.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fileName" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Name of the file to write to.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="openFileCacheTimeout" type="xs:integer"> @@ -800,14 +1096,14 @@ <xs:documentation>Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="openFileCacheSize" type="xs:integer"> + <xs:attribute name="bufferSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger).</xs:documentation> + <xs:documentation>Log file buffer size in bytes.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="networkWrites" type="xs:boolean"> + <xs:attribute name="concurrentWriteAttempts" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on different network hosts.</xs:documentation> + <xs:documentation>Number of times the write is appended on the file before NLog discards the log message.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="concurrentWriteAttemptDelay" type="xs:integer"> @@ -815,19 +1111,24 @@ <xs:documentation>Delay in milliseconds to wait before attempting to write to the file again.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="concurrentWriteAttempts" type="xs:integer"> + <xs:attribute name="autoFlush" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of times the write is appended on the file before NLog discards the log message.</xs:documentation> + <xs:documentation>Indicates whether to automatically flush the file buffers after each log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="concurrentWrites" type="xs:boolean"> <xs:annotation> - <xs:documentation>Log file buffer size in bytes.</xs:documentation> + <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on the same host.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="autoFlush" type="xs:boolean"> + <xs:attribute name="openFileCacheSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to automatically flush the file buffers after each log message.</xs:documentation> + <xs:documentation>Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger).</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="networkWrites" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on different network hosts.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="keepFileOpen" type="xs:boolean"> @@ -847,12 +1148,6 @@ <xs:enumeration value="None" /> </xs:restriction> </xs:simpleType> - <xs:simpleType name="NLog.Targets.ArchiveNumberingMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Sequence" /> - <xs:enumeration value="Rolling" /> - </xs:restriction> - </xs:simpleType> <xs:simpleType name="NLog.Targets.FileArchivePeriod"> <xs:restriction base="xs:string"> <xs:enumeration value="None" /> @@ -863,9 +1158,15 @@ <xs:enumeration value="Minute" /> </xs:restriction> </xs:simpleType> + <xs:simpleType name="NLog.Targets.ArchiveNumberingMode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Sequence" /> + <xs:enumeration value="Rolling" /> + </xs:restriction> + </xs:simpleType> <xs:simpleType name="NLog.Targets.Win32FileAttributes"> <xs:restriction base="xs:string"> - <xs:enumeration value="Readonly" /> + <xs:enumeration value="ReadOnly" /> <xs:enumeration value="Hidden" /> <xs:enumeration value="System" /> <xs:enumeration value="Archive" /> @@ -881,7 +1182,6 @@ <xs:enumeration value="NoBuffering" /> <xs:enumeration value="DeleteOnClose" /> <xs:enumeration value="PosixSemantics" /> - <xs:enumeration value="ReadOnly" /> </xs:restriction> </xs:simpleType> <xs:complexType name="FilteringWrapper"> @@ -904,12 +1204,16 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Memory"> + <xs:complexType name="FormControl"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="append" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="reverseOrder" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -921,257 +1225,327 @@ <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="MessageBox"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="caption" minOccurs="0" maxOccurs="1" type="Layout" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="formName" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Name of the Form on which the control is located.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="controlName" type="xs:string"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Name of control to which NLog will log write log text.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="caption" type="SimpleLayoutAttribute"> + <xs:attribute name="append" type="xs:boolean"> <xs:annotation> - <xs:documentation>Message box title.</xs:documentation> + <xs:documentation>Indicates whether log text should be appended to the text of the control instead of overwriting it.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="reverseOrder" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Whether new log entry are added to the start or the end of the control</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="MethodCall"> + <xs:complexType name="ImpersonatingWrapper"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="logOnType" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityLogOnType" /> + <xs:element name="domain" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="impersonationLevel" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityImpersonationLevel" /> + <xs:element name="logOnProvider" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.LogOnProviderType" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="methodName" type="xs:string"> + <xs:attribute name="password" type="xs:string"> <xs:annotation> - <xs:documentation>Method name. The method must be public and static.</xs:documentation> + <xs:documentation>User account password.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="className" type="xs:string"> + <xs:attribute name="revertToSelf" type="xs:boolean"> <xs:annotation> - <xs:documentation>Class name.</xs:documentation> + <xs:documentation>Indicates whether to revert to the credentials of the process instead of impersonating another user.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="userName" type="xs:string"> + <xs:annotation> + <xs:documentation>Username to change context to.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="logOnType" type="NLog.Targets.Wrappers.SecurityLogOnType"> + <xs:annotation> + <xs:documentation>Logon Type.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="domain" type="xs:string"> + <xs:annotation> + <xs:documentation>Windows domain name to change context to.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="impersonationLevel" type="NLog.Targets.Wrappers.SecurityImpersonationLevel"> + <xs:annotation> + <xs:documentation>Required impersonation level.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="logOnProvider" type="NLog.Targets.Wrappers.LogOnProviderType"> + <xs:annotation> + <xs:documentation>Type of the logon provider.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="NLog.Targets.MethodCallParameter"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="type" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that should be use to calcuate the value for the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="type" type="xs:string"> - <xs:annotation> - <xs:documentation>Type of the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Network"> + <xs:simpleType name="NLog.Targets.Wrappers.SecurityLogOnType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Interactive" /> + <xs:enumeration value="Network" /> + <xs:enumeration value="Batch" /> + <xs:enumeration value="Service" /> + <xs:enumeration value="NetworkClearText" /> + <xs:enumeration value="NewCredentials" /> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="NLog.Targets.Wrappers.SecurityImpersonationLevel"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Anonymous" /> + <xs:enumeration value="Identification" /> + <xs:enumeration value="Impersonation" /> + <xs:enumeration value="Delegation" /> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="NLog.Targets.Wrappers.LogOnProviderType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Default" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="LogReceiverService"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> - <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="endpointConfigurationName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="endpointAddress" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="clientId" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> - <xs:annotation> - <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="newLine" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:attribute name="endpointConfigurationName" type="xs:string"> <xs:annotation> - <xs:documentation>Maximum message size in bytes.</xs:documentation> + <xs:documentation>Name of the endpoint configuration in WCF configuration file.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="endpointAddress" type="xs:string"> <xs:annotation> - <xs:documentation>Encoding to be used.</xs:documentation> + <xs:documentation>Endpoint address.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="useBinaryEncoding" type="xs:boolean"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>Indicates whether to use binary message encoding.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:attribute name="clientId" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + <xs:documentation>Client ID.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:attribute name="includeEventProperties" type="xs:boolean"> <xs:annotation> - <xs:documentation>Network address.</xs:documentation> + <xs:documentation>Indicates whether to include per-event properties in the payload sent to the server.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="NLogViewer"> + <xs:complexType name="NLog.Targets.MethodCallParameter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="type" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that should be use to calcuate the value for the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="type" type="xs:string"> + <xs:annotation> + <xs:documentation>Type of the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="Mail"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> - <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="html" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> - <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="addNewLines" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="to" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="cc" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="bcc" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="replaceNewlineWithBrTagInHtml" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="useSystemNetMailSettings" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="smtpPort" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" /> + <xs:element name="smtpPassword" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="enableSsl" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="newLine" type="xs:boolean"> + <xs:attribute name="html" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + <xs:documentation>Indicates whether to send message as HTML instead of plain text.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="encoding" type="xs:string"> + <xs:annotation> + <xs:documentation>Encoding to be used for sending e-mail.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="addNewLines" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to add new lines between log entries.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Instance of that is used to format log messages.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + <xs:documentation>Header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Maximum message size in bytes.</xs:documentation> + <xs:documentation>Footer.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="to" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Encoding to be used.</xs:documentation> + <xs:documentation>Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="cc" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:attribute name="bcc" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Network address.</xs:documentation> + <xs:documentation>BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:attribute name="subject" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + <xs:documentation>Mail subject.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:attribute name="body" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> + <xs:documentation>Mail message body (repeated for each log message send in one mail).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeCallSite" type="xs:boolean"> + <xs:attribute name="from" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include call site (class and method name) in the information sent over the network.</xs:documentation> + <xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="appInfo" type="xs:string"> + <xs:attribute name="replaceNewlineWithBrTagInHtml" type="xs:boolean"> <xs:annotation> - <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> + <xs:documentation>Indicates whether NewLine characters in the body should be replaced with tags.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ndcItemSeparator" type="xs:string"> + <xs:attribute name="priority" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>NDC item separator.</xs:documentation> + <xs:documentation>Priority used for sending mails.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNdc" type="xs:boolean"> + <xs:attribute name="useSystemNetMailSettings" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to include stack contents.</xs:documentation> + <xs:documentation>Indicates whether the default Settings from System.Net.MailSettings should be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNLogData" type="xs:boolean"> + <xs:attribute name="smtpServer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> + <xs:documentation>SMTP Server to be used for sending.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:attribute name="smtpUserName" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> + <xs:documentation>Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpPort" type="xs:integer"> + <xs:annotation> + <xs:documentation>Port number that SMTP Server is listening on.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpAuthentication" type="NLog.Targets.SmtpAuthenticationMode"> + <xs:annotation> + <xs:documentation>SMTP Authentication mode.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpPassword" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="enableSsl" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Null"> + <xs:simpleType name="NLog.Targets.SmtpAuthenticationMode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="None" /> + <xs:enumeration value="Basic" /> + <xs:enumeration value="Ntlm" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Memory"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -1179,11 +1553,6 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="formatMessage" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to perform layout calculation.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Layout used to format log messages.</xs:documentation> @@ -1192,12 +1561,13 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="OutputDebugString"> + <xs:complexType name="MessageBox"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="caption" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -1209,596 +1579,699 @@ <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="caption" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Message box title.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="PostFilteringWrapper"> + <xs:complexType name="MSMQ"> <xs:complexContent> - <xs:extension base="WrapperTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" /> + <xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="checkIfQueueExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="recoverable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="defaultFilter" type="Condition"> + <xs:attribute name="useXmlEncoding" type="xs:boolean"> <xs:annotation> - <xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation> + <xs:documentation>Indicates whether to use the XML format when serializing message. This will also disable creating queues.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="NLog.Targets.Wrappers.FilteringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="exists" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="filter" minOccurs="0" maxOccurs="1" type="Condition" /> - </xs:choice> - <xs:attribute name="exists" type="Condition"> - <xs:annotation> - <xs:documentation>Condition to be tested.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="filter" type="Condition"> - <xs:annotation> - <xs:documentation>Resulting filter to be applied when the condition matches.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="RandomizeGroup"> - <xs:complexContent> - <xs:extension base="CompoundTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="checkIfQueueExists" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether to check if a queue exists before writing to it.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="RepeatingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="repeatCount" type="xs:integer"> + <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Number of times to repeat each log message.</xs:documentation> + <xs:documentation>Encoding to be used when writing text to the queue.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="RetryingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="queue" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Name of the queue to write to.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="retryDelayMilliseconds" type="xs:integer"> + <xs:attribute name="recoverable" type="xs:boolean"> <xs:annotation> - <xs:documentation>Time to wait between retries in milliseconds.</xs:documentation> + <xs:documentation>Indicates whether to use recoverable messages (with guaranteed delivery).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="retryCount" type="xs:integer"> + <xs:attribute name="createQueueIfNotExists" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation> + <xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="label" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Label to associate with each message.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="RoundRobinGroup"> + <xs:complexType name="MethodCall"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="methodName" type="xs:string"> + <xs:annotation> + <xs:documentation>Method name. The method must be public and static.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="className" type="xs:string"> + <xs:annotation> + <xs:documentation>Class name.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="SplitGroup"> + <xs:complexType name="Network"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> + <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="newLine" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:annotation> + <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum message size in bytes.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="encoding" type="xs:string"> + <xs:annotation> + <xs:documentation>Encoding to be used.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Network address.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxQueueSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum queue size.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="WebService"> + <xs:complexType name="NLogViewer"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> - <xs:element name="url" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> + <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> + <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="protocol" minOccurs="0" maxOccurs="1" type="NLog.Targets.WebServiceProtocol" /> - <xs:element name="namespace" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> + <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="url" type="xs:anyURI"> + <xs:attribute name="newLine" type="xs:boolean"> <xs:annotation> - <xs:documentation>Web service URL.</xs:documentation> + <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:annotation> + <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum message size in bytes.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Encoding.</xs:documentation> + <xs:documentation>Encoding to be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="protocol" type="NLog.Targets.WebServiceProtocol"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Protocol to be used when calling web service.</xs:documentation> + <xs:documentation>Instance of that is used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="namespace" type="xs:string"> + <xs:attribute name="address" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Web service namespace.</xs:documentation> + <xs:documentation>Network address.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="methodName" type="xs:string"> + <xs:attribute name="connectionCacheSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Web service method name.</xs:documentation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="NLog.Targets.WebServiceProtocol"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Soap11" /> - <xs:enumeration value="Soap12" /> - <xs:enumeration value="HttpPost" /> - <xs:enumeration value="HttpGet" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="CsvLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="quoting" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvQuotingMode" /> - <xs:element name="quoteChar" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="withHeader" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="customColumnDelimiter" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="delimiter" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvColumnDelimiterMode" /> - <xs:element name="column" minOccurs="0" maxOccurs="unbounded" type="NLog.Layouts.CsvColumn" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="keepConnection" type="xs:boolean"> <xs:annotation> - <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> + <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="maxQueueSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Footer layout.</xs:documentation> + <xs:documentation>Maximum queue size.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="includeMdc" type="xs:boolean"> <xs:annotation> - <xs:documentation>Header layout.</xs:documentation> + <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="quoting" type="NLog.Layouts.CsvQuotingMode"> + <xs:attribute name="includeCallSite" type="xs:boolean"> <xs:annotation> - <xs:documentation>Quoting mode.</xs:documentation> + <xs:documentation>Indicates whether to include call site (class and method name) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="quoteChar" type="xs:string"> + <xs:attribute name="appInfo" type="xs:string"> <xs:annotation> - <xs:documentation>Quote Character.</xs:documentation> + <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="withHeader" type="xs:boolean"> + <xs:attribute name="includeNLogData" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether CVS should include header.</xs:documentation> + <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="customColumnDelimiter" type="xs:string"> + <xs:attribute name="includeNdc" type="xs:boolean"> <xs:annotation> - <xs:documentation>Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom').</xs:documentation> + <xs:documentation>Indicates whether to include stack contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="delimiter" type="NLog.Layouts.CsvColumnDelimiterMode"> + <xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:annotation> - <xs:documentation>Column delimiter.</xs:documentation> + <xs:documentation>NDC item separator.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Layouts.CsvQuotingMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="All" /> - <xs:enumeration value="Nothing" /> - <xs:enumeration value="Auto" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Layouts.CsvColumnDelimiterMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Auto" /> - <xs:enumeration value="Comma" /> - <xs:enumeration value="Semicolon" /> - <xs:enumeration value="Tab" /> - <xs:enumeration value="Pipe" /> - <xs:enumeration value="Space" /> - <xs:enumeration value="Custom" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Layouts.CsvColumn"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout of the column.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the column.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="SimpleLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Layout text.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="LayoutWithHeaderAndFooter"> + <xs:complexType name="Null"> <xs:complexContent> - <xs:extension base="Layout"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="formatMessage" type="xs:boolean"> <xs:annotation> - <xs:documentation>Header layout.</xs:documentation> + <xs:documentation>Indicates whether to perform layout calculation.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Footer layout.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Log4JXmlEventLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded" /> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="when"> + <xs:complexType name="OutputDebugString"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> - <xs:attribute name="condition" type="Condition"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Condition expression.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="FilterResult"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Neutral" /> - <xs:enumeration value="Log" /> - <xs:enumeration value="Ignore" /> - <xs:enumeration value="LogFinal" /> - <xs:enumeration value="IgnoreFinal" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="whenContains"> + <xs:complexType name="PerfCounter"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" /> + <xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="autoCreate" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="categoryName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterHelp" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="substring" type="xs:string"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Substring to be matched.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="counterName" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the performance counter.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="counterType" type="System.Diagnostics.PerformanceCounterType"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Performance counter type.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="whenEqual"> - <xs:complexContent> - <xs:extension base="Filter"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="instanceName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Performance counter instance name.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="autoCreate" type="xs:boolean"> <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + <xs:documentation>Indicates whether performance counter should be automatically created.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="categoryName" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the performance counter category.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="compareTo" type="xs:string"> + <xs:attribute name="counterHelp" type="xs:string"> <xs:annotation> - <xs:documentation>String to compare the layout to.</xs:documentation> + <xs:documentation>Counter help text.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="whenNotContains"> + <xs:simpleType name="System.Diagnostics.PerformanceCounterType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="NumberOfItems32" /> + <xs:enumeration value="NumberOfItems64" /> + <xs:enumeration value="NumberOfItemsHEX32" /> + <xs:enumeration value="NumberOfItemsHEX64" /> + <xs:enumeration value="RateOfCountsPerSecond32" /> + <xs:enumeration value="RateOfCountsPerSecond64" /> + <xs:enumeration value="CountPerTimeInterval32" /> + <xs:enumeration value="CountPerTimeInterval64" /> + <xs:enumeration value="RawFraction" /> + <xs:enumeration value="RawBase" /> + <xs:enumeration value="AverageTimer32" /> + <xs:enumeration value="AverageBase" /> + <xs:enumeration value="AverageCount64" /> + <xs:enumeration value="SampleFraction" /> + <xs:enumeration value="SampleCounter" /> + <xs:enumeration value="SampleBase" /> + <xs:enumeration value="CounterTimer" /> + <xs:enumeration value="CounterTimerInverse" /> + <xs:enumeration value="Timer100Ns" /> + <xs:enumeration value="Timer100NsInverse" /> + <xs:enumeration value="ElapsedTime" /> + <xs:enumeration value="CounterMultiTimer" /> + <xs:enumeration value="CounterMultiTimerInverse" /> + <xs:enumeration value="CounterMultiTimer100Ns" /> + <xs:enumeration value="CounterMultiTimer100NsInverse" /> + <xs:enumeration value="CounterMultiBase" /> + <xs:enumeration value="CounterDelta32" /> + <xs:enumeration value="CounterDelta64" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PostFilteringWrapper"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="substring" type="xs:string"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Substring to be matched.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="defaultFilter" type="Condition"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="NLog.Targets.Wrappers.FilteringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="exists" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="filter" minOccurs="0" maxOccurs="1" type="Condition" /> + </xs:choice> + <xs:attribute name="exists" type="Condition"> + <xs:annotation> + <xs:documentation>Condition to be tested.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="filter" type="Condition"> + <xs:annotation> + <xs:documentation>Resulting filter to be applied when the condition matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="RandomizeGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="whenNotEqual"> + <xs:complexType name="RepeatingWrapper"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="repeatCount" type="xs:integer"> <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + <xs:documentation>Number of times to repeat each log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="RetryingWrapper"> + <xs:complexContent> + <xs:extension base="WrapperTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="compareTo" type="xs:string"> + <xs:attribute name="retryDelayMilliseconds" type="xs:integer"> <xs:annotation> - <xs:documentation>String to compare the layout to.</xs:documentation> + <xs:documentation>Time to wait between retries in milliseconds.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="retryCount" type="xs:integer"> + <xs:annotation> + <xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="MSMQ"> + <xs:complexType name="RichTextBox"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="recoverable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="showMinimized" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxLines" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="width" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="toolWindow" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="autoScroll" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="height" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="word-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxWordColoringRule" /> + <xs:element name="useDefaultRowColoringRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="row-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxRowColoringRule" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useXmlEncoding" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to use the XML format when serializing message.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Encoding to be used when writing text to the queue.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="showMinimized" type="xs:boolean"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Indicates whether the created form will be initially minimized.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="recoverable" type="xs:boolean"> + <xs:attribute name="maxLines" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to use recoverable messages (with guaranteed delivery).</xs:documentation> + <xs:documentation>Maximum number of lines the rich text box will store (or 0 to disable this feature).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="createQueueIfNotExists" type="xs:boolean"> + <xs:attribute name="width" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation> + <xs:documentation>Initial width of the form with rich text box.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="label" type="SimpleLayoutAttribute"> + <xs:attribute name="toolWindow" type="xs:boolean"> <xs:annotation> - <xs:documentation>Label to associate with each message.</xs:documentation> + <xs:documentation>Indicates whether the created window will be a tool window.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="queue" type="SimpleLayoutAttribute"> + <xs:attribute name="controlName" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the queue to write to.</xs:documentation> + <xs:documentation>Name of RichTextBox to which Nlog will write.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="AspNetBufferingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="bufferGrowLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="growBufferAsNeeded" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="autoScroll" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether scroll bar will be moved automatically to show most recent log entries.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferGrowLimit" type="xs:integer"> + <xs:attribute name="height" type="xs:integer"> <xs:annotation> - <xs:documentation>Maximum number of log events that the buffer can keep.</xs:documentation> + <xs:documentation>Initial height of the form with rich text box.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="growBufferAsNeeded" type="xs:boolean"> + <xs:attribute name="formName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether buffer should grow as needed.</xs:documentation> + <xs:documentation>Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="useDefaultRowColoringRules" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of log events to be buffered.</xs:documentation> + <xs:documentation>Indicates whether to use default coloring rules.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="AspNetTrace"> + <xs:simpleType name="System.Drawing.FontStyle"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Regular" /> + <xs:enumeration value="Bold" /> + <xs:enumeration value="Italic" /> + <xs:enumeration value="Underline" /> + <xs:enumeration value="Strikeout" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NLog.Targets.RichTextBoxWordColoringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="regex" type="xs:string"> + <xs:annotation> + <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="text" type="xs:string"> + <xs:annotation> + <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="wholeWords" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to match whole words only.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fontColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="style" type="System.Drawing.FontStyle"> + <xs:annotation> + <xs:documentation>Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="NLog.Targets.RichTextBoxRowColoringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> + <xs:annotation> + <xs:documentation>Condition that must be met in order to set the specified font color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fontColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Font color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="style" type="System.Drawing.FontStyle"> + <xs:annotation> + <xs:documentation>Font style of matched text.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="RoundRobinGroup"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="CompoundTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="SplitGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="AspResponse"> + <xs:complexType name="Trace"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="addComments" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -1806,11 +2279,6 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="addComments" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to add <!-- --> comments around all written texts.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Layout used to format log messages.</xs:documentation> @@ -1819,764 +2287,349 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="ColoredConsole"> + <xs:complexType name="WebService"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="useDefaultRowHighlightingRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="highlight-row" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleRowHighlightingRule" /> - <xs:element name="highlight-word" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleWordHighlightingRule" /> - <xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="url" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> + <xs:element name="namespace" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="protocol" minOccurs="0" maxOccurs="1" type="NLog.Targets.WebServiceProtocol" /> + <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="url" type="xs:anyURI"> <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> + <xs:documentation>Web service URL.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="namespace" type="xs:string"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Web service namespace.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="protocol" type="NLog.Targets.WebServiceProtocol"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> + <xs:documentation>Protocol to be used when calling web service.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useDefaultRowHighlightingRules" type="xs:boolean"> + <xs:attribute name="methodName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to use default row highlighting rules.</xs:documentation> + <xs:documentation>Web service method name.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="errorStream" type="xs:boolean"> + <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation> + <xs:documentation>Encoding.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Targets.ConsoleOutputColor"> + <xs:simpleType name="NLog.Targets.WebServiceProtocol"> <xs:restriction base="xs:string"> - <xs:enumeration value="Black" /> - <xs:enumeration value="DarkBlue" /> - <xs:enumeration value="DarkGreen" /> - <xs:enumeration value="DarkCyan" /> - <xs:enumeration value="DarkRed" /> - <xs:enumeration value="DarkMagenta" /> - <xs:enumeration value="DarkYellow" /> - <xs:enumeration value="Gray" /> - <xs:enumeration value="DarkGray" /> - <xs:enumeration value="Blue" /> - <xs:enumeration value="Green" /> - <xs:enumeration value="Cyan" /> - <xs:enumeration value="Red" /> - <xs:enumeration value="Magenta" /> - <xs:enumeration value="Yellow" /> - <xs:enumeration value="White" /> - <xs:enumeration value="NoChange" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Targets.ConsoleRowHighlightingRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="condition" type="Condition"> - <xs:annotation> - <xs:documentation>Condition that must be met in order to set the specified foreground and background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Foreground color.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="NLog.Targets.ConsoleWordHighlightingRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Foreground color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="regex" type="xs:string"> - <xs:annotation> - <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="wholeWords" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to match whole words only.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Debugger"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Footer.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Header.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="EventLog"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="machineName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="source" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="category" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="eventId" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="log" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="machineName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the machine on which Event Log service is running.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="source" type="xs:string"> - <xs:annotation> - <xs:documentation>Value to be used as the event Source.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="category" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that renders event Category.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="eventId" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that renders event ID.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="log" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the Event Log to write to. This can be System, Application or any user-defined name.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="FormControl"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="append" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="append" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether log text should be appended to the text of the control instead of overwriting it.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="controlName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of control to which NLog will log write log text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="formName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the Form on which the control is located.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="ImpersonatingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="impersonationLevel" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityImpersonationLevel" /> - <xs:element name="domain" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="logOnType" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityLogOnType" /> - <xs:element name="logOnProvider" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.LogOnProviderType" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="userName" type="xs:string"> - <xs:annotation> - <xs:documentation>Username to change context to.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="password" type="xs:string"> - <xs:annotation> - <xs:documentation>User account password.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="revertToSelf" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to revert to the credentials of the process instead of impersonating another user.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="impersonationLevel" type="NLog.Targets.Wrappers.SecurityImpersonationLevel"> - <xs:annotation> - <xs:documentation>Required impersonation level.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="domain" type="xs:string"> - <xs:annotation> - <xs:documentation>Windows domain name to change context to.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="logOnType" type="NLog.Targets.Wrappers.SecurityLogOnType"> - <xs:annotation> - <xs:documentation>Logon Type.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="logOnProvider" type="NLog.Targets.Wrappers.LogOnProviderType"> - <xs:annotation> - <xs:documentation>Type of the logon provider.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="NLog.Targets.Wrappers.SecurityImpersonationLevel"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Anonymous" /> - <xs:enumeration value="Identification" /> - <xs:enumeration value="Impersonation" /> - <xs:enumeration value="Delegation" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Targets.Wrappers.SecurityLogOnType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Interactive" /> - <xs:enumeration value="Network" /> - <xs:enumeration value="Batch" /> - <xs:enumeration value="Service" /> - <xs:enumeration value="NetworkClearText" /> - <xs:enumeration value="NewCredentials" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Targets.Wrappers.LogOnProviderType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Default" /> + <xs:enumeration value="Soap11" /> + <xs:enumeration value="Soap12" /> + <xs:enumeration value="HttpPost" /> + <xs:enumeration value="HttpGet" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="Mail"> + <xs:complexType name="CsvLayout"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Layout"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="html" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="addNewLines" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="to" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="bcc" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="cc" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="enableSsl" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="smtpPassword" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" /> - <xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpPort" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="quoteChar" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="quoting" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvQuotingMode" /> + <xs:element name="withHeader" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="column" minOccurs="0" maxOccurs="unbounded" type="NLog.Layouts.CsvColumn" /> + <xs:element name="customColumnDelimiter" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="delimiter" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvColumnDelimiterMode" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Header layout.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="html" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to send message as HTML instead of plain text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="addNewLines" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to add new lines between log entries.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> - <xs:annotation> - <xs:documentation>Encoding to be used for sending e-mail.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="subject" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Mail subject.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="to" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="bcc" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="cc" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="from" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="body" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Mail message body (repeated for each log message send in one mail).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="smtpUserName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + <xs:documentation>Footer layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="enableSsl" type="xs:boolean"> + <xs:attribute name="quoteChar" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server.</xs:documentation> + <xs:documentation>Quote Character.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpPassword" type="SimpleLayoutAttribute"> + <xs:attribute name="quoting" type="NLog.Layouts.CsvQuotingMode"> <xs:annotation> - <xs:documentation>Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + <xs:documentation>Quoting mode.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpAuthentication" type="NLog.Targets.SmtpAuthenticationMode"> + <xs:attribute name="withHeader" type="xs:boolean"> <xs:annotation> - <xs:documentation>SMTP Authentication mode.</xs:documentation> + <xs:documentation>Indicates whether CVS should include header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpServer" type="SimpleLayoutAttribute"> + <xs:attribute name="customColumnDelimiter" type="xs:string"> <xs:annotation> - <xs:documentation>SMTP Server to be used for sending.</xs:documentation> + <xs:documentation>Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom').</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpPort" type="xs:integer"> + <xs:attribute name="delimiter" type="NLog.Layouts.CsvColumnDelimiterMode"> <xs:annotation> - <xs:documentation>Port number that SMTP Server is listening on.</xs:documentation> + <xs:documentation>Column delimiter.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Targets.SmtpAuthenticationMode"> + <xs:simpleType name="NLog.Layouts.CsvQuotingMode"> <xs:restriction base="xs:string"> - <xs:enumeration value="None" /> - <xs:enumeration value="Basic" /> - <xs:enumeration value="Ntlm" /> + <xs:enumeration value="All" /> + <xs:enumeration value="Nothing" /> + <xs:enumeration value="Auto" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="PerfCounter"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterHelp" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" /> - <xs:element name="autoCreate" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="categoryName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterName" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="instanceName" type="xs:string"> - <xs:annotation> - <xs:documentation>Performance counter instance name.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterHelp" type="xs:string"> - <xs:annotation> - <xs:documentation>Counter help text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterType" type="System.Diagnostics.PerformanceCounterType"> - <xs:annotation> - <xs:documentation>Performance counter type.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="autoCreate" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether performance counter should be automatically created.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="categoryName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the performance counter category.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the performance counter.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="System.Diagnostics.PerformanceCounterType"> + <xs:simpleType name="NLog.Layouts.CsvColumnDelimiterMode"> <xs:restriction base="xs:string"> - <xs:enumeration value="NumberOfItems32" /> - <xs:enumeration value="NumberOfItems64" /> - <xs:enumeration value="NumberOfItemsHEX32" /> - <xs:enumeration value="NumberOfItemsHEX64" /> - <xs:enumeration value="RateOfCountsPerSecond32" /> - <xs:enumeration value="RateOfCountsPerSecond64" /> - <xs:enumeration value="CountPerTimeInterval32" /> - <xs:enumeration value="CountPerTimeInterval64" /> - <xs:enumeration value="RawFraction" /> - <xs:enumeration value="RawBase" /> - <xs:enumeration value="AverageTimer32" /> - <xs:enumeration value="AverageBase" /> - <xs:enumeration value="AverageCount64" /> - <xs:enumeration value="SampleFraction" /> - <xs:enumeration value="SampleCounter" /> - <xs:enumeration value="SampleBase" /> - <xs:enumeration value="CounterTimer" /> - <xs:enumeration value="CounterTimerInverse" /> - <xs:enumeration value="Timer100Ns" /> - <xs:enumeration value="Timer100NsInverse" /> - <xs:enumeration value="ElapsedTime" /> - <xs:enumeration value="CounterMultiTimer" /> - <xs:enumeration value="CounterMultiTimerInverse" /> - <xs:enumeration value="CounterMultiTimer100Ns" /> - <xs:enumeration value="CounterMultiTimer100NsInverse" /> - <xs:enumeration value="CounterMultiBase" /> - <xs:enumeration value="CounterDelta32" /> - <xs:enumeration value="CounterDelta64" /> + <xs:enumeration value="Auto" /> + <xs:enumeration value="Comma" /> + <xs:enumeration value="Semicolon" /> + <xs:enumeration value="Tab" /> + <xs:enumeration value="Pipe" /> + <xs:enumeration value="Space" /> + <xs:enumeration value="Custom" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="RichTextBox"> + <xs:complexType name="NLog.Layouts.CsvColumn"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout of the column.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the column.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="LayoutWithHeaderAndFooter"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Layout"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="height" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="autoScroll" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="maxLines" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="showMinimized" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="toolWindow" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="width" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="word-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxWordColoringRule" /> - <xs:element name="useDefaultRowColoringRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="row-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxRowColoringRule" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="height" type="xs:integer"> + <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Initial height of the form with rich text box.</xs:documentation> + <xs:documentation>Header layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="autoScroll" type="xs:boolean"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether scroll bar will be moved automatically to show most recent log entries.</xs:documentation> + <xs:documentation>Footer layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxLines" type="xs:integer"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="Log4JXmlEventLayout"> + <xs:complexContent> + <xs:extension base="Layout"> + <xs:choice minOccurs="0" maxOccurs="unbounded" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="SimpleLayout"> + <xs:complexContent> + <xs:extension base="Layout"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="text" type="xs:string"> <xs:annotation> - <xs:documentation>Maximum number of lines the rich text box will store (or 0 to disable this feature).</xs:documentation> + <xs:documentation>Layout text.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="showMinimized" type="xs:boolean"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="when"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> <xs:annotation> - <xs:documentation>Indicates whether the created form will be initially minimized.</xs:documentation> + <xs:documentation>Condition expression.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="toolWindow" type="xs:boolean"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Indicates whether the created window will be a tool window.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="controlName" type="xs:string"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:simpleType name="FilterResult"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Neutral" /> + <xs:enumeration value="Log" /> + <xs:enumeration value="Ignore" /> + <xs:enumeration value="LogFinal" /> + <xs:enumeration value="IgnoreFinal" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="whenContains"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of RichTextBox to which Nlog will write.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="formName" type="xs:string"> + <xs:attribute name="substring" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one.</xs:documentation> + <xs:documentation>Substring to be matched.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="width" type="xs:integer"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Initial width of the form with rich text box.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useDefaultRowColoringRules" type="xs:boolean"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to use default coloring rules.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="System.Drawing.FontStyle"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Regular" /> - <xs:enumeration value="Bold" /> - <xs:enumeration value="Italic" /> - <xs:enumeration value="Underline" /> - <xs:enumeration value="Strikeout" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Targets.RichTextBoxWordColoringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="fontColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="regex" type="xs:string"> - <xs:annotation> - <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="style" type="System.Drawing.FontStyle"> - <xs:annotation> - <xs:documentation>Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="wholeWords" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to match whole words only.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="NLog.Targets.RichTextBoxRowColoringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="condition" type="Condition"> - <xs:annotation> - <xs:documentation>Condition that must be met in order to set the specified font color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="fontColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Font color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="style" type="System.Drawing.FontStyle"> - <xs:annotation> - <xs:documentation>Font style of matched text.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Trace"> + <xs:complexType name="whenEqual"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Filter"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="action" type="FilterResult"> + <xs:annotation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="compareTo" type="xs:string"> + <xs:annotation> + <xs:documentation>String to compare the layout to.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="LogReceiverService"> + <xs:complexType name="whenNotContains"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Filter"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="endpointConfigurationName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="endpointAddress" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> - <xs:element name="clientId" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="endpointConfigurationName" type="xs:string"> + <xs:attribute name="substring" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the endpoint configuration in WCF configuration file.</xs:documentation> + <xs:documentation>Substring to be matched.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="endpointAddress" type="xs:string"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Endpoint address.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useBinaryEncoding" type="xs:boolean"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to use binary message encoding.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="clientId" type="SimpleLayoutAttribute"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="whenNotEqual"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Client ID.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeEventProperties" type="xs:boolean"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include per-event properties in the payload sent to the server.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="action" type="FilterResult"> + <xs:annotation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="compareTo" type="xs:string"> + <xs:annotation> + <xs:documentation>String to compare the layout to.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> diff --git a/src/NzbDrone.Host/NzbDrone.Host.csproj b/src/NzbDrone.Host/NzbDrone.Host.csproj index b4aa2ad35..b9d21274f 100644 --- a/src/NzbDrone.Host/NzbDrone.Host.csproj +++ b/src/NzbDrone.Host/NzbDrone.Host.csproj @@ -89,21 +89,21 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.Owin.Hosting.1.1.0-beta2\lib\net40\Microsoft.Owin.Hosting.dll</HintPath> </Reference> - <Reference Include="Nancy, Version=0.20.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Nancy, Version=0.21.1.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Nancy.0.20.0\lib\net40\Nancy.dll</HintPath> + <HintPath>..\packages\Nancy.0.21.1\lib\net40\Nancy.dll</HintPath> </Reference> - <Reference Include="Nancy.Owin, Version=0.20.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Nancy.Owin, Version=0.21.1.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Nancy.Owin.0.20.0\lib\net40\Nancy.Owin.dll</HintPath> + <HintPath>..\packages\Nancy.Owin.0.21.1\lib\net40\Nancy.Owin.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> diff --git a/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs b/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs index cf4396edf..35499eacd 100644 --- a/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs +++ b/src/NzbDrone.Host/Owin/MiddleWare/SignalRMiddleWare.cs @@ -14,7 +14,7 @@ namespace NzbDrone.Host.Owin.MiddleWare { SignalrDependencyResolver.Register(container); - GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromSeconds(300000); + GlobalHost.Configuration.DisconnectTimeout = TimeSpan.FromMinutes(3); } public void Attach(IAppBuilder appBuilder) diff --git a/src/NzbDrone.Host/Owin/OwinHostController.cs b/src/NzbDrone.Host/Owin/OwinHostController.cs index 5af5a96c5..d750ee646 100644 --- a/src/NzbDrone.Host/Owin/OwinHostController.cs +++ b/src/NzbDrone.Host/Owin/OwinHostController.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net; @@ -72,6 +72,10 @@ namespace NzbDrone.Host.Owin try { + // options.ServerFactory = new + //_host = WebApp.Start(OwinServiceProviderFactory.Create(), options, BuildApp); + //_host = WebApp.Start(options, BuildApp); + _host = WebApp.Start(OwinServiceProviderFactory.Create(), options, BuildApp); } catch (TargetInvocationException ex) diff --git a/src/NzbDrone.Host/packages.config b/src/NzbDrone.Host/packages.config index f134e38ed..941d8db76 100644 --- a/src/NzbDrone.Host/packages.config +++ b/src/NzbDrone.Host/packages.config @@ -5,11 +5,10 @@ <package id="Microsoft.Owin" version="1.1.0-beta2" targetFramework="net40" /> <package id="Microsoft.Owin.Host.HttpListener" version="1.1.0-beta2" targetFramework="net40" /> <package id="Microsoft.Owin.Hosting" version="1.1.0-beta2" targetFramework="net40" /> - <package id="Nancy" version="0.20.0" targetFramework="net40" /> - <package id="Nancy.Owin" version="0.20.0" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> - <package id="NLog.Config" version="2.0.1.2" targetFramework="net40" /> - <package id="NLog.Schema" version="2.0.1.2" targetFramework="net40" /> + <package id="Nancy" version="0.21.1" targetFramework="net40" /> + <package id="Nancy.Owin" version="0.21.1" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> + <package id="NLog.Schema" version="2.1.0" targetFramework="net40" /> <package id="Owin" version="1.0" targetFramework="net40" /> -</packages> \ No newline at end of file +</packages> diff --git a/src/NzbDrone.Integration.Test/EpisodeIntegrationTests.cs b/src/NzbDrone.Integration.Test/EpisodeIntegrationTests.cs index 681e510ef..610d6f8bf 100644 --- a/src/NzbDrone.Integration.Test/EpisodeIntegrationTests.cs +++ b/src/NzbDrone.Integration.Test/EpisodeIntegrationTests.cs @@ -10,20 +10,28 @@ namespace NzbDrone.Integration.Test [TestFixture] public class EpisodeIntegrationTests : IntegrationTest { + private SeriesResource series; + + [SetUp] + public void Setup() + { + series = GivenSeriesWithEpisodes(); + } + private SeriesResource GivenSeriesWithEpisodes() { - var series = Series.Lookup("archer").First(); + var newSeries = Series.Lookup("archer").First(); - series.QualityProfileId = 1; - series.Path = @"C:\Test\Archer".AsOsAgnostic(); + newSeries.QualityProfileId = 1; + newSeries.Path = @"C:\Test\Archer".AsOsAgnostic(); - series = Series.Post(series); + newSeries = Series.Post(newSeries); while (true) { - if (Episodes.GetEpisodesInSeries(series.Id).Count > 0) + if (Episodes.GetEpisodesInSeries(newSeries.Id).Count > 0) { - return series; + return newSeries; } Thread.Sleep(1000); @@ -33,28 +41,33 @@ namespace NzbDrone.Integration.Test [Test] public void should_be_able_to_get_all_episodes_in_series() { - var series = GivenSeriesWithEpisodes(); Episodes.GetEpisodesInSeries(series.Id).Count.Should().BeGreaterThan(0); } [Test] public void should_be_able_to_get_a_single_episode() { - var series = GivenSeriesWithEpisodes(); var episodes = Episodes.GetEpisodesInSeries(series.Id); Episodes.Get(episodes.First().Id).Should().NotBeNull(); } [Test] - public void should_be_able_to_set_monitor_status_via_api() + public void should_be_able_to_set_monitor_status() { - var series = GivenSeriesWithEpisodes(); var episodes = Episodes.GetEpisodesInSeries(series.Id); var updatedEpisode = episodes.First(); updatedEpisode.Monitored = false; Episodes.Put(updatedEpisode).Monitored.Should().BeFalse(); } + + + [TearDown] + public void TearDown() + { + Series.Delete(series.Id); + Thread.Sleep(2000); + } } } diff --git a/src/NzbDrone.Integration.Test/IntegrationTest.cs b/src/NzbDrone.Integration.Test/IntegrationTest.cs index f8556a58d..90a5ad426 100644 --- a/src/NzbDrone.Integration.Test/IntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/IntegrationTest.cs @@ -1,4 +1,9 @@ -using NLog; +using System; +using System.Collections.Generic; +using System.Threading; +using Microsoft.AspNet.SignalR.Client; +using Microsoft.AspNet.SignalR.Client.Transports; +using NLog; using NLog.Config; using NLog.Targets; using NUnit.Framework; @@ -7,7 +12,10 @@ using NzbDrone.Api.Config; using NzbDrone.Api.History; using NzbDrone.Api.RootFolders; using NzbDrone.Common.EnvironmentInfo; +using NzbDrone.Common.Serializer; using NzbDrone.Integration.Test.Client; +using NzbDrone.SignalR; +using NzbDrone.Test.Common; using NzbDrone.Test.Common.Categories; using RestSharp; @@ -29,6 +37,16 @@ namespace NzbDrone.Integration.Test protected ClientBase<NamingConfigResource> NamingConfig; private NzbDroneRunner _runner; + private List<SignalRMessage> _signalRReceived; + private Connection _signalrConnection; + + protected IEnumerable<SignalRMessage> SignalRMessages + { + get + { + return _signalRReceived; + } + } public IntegrationTest() { @@ -40,8 +58,8 @@ namespace NzbDrone.Integration.Test LogManager.Configuration.LoggingRules.Add(new LoggingRule("*", LogLevel.Trace, consoleTarget)); } - //[TestFixtureSetUp] - [SetUp] + [TestFixtureSetUp] + //[SetUp] public void SmokeTestSetup() { _runner = new NzbDroneRunner(); @@ -64,11 +82,61 @@ namespace NzbDrone.Integration.Test NamingConfig = new ClientBase<NamingConfigResource>(RestClient, _runner.ApiKey, "config/naming"); } - //[TestFixtureTearDown] - [TearDown] + [TestFixtureTearDown] + //[TearDown] public void SmokeTestTearDown() { _runner.KillAll(); } + + [TearDown] + public void IntegrationSetup() + { + if (_signalrConnection != null) + { + switch (_signalrConnection.State) + { + case ConnectionState.Connected: + case ConnectionState.Connecting: + { + _signalrConnection.Stop(); + break; + } + } + + _signalrConnection = null; + _signalRReceived = new List<SignalRMessage>(); + } + } + + protected void ConnectSignalR() + { + _signalRReceived = new List<SignalRMessage>(); + _signalrConnection = new Connection("http://localhost:8989/signalr"); + _signalrConnection.Start(new LongPollingTransport()).ContinueWith(task => + { + if (task.IsFaulted) + { + Assert.Fail("SignalrConnection failed. {0}", task.Exception.GetBaseException()); + } + }); + + var retryCount = 0; + + while (_signalrConnection.State != ConnectionState.Connected) + { + if (retryCount > 25) + { + Assert.Fail("Couldn't establish signalr connection. State: {0}", _signalrConnection.State); + } + + retryCount++; + Console.WriteLine("Connecting to signalR" + _signalrConnection.State); + Thread.Sleep(200); + } + + _signalrConnection.Received += json => _signalRReceived.Add(Json.Deserialize<SignalRMessage>(json)); ; + } + } } diff --git a/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj b/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj index 75bea0f21..b1ee17afc 100644 --- a/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj +++ b/src/NzbDrone.Integration.Test/NzbDrone.Integration.Test.csproj @@ -37,11 +37,12 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\FluentAssertions.2.1.0.0\lib\net40\FluentAssertions.dll</HintPath> </Reference> - <Reference Include="FluentValidation, Version=4.0.0.1, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="FluentValidation, Version=5.0.0.1, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\FluentValidation.4.0.0.1\lib\Net40\FluentValidation.dll</HintPath> + <HintPath>..\packages\FluentValidation.5.0.0.1\lib\Net40\FluentValidation.dll</HintPath> </Reference> - <Reference Include="Microsoft.AspNet.SignalR.Client"> + <Reference Include="Microsoft.AspNet.SignalR.Client, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Microsoft.AspNet.SignalR.Client.1.1.3\lib\net40\Microsoft.AspNet.SignalR.Client.dll</HintPath> </Reference> <Reference Include="Microsoft.Owin"> @@ -59,20 +60,21 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> </Reference> - <Reference Include="Nancy, Version=0.20.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Nancy, Version=0.21.1.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Nancy.0.20.0\lib\net40\Nancy.dll</HintPath> + <HintPath>..\packages\Nancy.0.21.1\lib\net40\Nancy.dll</HintPath> </Reference> - <Reference Include="Nancy.Owin, Version=0.20.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="Nancy.Owin, Version=0.21.1.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Nancy.Owin.0.20.0\lib\net40\Nancy.Owin.dll</HintPath> + <HintPath>..\packages\Nancy.Owin.0.21.1\lib\net40\Nancy.Owin.dll</HintPath> </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog"> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="nunit.framework"> <HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath> @@ -81,9 +83,9 @@ <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath> </Reference> - <Reference Include="RestSharp, Version=104.2.0.0, Culture=neutral, processorArchitecture=MSIL"> + <Reference Include="RestSharp, Version=104.3.3.0, Culture=neutral, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\RestSharp.104.2.0\lib\net4\RestSharp.dll</HintPath> + <HintPath>..\packages\RestSharp.104.3.3\lib\net4\RestSharp.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> @@ -105,7 +107,6 @@ <Compile Include="EpisodeIntegrationTests.cs" /> <Compile Include="IndexerIntegrationFixture.cs" /> <Compile Include="IntegrationTestDirectoryInfo.cs" /> - <Compile Include="NzbDroneRunner.cs" /> <Compile Include="QualityProfileIntegrationTest.cs" /> <Compile Include="ReleaseIntegrationTest.cs" /> <Compile Include="IntegrationTest.cs" /> @@ -136,6 +137,10 @@ <Project>{95C11A9E-56ED-456A-8447-2C89C1139266}</Project> <Name>NzbDrone.Host</Name> </ProjectReference> + <ProjectReference Include="..\NzbDrone.SignalR\NzbDrone.SignalR.csproj"> + <Project>{7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}</Project> + <Name>NzbDrone.SignalR</Name> + </ProjectReference> <ProjectReference Include="..\NzbDrone.Test.Common\NzbDrone.Test.Common.csproj"> <Project>{CADDFCE0-7509-4430-8364-2074E1EEFCA2}</Project> <Name>NzbDrone.Test.Common</Name> diff --git a/src/NzbDrone.Integration.Test/RootFolderIntegrationTest.cs b/src/NzbDrone.Integration.Test/RootFolderIntegrationTest.cs index 0b7647fdf..c7984e940 100644 --- a/src/NzbDrone.Integration.Test/RootFolderIntegrationTest.cs +++ b/src/NzbDrone.Integration.Test/RootFolderIntegrationTest.cs @@ -1,8 +1,5 @@ using System; -using System.Collections.Generic; using FluentAssertions; -using Microsoft.AspNet.SignalR.Client; -using Microsoft.AspNet.SignalR.Client.Transports; using NUnit.Framework; using NzbDrone.Api.RootFolders; @@ -11,39 +8,25 @@ namespace NzbDrone.Integration.Test [TestFixture] public class RootFolderIntegrationTest : IntegrationTest { - private Connection _connection; - private List<object> _signalRReceived; - [SetUp] - public void Setup() - { - _signalRReceived = new List<object>(); - _connection = new Connection("http://localhost:8989/signalr/rootfolder"); - _connection.Start(new LongPollingTransport()).ContinueWith(task => - { - if (task.IsFaulted) - { - Assert.Fail("SignalrConnection failed. {0}", task.Exception.GetBaseException()); - } - }); - _connection.Received += _connection_Received; - } - private void _connection_Received(string obj) + [Test] + public void should_have_no_root_folder_initially() { - _signalRReceived.Add(obj); + RootFolders.All().Should().BeEmpty(); } [Test] - public void should_have_no_root_folder_initially() + public void should_add_and_delete_root_folders() { - RootFolders.All().Should().BeEmpty(); + + ConnectSignalR(); var rootFolder = new RootFolderResource - { - Path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) - }; + { + Path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + }; var postResponse = RootFolders.Post(rootFolder); @@ -56,6 +39,11 @@ namespace NzbDrone.Integration.Test RootFolders.Delete(postResponse.Id); RootFolders.All().Should().BeEmpty(); + + + SignalRMessages.Should().Contain(c => c.Name == "rootfolder"); + + } [Test] diff --git a/src/NzbDrone.Integration.Test/packages.config b/src/NzbDrone.Integration.Test/packages.config index 101c14bc1..0013824cf 100644 --- a/src/NzbDrone.Integration.Test/packages.config +++ b/src/NzbDrone.Integration.Test/packages.config @@ -1,17 +1,17 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="FluentAssertions" version="2.1.0.0" targetFramework="net40" /> - <package id="FluentValidation" version="4.0.0.1" targetFramework="net40" /> + <package id="FluentValidation" version="5.0.0.1" targetFramework="net40" /> <package id="Microsoft.AspNet.SignalR.Client" version="1.1.3" targetFramework="net40" /> <package id="Microsoft.Owin" version="1.1.0-beta2" targetFramework="net40" /> <package id="Microsoft.Owin.Host.HttpListener" version="1.1.0-beta2" targetFramework="net40" /> <package id="Microsoft.Owin.Hosting" version="1.1.0-beta2" targetFramework="net40" /> <package id="Moq" version="4.0.10827" targetFramework="net40" /> - <package id="Nancy" version="0.20.0" targetFramework="net40" /> - <package id="Nancy.Owin" version="0.20.0" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> + <package id="Nancy" version="0.21.1" targetFramework="net40" /> + <package id="Nancy.Owin" version="0.21.1" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NUnit" version="2.6.2" targetFramework="net40" /> <package id="Owin" version="1.0" targetFramework="net40" /> - <package id="RestSharp" version="104.2.0" targetFramework="net40" /> + <package id="RestSharp" version="104.3.3" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.Libraries.Test/NzbDrone.Libraries.Test.csproj b/src/NzbDrone.Libraries.Test/NzbDrone.Libraries.Test.csproj index 14c492823..673eafe98 100644 --- a/src/NzbDrone.Libraries.Test/NzbDrone.Libraries.Test.csproj +++ b/src/NzbDrone.Libraries.Test/NzbDrone.Libraries.Test.csproj @@ -39,7 +39,7 @@ </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="nunit.framework"> <HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath> diff --git a/src/NzbDrone.Libraries.Test/packages.config b/src/NzbDrone.Libraries.Test/packages.config index 0a78ede96..48393462a 100644 --- a/src/NzbDrone.Libraries.Test/packages.config +++ b/src/NzbDrone.Libraries.Test/packages.config @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="FluentAssertions" version="2.1.0.0" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> <package id="NUnit" version="2.6.2" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj index c3110ef29..efbda7398 100644 --- a/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj +++ b/src/NzbDrone.SignalR/NzbDrone.SignalR.csproj @@ -36,8 +36,9 @@ <Reference Include="Microsoft.AspNet.SignalR.Core"> <HintPath>..\packages\Microsoft.AspNet.SignalR.Core.1.1.3\lib\net40\Microsoft.AspNet.SignalR.Core.dll</HintPath> </Reference> - <Reference Include="Newtonsoft.Json"> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> diff --git a/src/NzbDrone.SignalR/packages.config b/src/NzbDrone.SignalR/packages.config index f82b57a29..a5b443e7a 100644 --- a/src/NzbDrone.SignalR/packages.config +++ b/src/NzbDrone.SignalR/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Microsoft.AspNet.SignalR.Core" version="1.1.3" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj b/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj index dd6ffc0fe..0c35b4049 100644 --- a/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj +++ b/src/NzbDrone.Test.Common/NzbDrone.Test.Common.csproj @@ -54,16 +54,20 @@ </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> <HintPath>..\packages\NUnit.2.6.2\lib\nunit.framework.dll</HintPath> </Reference> + <Reference Include="RestSharp, Version=104.3.3.0, Culture=neutral, processorArchitecture=MSIL"> + <SpecificVersion>False</SpecificVersion> + <HintPath>..\packages\RestSharp.104.3.3\lib\net4\RestSharp.dll</HintPath> + </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> @@ -82,6 +86,7 @@ <Compile Include="Categories\IntegrationTestAttribute.cs" /> <Compile Include="LoggingTest.cs" /> <Compile Include="MockerExtensions.cs" /> + <Compile Include="NzbDroneRunner.cs" /> <Compile Include="ObjectExtentions.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="ReflectionExtensions.cs" /> diff --git a/src/NzbDrone.Integration.Test/NzbDroneRunner.cs b/src/NzbDrone.Test.Common/NzbDroneRunner.cs similarity index 83% rename from src/NzbDrone.Integration.Test/NzbDroneRunner.cs rename to src/NzbDrone.Test.Common/NzbDroneRunner.cs index 375fdc0b9..8622b6555 100644 --- a/src/NzbDrone.Integration.Test/NzbDroneRunner.cs +++ b/src/NzbDrone.Test.Common/NzbDroneRunner.cs @@ -1,17 +1,15 @@ using System; using System.Diagnostics; using System.IO; -using System.Linq; using System.Threading; using System.Xml.Linq; +using System.Xml.XPath; using NUnit.Framework; -using NzbDrone.Common; using NzbDrone.Common.EnvironmentInfo; using NzbDrone.Common.Processes; -using NzbDrone.Core.Configuration; using RestSharp; -namespace NzbDrone.Integration.Test +namespace NzbDrone.Test.Common { public class NzbDroneRunner { @@ -41,8 +39,7 @@ namespace NzbDrone.Integration.Test if (BuildInfo.IsDebug) { - - Start("..\\..\\..\\..\\_output\\NzbDrone.Console.exe"); + Start("..\\..\\..\\..\\..\\_output\\NzbDrone.Console.exe"); } else { @@ -104,12 +101,19 @@ namespace NzbDrone.Integration.Test { var configFile = Path.Combine(AppData, "config.xml"); - if (!String.IsNullOrWhiteSpace(ApiKey)) return; - if (!File.Exists(configFile)) return; - - var xDoc = XDocument.Load(configFile); - var config = xDoc.Descendants(ConfigFileProvider.CONFIG_ELEMENT_NAME).Single(); - ApiKey = config.Descendants("ApiKey").Single().Value; + while (ApiKey == null) + { + if (File.Exists(configFile)) + { + var apiKeyElement = XDocument.Load(configFile) + .XPathSelectElement("Config/ApiKey"); + if (apiKeyElement != null) + { + ApiKey = apiKeyElement.Value; + } + } + Thread.Sleep(1000); + } } } } \ No newline at end of file diff --git a/src/NzbDrone.Test.Common/packages.config b/src/NzbDrone.Test.Common/packages.config index 6880e0bf8..28a2e5f1d 100644 --- a/src/NzbDrone.Test.Common/packages.config +++ b/src/NzbDrone.Test.Common/packages.config @@ -3,8 +3,9 @@ <package id="CommonServiceLocator" version="1.0" /> <package id="FluentAssertions" version="2.1.0.0" targetFramework="net40" /> <package id="Moq" version="4.0.10827" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NUnit" version="2.6.2" targetFramework="net40" /> + <package id="RestSharp" version="104.3.3" targetFramework="net40" /> <package id="Unity" version="2.1.505.2" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj b/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj index 3dbc57b35..6e39cd8ab 100644 --- a/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj +++ b/src/NzbDrone.Update.Test/NzbDrone.Update.Test.csproj @@ -50,9 +50,9 @@ <Reference Include="Moq"> <HintPath>..\packages\Moq.4.0.10827\lib\NET40\Moq.dll</HintPath> </Reference> - <Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="nunit.framework, Version=2.6.2.12296, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> diff --git a/src/NzbDrone.Update.Test/packages.config b/src/NzbDrone.Update.Test/packages.config index 6f925b437..c88b100c8 100644 --- a/src/NzbDrone.Update.Test/packages.config +++ b/src/NzbDrone.Update.Test/packages.config @@ -3,6 +3,6 @@ <package id="FluentAssertions" version="2.1.0.0" targetFramework="net40" /> <package id="Moq" version="4.0.10827" /> <package id="NBuilder" version="3.0.1.1" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="NUnit" version="2.6.2" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.Update/NLog.xsd b/src/NzbDrone.Update/NLog.xsd index 2203f4ede..49dd62049 100644 --- a/src/NzbDrone.Update/NLog.xsd +++ b/src/NzbDrone.Update/NLog.xsd @@ -224,6 +224,84 @@ <xs:minLength value="1" /> </xs:restriction> </xs:simpleType> + <xs:complexType name="AspNetBufferingWrapper"> + <xs:complexContent> + <xs:extension base="WrapperTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="growBufferAsNeeded" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferGrowLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="growBufferAsNeeded" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether buffer should grow as needed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="bufferSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Number of log events to be buffered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="bufferGrowLimit" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum number of log events that the buffer can keep.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="AspNetTrace"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="AspResponse"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="addComments" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="addComments" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to add <!-- --> comments around all written texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> <xs:complexType name="AsyncWrapper"> <xs:complexContent> <xs:extension base="WrapperTargetBase"> @@ -289,8 +367,8 @@ <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="slidingTimeout" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="flushTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -302,14 +380,14 @@ <xs:documentation>Indicates whether to use sliding timeout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="flushTimeout" type="xs:integer"> <xs:annotation> - <xs:documentation>Number of log events to be buffered.</xs:documentation> + <xs:documentation>Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="flushTimeout" type="xs:integer"> + <xs:attribute name="bufferSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Timeout (in milliseconds) after which the contents of buffer will be flushed if there's no write in the specified period of time. Use -1 to disable timed flushes.</xs:documentation> + <xs:documentation>Number of log events to be buffered.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> @@ -321,21 +399,22 @@ <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> - <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -347,11 +426,6 @@ <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Instance of that is used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> <xs:annotation> <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> @@ -367,9 +441,9 @@ <xs:documentation>Encoding to be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>Instance of that is used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="address" type="SimpleLayoutAttribute"> @@ -377,14 +451,24 @@ <xs:documentation>Network address.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="keepConnection" type="xs:boolean"> <xs:annotation> <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:attribute name="maxQueueSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> + <xs:documentation>Maximum queue size.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="includeCallSite" type="xs:boolean"> @@ -397,9 +481,9 @@ <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ndcItemSeparator" type="xs:string"> + <xs:attribute name="includeNLogData" type="xs:boolean"> <xs:annotation> - <xs:documentation>NDC item separator.</xs:documentation> + <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="includeNdc" type="xs:boolean"> @@ -407,14 +491,14 @@ <xs:documentation>Indicates whether to include stack contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNLogData" type="xs:boolean"> + <xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> + <xs:documentation>NDC item separator.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:attribute name="includeSourceInfo" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> + <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> @@ -443,26 +527,24 @@ </xs:annotation> </xs:attribute> </xs:complexType> - <xs:complexType name="Console"> + <xs:complexType name="ColoredConsole"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="highlight-row" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleRowHighlightingRule" /> + <xs:element name="highlight-word" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleWordHighlightingRule" /> + <xs:element name="useDefaultRowHighlightingRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Footer.</xs:documentation> @@ -473,102 +555,233 @@ <xs:documentation>Header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="error" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to send the log messages to the standard error instead of the standard output.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="Database"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> - <xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> - <xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbUserName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbProvider" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the database provider.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="useTransactions" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to use database transactions. Some data providers require this.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="connectionStringName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the connection string (as specified in <connectionStrings> configuration section.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="connectionString" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbDatabase" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbPassword" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="dbHost" type="SimpleLayoutAttribute"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="installConnectionString" type="SimpleLayoutAttribute"> + <xs:attribute name="useDefaultRowHighlightingRules" type="xs:boolean"> <xs:annotation> - <xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation> + <xs:documentation>Indicates whether to use default row highlighting rules.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="commandText" type="SimpleLayoutAttribute"> + <xs:attribute name="errorStream" type="xs:boolean"> <xs:annotation> - <xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation> + <xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="System.Data.CommandType"> + <xs:simpleType name="NLog.Targets.ConsoleOutputColor"> <xs:restriction base="xs:string"> - <xs:enumeration value="StoredProcedure" /> - <xs:enumeration value="TableDirect" /> - <xs:enumeration value="Text" /> + <xs:enumeration value="Black" /> + <xs:enumeration value="DarkBlue" /> + <xs:enumeration value="DarkGreen" /> + <xs:enumeration value="DarkCyan" /> + <xs:enumeration value="DarkRed" /> + <xs:enumeration value="DarkMagenta" /> + <xs:enumeration value="DarkYellow" /> + <xs:enumeration value="Gray" /> + <xs:enumeration value="DarkGray" /> + <xs:enumeration value="Blue" /> + <xs:enumeration value="Green" /> + <xs:enumeration value="Cyan" /> + <xs:enumeration value="Red" /> + <xs:enumeration value="Magenta" /> + <xs:enumeration value="Yellow" /> + <xs:enumeration value="White" /> + <xs:enumeration value="NoChange" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NLog.Targets.ConsoleRowHighlightingRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> + <xs:annotation> + <xs:documentation>Condition that must be met in order to set the specified foreground and background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Foreground color.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="NLog.Targets.ConsoleWordHighlightingRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="regex" type="xs:string"> + <xs:annotation> + <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="text" type="xs:string"> + <xs:annotation> + <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="wholeWords" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to match whole words only.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> + <xs:annotation> + <xs:documentation>Foreground color.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="Console"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="error" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Footer.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Text to be rendered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="error" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to send the log messages to the standard error instead of the standard output.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="Database"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="dbUserName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbProvider" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="useTransactions" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="dbPassword" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionStringName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="connectionString" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbHost" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="dbDatabase" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="uninstall-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> + <xs:element name="install-command" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseCommandInfo" /> + <xs:element name="installConnectionString" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.DatabaseParameterInfo" /> + <xs:element name="commandText" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbUserName" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database user name. If the ConnectionString is not provided this value will be used to construct the "User ID=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbProvider" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the database provider.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="useTransactions" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to use database transactions. Some data providers require this.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to keep the database connection open between the log events.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbPassword" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database password. If the ConnectionString is not provided this value will be used to construct the "Password=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionStringName" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the connection string (as specified in <connectionStrings> configuration section.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionString" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Connection string. When provided, it overrides the values specified in DBHost, DBUserName, DBPassword, DBDatabase.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbHost" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database host name. If the ConnectionString is not provided this value will be used to construct the "Server=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="dbDatabase" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Database name. If the ConnectionString is not provided this value will be used to construct the "Database=" part of the connection string.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="installConnectionString" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Connection string using for installation and uninstallation. If not provided, regular ConnectionString is being used.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="commandText" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Text of the SQL command to be run on each log level.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:simpleType name="System.Data.CommandType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Text" /> + <xs:enumeration value="StoredProcedure" /> + <xs:enumeration value="TableDirect" /> </xs:restriction> </xs:simpleType> <xs:complexType name="NLog.Targets.DatabaseCommandInfo"> @@ -634,11 +847,13 @@ </xs:annotation> </xs:attribute> </xs:complexType> - <xs:complexType name="Debug"> + <xs:complexType name="Debugger"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -646,64 +861,55 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Footer.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="FallbackGroup"> + <xs:complexType name="Debug"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="returnToFirstOnSuccess" type="xs:boolean"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="File"> + <xs:complexType name="EventLog"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="lineEnding" minOccurs="0" maxOccurs="1" type="NLog.Targets.LineEndingMode" /> - <xs:element name="archiveAboveSize" minOccurs="0" maxOccurs="1" type="xs:long" /> - <xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="archiveFileName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="archiveNumbering" minOccurs="0" maxOccurs="1" type="NLog.Targets.ArchiveNumberingMode" /> - <xs:element name="archiveEvery" minOccurs="0" maxOccurs="1" type="NLog.Targets.FileArchivePeriod" /> - <xs:element name="replaceFileContentsOnEachWrite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="fileAttributes" minOccurs="0" maxOccurs="1" type="NLog.Targets.Win32FileAttributes" /> - <xs:element name="fileName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="deleteOldFileOnStartup" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="enableFileDelete" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="createDirs" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="concurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="concurrentWriteAttempts" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="keepFileOpen" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="machineName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="source" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="log" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="category" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="eventId" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -712,17 +918,92 @@ </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="machineName" type="xs:string"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Name of the machine on which Event Log service is running.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="source" type="xs:string"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> + <xs:documentation>Value to be used as the event Source.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="log" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the Event Log to write to. This can be System, Application or any user-defined name.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="category" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that renders event Category.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="eventId" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that renders event ID.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="FallbackGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="returnToFirstOnSuccess" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="returnToFirstOnSuccess" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to return to the first target after any successful write.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="File"> + <xs:complexContent> + <xs:extension base="Target"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="lineEnding" minOccurs="0" maxOccurs="1" type="NLog.Targets.LineEndingMode" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="archiveEvery" minOccurs="0" maxOccurs="1" type="NLog.Targets.FileArchivePeriod" /> + <xs:element name="archiveAboveSize" minOccurs="0" maxOccurs="1" type="xs:long" /> + <xs:element name="archiveFileName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="maxArchiveFiles" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="archiveNumbering" minOccurs="0" maxOccurs="1" type="NLog.Targets.ArchiveNumberingMode" /> + <xs:element name="forceManaged" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="fileAttributes" minOccurs="0" maxOccurs="1" type="NLog.Targets.Win32FileAttributes" /> + <xs:element name="deleteOldFileOnStartup" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="enableFileDelete" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="createDirs" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="replaceFileContentsOnEachWrite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="fileName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="openFileCacheTimeout" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="concurrentWriteAttempts" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="concurrentWriteAttemptDelay" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="autoFlush" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="concurrentWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="openFileCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="networkWrites" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="keepFileOpen" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="encoding" type="xs:string"> @@ -735,14 +1016,29 @@ <xs:documentation>Line ending mode.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveAboveSize" type="xs:long"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size in bytes above which log files will be automatically archived.</xs:documentation> + <xs:documentation>Footer.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxArchiveFiles" type="xs:integer"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Maximum number of archive files that should be kept.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Header.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="archiveEvery" type="NLog.Targets.FileArchivePeriod"> + <xs:annotation> + <xs:documentation>Indicates whether to automatically archive log files every time the specified time passes.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="archiveAboveSize" type="xs:long"> + <xs:annotation> + <xs:documentation>Size in bytes above which log files will be automatically archived.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="archiveFileName" type="SimpleLayoutAttribute"> @@ -750,19 +1046,19 @@ <xs:documentation>Name of the file to be used for an archive.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveNumbering" type="NLog.Targets.ArchiveNumberingMode"> + <xs:attribute name="maxArchiveFiles" type="xs:integer"> <xs:annotation> - <xs:documentation>Way file archives are numbered.</xs:documentation> + <xs:documentation>Maximum number of archive files that should be kept.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="archiveEvery" type="NLog.Targets.FileArchivePeriod"> + <xs:attribute name="archiveNumbering" type="NLog.Targets.ArchiveNumberingMode"> <xs:annotation> - <xs:documentation>Indicates whether to automatically archive log files every time the specified time passes.</xs:documentation> + <xs:documentation>Way file archives are numbered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="replaceFileContentsOnEachWrite" type="xs:boolean"> + <xs:attribute name="forceManaged" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to replace file contents on each write instead of appending log message at the end.</xs:documentation> + <xs:documentation>Gets ors set a value indicating whether a managed file stream is forced, instead of used the native implementation.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="fileAttributes" type="NLog.Targets.Win32FileAttributes"> @@ -770,11 +1066,6 @@ <xs:documentation>File attributes (Windows only).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="fileName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Name of the file to write to.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="deleteOldFileOnStartup" type="xs:boolean"> <xs:annotation> <xs:documentation>Indicates whether to delete old log file on startup.</xs:documentation> @@ -790,9 +1081,14 @@ <xs:documentation>Indicates whether to create directories if they don't exist.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="concurrentWrites" type="xs:boolean"> + <xs:attribute name="replaceFileContentsOnEachWrite" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on the same host.</xs:documentation> + <xs:documentation>Indicates whether to replace file contents on each write instead of appending log message at the end.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fileName" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Name of the file to write to.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="openFileCacheTimeout" type="xs:integer"> @@ -800,14 +1096,14 @@ <xs:documentation>Maximum number of seconds that files are kept open. If this number is negative the files are not automatically closed after a period of inactivity.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="openFileCacheSize" type="xs:integer"> + <xs:attribute name="bufferSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger).</xs:documentation> + <xs:documentation>Log file buffer size in bytes.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="networkWrites" type="xs:boolean"> + <xs:attribute name="concurrentWriteAttempts" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on different network hosts.</xs:documentation> + <xs:documentation>Number of times the write is appended on the file before NLog discards the log message.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="concurrentWriteAttemptDelay" type="xs:integer"> @@ -815,19 +1111,24 @@ <xs:documentation>Delay in milliseconds to wait before attempting to write to the file again.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="concurrentWriteAttempts" type="xs:integer"> + <xs:attribute name="autoFlush" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of times the write is appended on the file before NLog discards the log message.</xs:documentation> + <xs:documentation>Indicates whether to automatically flush the file buffers after each log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="concurrentWrites" type="xs:boolean"> <xs:annotation> - <xs:documentation>Log file buffer size in bytes.</xs:documentation> + <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on the same host.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="autoFlush" type="xs:boolean"> + <xs:attribute name="openFileCacheSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to automatically flush the file buffers after each log message.</xs:documentation> + <xs:documentation>Number of files to be kept open. Setting this to a higher value may improve performance in a situation where a single File target is writing to many files (such as splitting by level or by logger).</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="networkWrites" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether concurrent writes to the log file by multiple processes on different network hosts.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="keepFileOpen" type="xs:boolean"> @@ -847,12 +1148,6 @@ <xs:enumeration value="None" /> </xs:restriction> </xs:simpleType> - <xs:simpleType name="NLog.Targets.ArchiveNumberingMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Sequence" /> - <xs:enumeration value="Rolling" /> - </xs:restriction> - </xs:simpleType> <xs:simpleType name="NLog.Targets.FileArchivePeriod"> <xs:restriction base="xs:string"> <xs:enumeration value="None" /> @@ -863,9 +1158,15 @@ <xs:enumeration value="Minute" /> </xs:restriction> </xs:simpleType> + <xs:simpleType name="NLog.Targets.ArchiveNumberingMode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Sequence" /> + <xs:enumeration value="Rolling" /> + </xs:restriction> + </xs:simpleType> <xs:simpleType name="NLog.Targets.Win32FileAttributes"> <xs:restriction base="xs:string"> - <xs:enumeration value="Readonly" /> + <xs:enumeration value="ReadOnly" /> <xs:enumeration value="Hidden" /> <xs:enumeration value="System" /> <xs:enumeration value="Archive" /> @@ -881,7 +1182,6 @@ <xs:enumeration value="NoBuffering" /> <xs:enumeration value="DeleteOnClose" /> <xs:enumeration value="PosixSemantics" /> - <xs:enumeration value="ReadOnly" /> </xs:restriction> </xs:simpleType> <xs:complexType name="FilteringWrapper"> @@ -904,12 +1204,16 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Memory"> + <xs:complexType name="FormControl"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="append" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="reverseOrder" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -921,257 +1225,327 @@ <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="MessageBox"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="caption" minOccurs="0" maxOccurs="1" type="Layout" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="formName" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Name of the Form on which the control is located.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="controlName" type="xs:string"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Name of control to which NLog will log write log text.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="caption" type="SimpleLayoutAttribute"> + <xs:attribute name="append" type="xs:boolean"> <xs:annotation> - <xs:documentation>Message box title.</xs:documentation> + <xs:documentation>Indicates whether log text should be appended to the text of the control instead of overwriting it.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="reverseOrder" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Whether new log entry are added to the start or the end of the control</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="MethodCall"> + <xs:complexType name="ImpersonatingWrapper"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="logOnType" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityLogOnType" /> + <xs:element name="domain" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="impersonationLevel" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityImpersonationLevel" /> + <xs:element name="logOnProvider" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.LogOnProviderType" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="methodName" type="xs:string"> + <xs:attribute name="password" type="xs:string"> <xs:annotation> - <xs:documentation>Method name. The method must be public and static.</xs:documentation> + <xs:documentation>User account password.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="className" type="xs:string"> + <xs:attribute name="revertToSelf" type="xs:boolean"> <xs:annotation> - <xs:documentation>Class name.</xs:documentation> + <xs:documentation>Indicates whether to revert to the credentials of the process instead of impersonating another user.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="userName" type="xs:string"> + <xs:annotation> + <xs:documentation>Username to change context to.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="logOnType" type="NLog.Targets.Wrappers.SecurityLogOnType"> + <xs:annotation> + <xs:documentation>Logon Type.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="domain" type="xs:string"> + <xs:annotation> + <xs:documentation>Windows domain name to change context to.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="impersonationLevel" type="NLog.Targets.Wrappers.SecurityImpersonationLevel"> + <xs:annotation> + <xs:documentation>Required impersonation level.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="logOnProvider" type="NLog.Targets.Wrappers.LogOnProviderType"> + <xs:annotation> + <xs:documentation>Type of the logon provider.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="NLog.Targets.MethodCallParameter"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="type" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that should be use to calcuate the value for the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="type" type="xs:string"> - <xs:annotation> - <xs:documentation>Type of the parameter.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Network"> + <xs:simpleType name="NLog.Targets.Wrappers.SecurityLogOnType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Interactive" /> + <xs:enumeration value="Network" /> + <xs:enumeration value="Batch" /> + <xs:enumeration value="Service" /> + <xs:enumeration value="NetworkClearText" /> + <xs:enumeration value="NewCredentials" /> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="NLog.Targets.Wrappers.SecurityImpersonationLevel"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Anonymous" /> + <xs:enumeration value="Identification" /> + <xs:enumeration value="Impersonation" /> + <xs:enumeration value="Delegation" /> + </xs:restriction> + </xs:simpleType> + <xs:simpleType name="NLog.Targets.Wrappers.LogOnProviderType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Default" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="LogReceiverService"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> - <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="endpointConfigurationName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="endpointAddress" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="clientId" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> - <xs:annotation> - <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="newLine" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:attribute name="endpointConfigurationName" type="xs:string"> <xs:annotation> - <xs:documentation>Maximum message size in bytes.</xs:documentation> + <xs:documentation>Name of the endpoint configuration in WCF configuration file.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="endpointAddress" type="xs:string"> <xs:annotation> - <xs:documentation>Encoding to be used.</xs:documentation> + <xs:documentation>Endpoint address.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="useBinaryEncoding" type="xs:boolean"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>Indicates whether to use binary message encoding.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:attribute name="clientId" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + <xs:documentation>Client ID.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:attribute name="includeEventProperties" type="xs:boolean"> <xs:annotation> - <xs:documentation>Network address.</xs:documentation> + <xs:documentation>Indicates whether to include per-event properties in the payload sent to the server.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="NLogViewer"> + <xs:complexType name="NLog.Targets.MethodCallParameter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="type" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout that should be use to calcuate the value for the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="type" type="xs:string"> + <xs:annotation> + <xs:documentation>Type of the parameter.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="Mail"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> - <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="html" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> - <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="addNewLines" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="to" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="cc" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="bcc" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="replaceNewlineWithBrTagInHtml" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="priority" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="useSystemNetMailSettings" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="smtpPort" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" /> + <xs:element name="smtpPassword" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="enableSsl" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="newLine" type="xs:boolean"> + <xs:attribute name="html" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + <xs:documentation>Indicates whether to send message as HTML instead of plain text.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="encoding" type="xs:string"> + <xs:annotation> + <xs:documentation>Encoding to be used for sending e-mail.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="addNewLines" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to add new lines between log entries.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Instance of that is used to format log messages.</xs:documentation> + <xs:documentation>Text to be rendered.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + <xs:documentation>Header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Maximum message size in bytes.</xs:documentation> + <xs:documentation>Footer.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="to" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Encoding to be used.</xs:documentation> + <xs:documentation>Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:attribute name="cc" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + <xs:documentation>CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:attribute name="bcc" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Network address.</xs:documentation> + <xs:documentation>BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:attribute name="subject" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + <xs:documentation>Mail subject.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:attribute name="body" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> + <xs:documentation>Mail message body (repeated for each log message send in one mail).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeCallSite" type="xs:boolean"> + <xs:attribute name="from" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include call site (class and method name) in the information sent over the network.</xs:documentation> + <xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="appInfo" type="xs:string"> + <xs:attribute name="replaceNewlineWithBrTagInHtml" type="xs:boolean"> <xs:annotation> - <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> + <xs:documentation>Indicates whether NewLine characters in the body should be replaced with tags.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ndcItemSeparator" type="xs:string"> + <xs:attribute name="priority" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>NDC item separator.</xs:documentation> + <xs:documentation>Priority used for sending mails.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNdc" type="xs:boolean"> + <xs:attribute name="useSystemNetMailSettings" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to include stack contents.</xs:documentation> + <xs:documentation>Indicates whether the default Settings from System.Net.MailSettings should be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeNLogData" type="xs:boolean"> + <xs:attribute name="smtpServer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> + <xs:documentation>SMTP Server to be used for sending.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeMdc" type="xs:boolean"> + <xs:attribute name="smtpUserName" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> + <xs:documentation>Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpPort" type="xs:integer"> + <xs:annotation> + <xs:documentation>Port number that SMTP Server is listening on.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpAuthentication" type="NLog.Targets.SmtpAuthenticationMode"> + <xs:annotation> + <xs:documentation>SMTP Authentication mode.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="smtpPassword" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="enableSsl" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Null"> + <xs:simpleType name="NLog.Targets.SmtpAuthenticationMode"> + <xs:restriction base="xs:string"> + <xs:enumeration value="None" /> + <xs:enumeration value="Basic" /> + <xs:enumeration value="Ntlm" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="Memory"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -1179,11 +1553,6 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="formatMessage" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to perform layout calculation.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Layout used to format log messages.</xs:documentation> @@ -1192,12 +1561,13 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="OutputDebugString"> + <xs:complexType name="MessageBox"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="caption" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> @@ -1209,596 +1579,699 @@ <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="caption" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Message box title.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="PostFilteringWrapper"> + <xs:complexType name="MSMQ"> <xs:complexContent> - <xs:extension base="WrapperTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" /> + <xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="checkIfQueueExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="recoverable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="defaultFilter" type="Condition"> + <xs:attribute name="useXmlEncoding" type="xs:boolean"> <xs:annotation> - <xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation> + <xs:documentation>Indicates whether to use the XML format when serializing message. This will also disable creating queues.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="NLog.Targets.Wrappers.FilteringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="exists" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="filter" minOccurs="0" maxOccurs="1" type="Condition" /> - </xs:choice> - <xs:attribute name="exists" type="Condition"> - <xs:annotation> - <xs:documentation>Condition to be tested.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="filter" type="Condition"> - <xs:annotation> - <xs:documentation>Resulting filter to be applied when the condition matches.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="RandomizeGroup"> - <xs:complexContent> - <xs:extension base="CompoundTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="checkIfQueueExists" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether to check if a queue exists before writing to it.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="RepeatingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="repeatCount" type="xs:integer"> + <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Number of times to repeat each log message.</xs:documentation> + <xs:documentation>Encoding to be used when writing text to the queue.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="RetryingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="queue" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Name of the queue to write to.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="retryDelayMilliseconds" type="xs:integer"> + <xs:attribute name="recoverable" type="xs:boolean"> <xs:annotation> - <xs:documentation>Time to wait between retries in milliseconds.</xs:documentation> + <xs:documentation>Indicates whether to use recoverable messages (with guaranteed delivery).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="retryCount" type="xs:integer"> + <xs:attribute name="createQueueIfNotExists" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation> + <xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="label" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Label to associate with each message.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="RoundRobinGroup"> + <xs:complexType name="MethodCall"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="className" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="methodName" type="xs:string"> + <xs:annotation> + <xs:documentation>Method name. The method must be public and static.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="className" type="xs:string"> + <xs:annotation> + <xs:documentation>Class name.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="SplitGroup"> + <xs:complexType name="Network"> <xs:complexContent> - <xs:extension base="CompoundTargetBase"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> + <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> + <xs:attribute name="newLine" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:annotation> + <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum message size in bytes.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout used to format log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="encoding" type="xs:string"> + <xs:annotation> + <xs:documentation>Encoding to be used.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="keepConnection" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="connectionCacheSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="address" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Network address.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxQueueSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum queue size.</xs:documentation> + </xs:annotation> + </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="WebService"> + <xs:complexType name="NLogViewer"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> - <xs:element name="url" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> + <xs:element name="newLine" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="onOverflow" minOccurs="0" maxOccurs="1" type="NLog.Targets.NetworkTargetOverflowAction" /> + <xs:element name="maxMessageSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="protocol" minOccurs="0" maxOccurs="1" type="NLog.Targets.WebServiceProtocol" /> - <xs:element name="namespace" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="address" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="connectionCacheSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="keepConnection" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxQueueSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="includeMdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeCallSite" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="appInfo" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.NLogViewerParameterInfo" /> + <xs:element name="includeNLogData" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="includeNdc" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="ndcItemSeparator" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="includeSourceInfo" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="url" type="xs:anyURI"> + <xs:attribute name="newLine" type="xs:boolean"> <xs:annotation> - <xs:documentation>Web service URL.</xs:documentation> + <xs:documentation>Indicates whether to append newline at the end of log message.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="onOverflow" type="NLog.Targets.NetworkTargetOverflowAction"> + <xs:annotation> + <xs:documentation>Action that should be taken if the message is larger than maxMessageSize.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="maxMessageSize" type="xs:integer"> + <xs:annotation> + <xs:documentation>Maximum message size in bytes.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Encoding.</xs:documentation> + <xs:documentation>Encoding to be used.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="protocol" type="NLog.Targets.WebServiceProtocol"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Protocol to be used when calling web service.</xs:documentation> + <xs:documentation>Instance of that is used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="namespace" type="xs:string"> + <xs:attribute name="address" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Web service namespace.</xs:documentation> + <xs:documentation>Network address.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="methodName" type="xs:string"> + <xs:attribute name="connectionCacheSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Web service method name.</xs:documentation> + <xs:documentation>Size of the connection cache (number of connections which are kept alive).</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="NLog.Targets.WebServiceProtocol"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Soap11" /> - <xs:enumeration value="Soap12" /> - <xs:enumeration value="HttpPost" /> - <xs:enumeration value="HttpGet" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="CsvLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="quoting" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvQuotingMode" /> - <xs:element name="quoteChar" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="withHeader" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="customColumnDelimiter" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="delimiter" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvColumnDelimiterMode" /> - <xs:element name="column" minOccurs="0" maxOccurs="unbounded" type="NLog.Layouts.CsvColumn" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="keepConnection" type="xs:boolean"> <xs:annotation> - <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> + <xs:documentation>Indicates whether to keep connection open whenever possible.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="maxQueueSize" type="xs:integer"> <xs:annotation> - <xs:documentation>Footer layout.</xs:documentation> + <xs:documentation>Maximum queue size.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="includeMdc" type="xs:boolean"> <xs:annotation> - <xs:documentation>Header layout.</xs:documentation> + <xs:documentation>Indicates whether to include dictionary contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="quoting" type="NLog.Layouts.CsvQuotingMode"> + <xs:attribute name="includeCallSite" type="xs:boolean"> <xs:annotation> - <xs:documentation>Quoting mode.</xs:documentation> + <xs:documentation>Indicates whether to include call site (class and method name) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="quoteChar" type="xs:string"> + <xs:attribute name="appInfo" type="xs:string"> <xs:annotation> - <xs:documentation>Quote Character.</xs:documentation> + <xs:documentation>AppInfo field. By default it's the friendly name of the current AppDomain.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="withHeader" type="xs:boolean"> + <xs:attribute name="includeNLogData" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether CVS should include header.</xs:documentation> + <xs:documentation>Indicates whether to include NLog-specific extensions to log4j schema.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="customColumnDelimiter" type="xs:string"> + <xs:attribute name="includeNdc" type="xs:boolean"> <xs:annotation> - <xs:documentation>Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom').</xs:documentation> + <xs:documentation>Indicates whether to include stack contents.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="delimiter" type="NLog.Layouts.CsvColumnDelimiterMode"> + <xs:attribute name="ndcItemSeparator" type="xs:string"> <xs:annotation> - <xs:documentation>Column delimiter.</xs:documentation> + <xs:documentation>NDC item separator.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="includeSourceInfo" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to include source info (file name and line number) in the information sent over the network.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Layouts.CsvQuotingMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="All" /> - <xs:enumeration value="Nothing" /> - <xs:enumeration value="Auto" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Layouts.CsvColumnDelimiterMode"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Auto" /> - <xs:enumeration value="Comma" /> - <xs:enumeration value="Semicolon" /> - <xs:enumeration value="Tab" /> - <xs:enumeration value="Pipe" /> - <xs:enumeration value="Space" /> - <xs:enumeration value="Custom" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Layouts.CsvColumn"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout of the column.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the column.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="SimpleLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Layout text.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="LayoutWithHeaderAndFooter"> + <xs:complexType name="Null"> <xs:complexContent> - <xs:extension base="Layout"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="formatMessage" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="formatMessage" type="xs:boolean"> <xs:annotation> - <xs:documentation>Header layout.</xs:documentation> + <xs:documentation>Indicates whether to perform layout calculation.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Footer layout.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="Log4JXmlEventLayout"> - <xs:complexContent> - <xs:extension base="Layout"> - <xs:choice minOccurs="0" maxOccurs="unbounded" /> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="when"> + <xs:complexType name="OutputDebugString"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> - <xs:attribute name="condition" type="Condition"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Condition expression.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="FilterResult"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Neutral" /> - <xs:enumeration value="Log" /> - <xs:enumeration value="Ignore" /> - <xs:enumeration value="LogFinal" /> - <xs:enumeration value="IgnoreFinal" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="whenContains"> + <xs:complexType name="PerfCounter"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" /> + <xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="autoCreate" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="categoryName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="counterHelp" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="substring" type="xs:string"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Substring to be matched.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="counterName" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the performance counter.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="counterType" type="System.Diagnostics.PerformanceCounterType"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Performance counter type.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="whenEqual"> - <xs:complexContent> - <xs:extension base="Filter"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="instanceName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Performance counter instance name.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="autoCreate" type="xs:boolean"> <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + <xs:documentation>Indicates whether performance counter should be automatically created.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="categoryName" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the performance counter category.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="compareTo" type="xs:string"> + <xs:attribute name="counterHelp" type="xs:string"> <xs:annotation> - <xs:documentation>String to compare the layout to.</xs:documentation> + <xs:documentation>Counter help text.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="whenNotContains"> + <xs:simpleType name="System.Diagnostics.PerformanceCounterType"> + <xs:restriction base="xs:string"> + <xs:enumeration value="NumberOfItems32" /> + <xs:enumeration value="NumberOfItems64" /> + <xs:enumeration value="NumberOfItemsHEX32" /> + <xs:enumeration value="NumberOfItemsHEX64" /> + <xs:enumeration value="RateOfCountsPerSecond32" /> + <xs:enumeration value="RateOfCountsPerSecond64" /> + <xs:enumeration value="CountPerTimeInterval32" /> + <xs:enumeration value="CountPerTimeInterval64" /> + <xs:enumeration value="RawFraction" /> + <xs:enumeration value="RawBase" /> + <xs:enumeration value="AverageTimer32" /> + <xs:enumeration value="AverageBase" /> + <xs:enumeration value="AverageCount64" /> + <xs:enumeration value="SampleFraction" /> + <xs:enumeration value="SampleCounter" /> + <xs:enumeration value="SampleBase" /> + <xs:enumeration value="CounterTimer" /> + <xs:enumeration value="CounterTimerInverse" /> + <xs:enumeration value="Timer100Ns" /> + <xs:enumeration value="Timer100NsInverse" /> + <xs:enumeration value="ElapsedTime" /> + <xs:enumeration value="CounterMultiTimer" /> + <xs:enumeration value="CounterMultiTimerInverse" /> + <xs:enumeration value="CounterMultiTimer100Ns" /> + <xs:enumeration value="CounterMultiTimer100NsInverse" /> + <xs:enumeration value="CounterMultiBase" /> + <xs:enumeration value="CounterDelta32" /> + <xs:enumeration value="CounterDelta64" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="PostFilteringWrapper"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="defaultFilter" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="when" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.Wrappers.FilteringRule" /> </xs:choice> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="substring" type="xs:string"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Substring to be matched.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + <xs:attribute name="defaultFilter" type="Condition"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Default filter to be applied when no specific rule matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="NLog.Targets.Wrappers.FilteringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="exists" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="filter" minOccurs="0" maxOccurs="1" type="Condition" /> + </xs:choice> + <xs:attribute name="exists" type="Condition"> + <xs:annotation> + <xs:documentation>Condition to be tested.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="filter" type="Condition"> + <xs:annotation> + <xs:documentation>Resulting filter to be applied when the condition matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="RandomizeGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="whenNotEqual"> + <xs:complexType name="RepeatingWrapper"> <xs:complexContent> - <xs:extension base="Filter"> + <xs:extension base="WrapperTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> - <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="repeatCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> </xs:choice> - <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="repeatCount" type="xs:integer"> <xs:annotation> - <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + <xs:documentation>Number of times to repeat each log message.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="action" type="FilterResult"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="RetryingWrapper"> + <xs:complexContent> + <xs:extension base="WrapperTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="retryDelayMilliseconds" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="retryCount" minOccurs="0" maxOccurs="1" type="xs:integer" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Action to be taken when filter matches.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="compareTo" type="xs:string"> + <xs:attribute name="retryDelayMilliseconds" type="xs:integer"> <xs:annotation> - <xs:documentation>String to compare the layout to.</xs:documentation> + <xs:documentation>Time to wait between retries in milliseconds.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="retryCount" type="xs:integer"> + <xs:annotation> + <xs:documentation>Number of retries that should be attempted on the wrapped target in case of a failure.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="MSMQ"> + <xs:complexType name="RichTextBox"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useXmlEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="recoverable" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="createQueueIfNotExists" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="label" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="queue" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="showMinimized" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="maxLines" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="width" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="toolWindow" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="autoScroll" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="height" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="word-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxWordColoringRule" /> + <xs:element name="useDefaultRowColoringRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="row-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxRowColoringRule" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useXmlEncoding" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to use the XML format when serializing message.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Encoding to be used when writing text to the queue.</xs:documentation> + <xs:documentation>Layout used to format log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="showMinimized" type="xs:boolean"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Indicates whether the created form will be initially minimized.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="recoverable" type="xs:boolean"> + <xs:attribute name="maxLines" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to use recoverable messages (with guaranteed delivery).</xs:documentation> + <xs:documentation>Maximum number of lines the rich text box will store (or 0 to disable this feature).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="createQueueIfNotExists" type="xs:boolean"> + <xs:attribute name="width" type="xs:integer"> <xs:annotation> - <xs:documentation>Indicates whether to create the queue if it doesn't exists.</xs:documentation> + <xs:documentation>Initial width of the form with rich text box.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="label" type="SimpleLayoutAttribute"> + <xs:attribute name="toolWindow" type="xs:boolean"> <xs:annotation> - <xs:documentation>Label to associate with each message.</xs:documentation> + <xs:documentation>Indicates whether the created window will be a tool window.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="queue" type="SimpleLayoutAttribute"> + <xs:attribute name="controlName" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the queue to write to.</xs:documentation> + <xs:documentation>Name of RichTextBox to which Nlog will write.</xs:documentation> </xs:annotation> </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="AspNetBufferingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="bufferGrowLimit" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="growBufferAsNeeded" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="bufferSize" minOccurs="0" maxOccurs="1" type="xs:integer" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="autoScroll" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether scroll bar will be moved automatically to show most recent log entries.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferGrowLimit" type="xs:integer"> + <xs:attribute name="height" type="xs:integer"> <xs:annotation> - <xs:documentation>Maximum number of log events that the buffer can keep.</xs:documentation> + <xs:documentation>Initial height of the form with rich text box.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="growBufferAsNeeded" type="xs:boolean"> + <xs:attribute name="formName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether buffer should grow as needed.</xs:documentation> + <xs:documentation>Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="bufferSize" type="xs:integer"> + <xs:attribute name="useDefaultRowColoringRules" type="xs:boolean"> <xs:annotation> - <xs:documentation>Number of log events to be buffered.</xs:documentation> + <xs:documentation>Indicates whether to use default coloring rules.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="AspNetTrace"> + <xs:simpleType name="System.Drawing.FontStyle"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Regular" /> + <xs:enumeration value="Bold" /> + <xs:enumeration value="Italic" /> + <xs:enumeration value="Underline" /> + <xs:enumeration value="Strikeout" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="NLog.Targets.RichTextBoxWordColoringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="regex" type="xs:string"> + <xs:annotation> + <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="text" type="xs:string"> + <xs:annotation> + <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="wholeWords" type="xs:boolean"> + <xs:annotation> + <xs:documentation>Indicates whether to match whole words only.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fontColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="style" type="System.Drawing.FontStyle"> + <xs:annotation> + <xs:documentation>Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="NLog.Targets.RichTextBoxRowColoringRule"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> + <xs:annotation> + <xs:documentation>Condition that must be met in order to set the specified font color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="backgroundColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Background color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="fontColor" type="xs:string"> + <xs:annotation> + <xs:documentation>Font color.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="style" type="System.Drawing.FontStyle"> + <xs:annotation> + <xs:documentation>Font style of matched text.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="RoundRobinGroup"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="CompoundTargetBase"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="SplitGroup"> + <xs:complexContent> + <xs:extension base="CompoundTargetBase"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="name" type="xs:string"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="AspResponse"> + <xs:complexType name="Trace"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="addComments" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> </xs:choice> <xs:attribute name="name" type="xs:string"> @@ -1806,11 +2279,6 @@ <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="addComments" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to add <!-- --> comments around all written texts.</xs:documentation> - </xs:annotation> - </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> <xs:documentation>Layout used to format log messages.</xs:documentation> @@ -1819,764 +2287,349 @@ </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="ColoredConsole"> + <xs:complexType name="WebService"> <xs:complexContent> <xs:extension base="Target"> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="useDefaultRowHighlightingRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="highlight-row" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleRowHighlightingRule" /> - <xs:element name="highlight-word" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.ConsoleWordHighlightingRule" /> - <xs:element name="errorStream" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> + <xs:element name="url" minOccurs="0" maxOccurs="1" type="xs:anyURI" /> + <xs:element name="namespace" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="protocol" minOccurs="0" maxOccurs="1" type="NLog.Targets.WebServiceProtocol" /> + <xs:element name="methodName" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> <xs:attribute name="name" type="xs:string"> <xs:annotation> <xs:documentation>Name of the target.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:attribute name="url" type="xs:anyURI"> <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> + <xs:documentation>Web service URL.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> + <xs:attribute name="namespace" type="xs:string"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Web service namespace.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> + <xs:attribute name="protocol" type="NLog.Targets.WebServiceProtocol"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> + <xs:documentation>Protocol to be used when calling web service.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useDefaultRowHighlightingRules" type="xs:boolean"> + <xs:attribute name="methodName" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether to use default row highlighting rules.</xs:documentation> + <xs:documentation>Web service method name.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="errorStream" type="xs:boolean"> + <xs:attribute name="encoding" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether the error stream (stderr) should be used instead of the output stream (stdout).</xs:documentation> + <xs:documentation>Encoding.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Targets.ConsoleOutputColor"> + <xs:simpleType name="NLog.Targets.WebServiceProtocol"> <xs:restriction base="xs:string"> - <xs:enumeration value="Black" /> - <xs:enumeration value="DarkBlue" /> - <xs:enumeration value="DarkGreen" /> - <xs:enumeration value="DarkCyan" /> - <xs:enumeration value="DarkRed" /> - <xs:enumeration value="DarkMagenta" /> - <xs:enumeration value="DarkYellow" /> - <xs:enumeration value="Gray" /> - <xs:enumeration value="DarkGray" /> - <xs:enumeration value="Blue" /> - <xs:enumeration value="Green" /> - <xs:enumeration value="Cyan" /> - <xs:enumeration value="Red" /> - <xs:enumeration value="Magenta" /> - <xs:enumeration value="Yellow" /> - <xs:enumeration value="White" /> - <xs:enumeration value="NoChange" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Targets.ConsoleRowHighlightingRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="condition" type="Condition"> - <xs:annotation> - <xs:documentation>Condition that must be met in order to set the specified foreground and background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Foreground color.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="NLog.Targets.ConsoleWordHighlightingRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="foregroundColor" minOccurs="0" maxOccurs="1" type="NLog.Targets.ConsoleOutputColor" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="foregroundColor" type="NLog.Targets.ConsoleOutputColor"> - <xs:annotation> - <xs:documentation>Foreground color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="regex" type="xs:string"> - <xs:annotation> - <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="wholeWords" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to match whole words only.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Debugger"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="footer" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Footer.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="header" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Header.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="EventLog"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="machineName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="source" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="category" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="eventId" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="log" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="machineName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the machine on which Event Log service is running.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="source" type="xs:string"> - <xs:annotation> - <xs:documentation>Value to be used as the event Source.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="category" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that renders event Category.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="eventId" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout that renders event ID.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="log" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the Event Log to write to. This can be System, Application or any user-defined name.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="FormControl"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="append" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="append" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether log text should be appended to the text of the control instead of overwriting it.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="controlName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of control to which NLog will log write log text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="formName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the Form on which the control is located.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:complexType name="ImpersonatingWrapper"> - <xs:complexContent> - <xs:extension base="WrapperTargetBase"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="userName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="password" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="revertToSelf" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="impersonationLevel" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityImpersonationLevel" /> - <xs:element name="domain" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="logOnType" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.SecurityLogOnType" /> - <xs:element name="logOnProvider" minOccurs="0" maxOccurs="1" type="NLog.Targets.Wrappers.LogOnProviderType" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="userName" type="xs:string"> - <xs:annotation> - <xs:documentation>Username to change context to.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="password" type="xs:string"> - <xs:annotation> - <xs:documentation>User account password.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="revertToSelf" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to revert to the credentials of the process instead of impersonating another user.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="impersonationLevel" type="NLog.Targets.Wrappers.SecurityImpersonationLevel"> - <xs:annotation> - <xs:documentation>Required impersonation level.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="domain" type="xs:string"> - <xs:annotation> - <xs:documentation>Windows domain name to change context to.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="logOnType" type="NLog.Targets.Wrappers.SecurityLogOnType"> - <xs:annotation> - <xs:documentation>Logon Type.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="logOnProvider" type="NLog.Targets.Wrappers.LogOnProviderType"> - <xs:annotation> - <xs:documentation>Type of the logon provider.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="NLog.Targets.Wrappers.SecurityImpersonationLevel"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Anonymous" /> - <xs:enumeration value="Identification" /> - <xs:enumeration value="Impersonation" /> - <xs:enumeration value="Delegation" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Targets.Wrappers.SecurityLogOnType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Interactive" /> - <xs:enumeration value="Network" /> - <xs:enumeration value="Batch" /> - <xs:enumeration value="Service" /> - <xs:enumeration value="NetworkClearText" /> - <xs:enumeration value="NewCredentials" /> - </xs:restriction> - </xs:simpleType> - <xs:simpleType name="NLog.Targets.Wrappers.LogOnProviderType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Default" /> + <xs:enumeration value="Soap11" /> + <xs:enumeration value="Soap12" /> + <xs:enumeration value="HttpPost" /> + <xs:enumeration value="HttpGet" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="Mail"> + <xs:complexType name="CsvLayout"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Layout"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="html" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="addNewLines" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="encoding" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="subject" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="to" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="bcc" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="cc" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="from" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="body" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpUserName" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="enableSsl" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="smtpPassword" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpAuthentication" minOccurs="0" maxOccurs="1" type="NLog.Targets.SmtpAuthenticationMode" /> - <xs:element name="smtpServer" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="smtpPort" minOccurs="0" maxOccurs="1" type="xs:integer" /> + <xs:element name="quoteChar" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="quoting" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvQuotingMode" /> + <xs:element name="withHeader" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="column" minOccurs="0" maxOccurs="unbounded" type="NLog.Layouts.CsvColumn" /> + <xs:element name="customColumnDelimiter" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="delimiter" minOccurs="0" maxOccurs="1" type="NLog.Layouts.CsvColumnDelimiterMode" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Header.</xs:documentation> + <xs:documentation>Header layout.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Footer.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="layout" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Text to be rendered.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="html" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to send message as HTML instead of plain text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="addNewLines" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to add new lines between log entries.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="encoding" type="xs:string"> - <xs:annotation> - <xs:documentation>Encoding to be used for sending e-mail.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="subject" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Mail subject.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="to" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Recipients' email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="bcc" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>BCC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="cc" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>CC email addresses separated by semicolons (e.g. john@domain.com;jane@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="from" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Sender's email address (e.g. joe@domain.com).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="body" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Mail message body (repeated for each log message send in one mail).</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="smtpUserName" type="SimpleLayoutAttribute"> - <xs:annotation> - <xs:documentation>Username used to connect to SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + <xs:documentation>Footer layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="enableSsl" type="xs:boolean"> + <xs:attribute name="quoteChar" type="xs:string"> <xs:annotation> - <xs:documentation>Indicates whether SSL (secure sockets layer) should be used when communicating with SMTP server.</xs:documentation> + <xs:documentation>Quote Character.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpPassword" type="SimpleLayoutAttribute"> + <xs:attribute name="quoting" type="NLog.Layouts.CsvQuotingMode"> <xs:annotation> - <xs:documentation>Password used to authenticate against SMTP server (used when SmtpAuthentication is set to "basic").</xs:documentation> + <xs:documentation>Quoting mode.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpAuthentication" type="NLog.Targets.SmtpAuthenticationMode"> + <xs:attribute name="withHeader" type="xs:boolean"> <xs:annotation> - <xs:documentation>SMTP Authentication mode.</xs:documentation> + <xs:documentation>Indicates whether CVS should include header.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpServer" type="SimpleLayoutAttribute"> + <xs:attribute name="customColumnDelimiter" type="xs:string"> <xs:annotation> - <xs:documentation>SMTP Server to be used for sending.</xs:documentation> + <xs:documentation>Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom').</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="smtpPort" type="xs:integer"> + <xs:attribute name="delimiter" type="NLog.Layouts.CsvColumnDelimiterMode"> <xs:annotation> - <xs:documentation>Port number that SMTP Server is listening on.</xs:documentation> + <xs:documentation>Column delimiter.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="NLog.Targets.SmtpAuthenticationMode"> + <xs:simpleType name="NLog.Layouts.CsvQuotingMode"> <xs:restriction base="xs:string"> - <xs:enumeration value="None" /> - <xs:enumeration value="Basic" /> - <xs:enumeration value="Ntlm" /> + <xs:enumeration value="All" /> + <xs:enumeration value="Nothing" /> + <xs:enumeration value="Auto" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="PerfCounter"> - <xs:complexContent> - <xs:extension base="Target"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="instanceName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterHelp" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterType" minOccurs="0" maxOccurs="1" type="System.Diagnostics.PerformanceCounterType" /> - <xs:element name="autoCreate" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="categoryName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="counterName" minOccurs="0" maxOccurs="1" type="xs:string" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="instanceName" type="xs:string"> - <xs:annotation> - <xs:documentation>Performance counter instance name.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterHelp" type="xs:string"> - <xs:annotation> - <xs:documentation>Counter help text.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterType" type="System.Diagnostics.PerformanceCounterType"> - <xs:annotation> - <xs:documentation>Performance counter type.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="autoCreate" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether performance counter should be automatically created.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="categoryName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the performance counter category.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="counterName" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the performance counter.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:extension> - </xs:complexContent> - </xs:complexType> - <xs:simpleType name="System.Diagnostics.PerformanceCounterType"> + <xs:simpleType name="NLog.Layouts.CsvColumnDelimiterMode"> <xs:restriction base="xs:string"> - <xs:enumeration value="NumberOfItems32" /> - <xs:enumeration value="NumberOfItems64" /> - <xs:enumeration value="NumberOfItemsHEX32" /> - <xs:enumeration value="NumberOfItemsHEX64" /> - <xs:enumeration value="RateOfCountsPerSecond32" /> - <xs:enumeration value="RateOfCountsPerSecond64" /> - <xs:enumeration value="CountPerTimeInterval32" /> - <xs:enumeration value="CountPerTimeInterval64" /> - <xs:enumeration value="RawFraction" /> - <xs:enumeration value="RawBase" /> - <xs:enumeration value="AverageTimer32" /> - <xs:enumeration value="AverageBase" /> - <xs:enumeration value="AverageCount64" /> - <xs:enumeration value="SampleFraction" /> - <xs:enumeration value="SampleCounter" /> - <xs:enumeration value="SampleBase" /> - <xs:enumeration value="CounterTimer" /> - <xs:enumeration value="CounterTimerInverse" /> - <xs:enumeration value="Timer100Ns" /> - <xs:enumeration value="Timer100NsInverse" /> - <xs:enumeration value="ElapsedTime" /> - <xs:enumeration value="CounterMultiTimer" /> - <xs:enumeration value="CounterMultiTimerInverse" /> - <xs:enumeration value="CounterMultiTimer100Ns" /> - <xs:enumeration value="CounterMultiTimer100NsInverse" /> - <xs:enumeration value="CounterMultiBase" /> - <xs:enumeration value="CounterDelta32" /> - <xs:enumeration value="CounterDelta64" /> + <xs:enumeration value="Auto" /> + <xs:enumeration value="Comma" /> + <xs:enumeration value="Semicolon" /> + <xs:enumeration value="Tab" /> + <xs:enumeration value="Pipe" /> + <xs:enumeration value="Space" /> + <xs:enumeration value="Custom" /> </xs:restriction> </xs:simpleType> - <xs:complexType name="RichTextBox"> + <xs:complexType name="NLog.Layouts.CsvColumn"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> + <xs:annotation> + <xs:documentation>Layout of the column.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="name" type="xs:string"> + <xs:annotation> + <xs:documentation>Name of the column.</xs:documentation> + </xs:annotation> + </xs:attribute> + </xs:complexType> + <xs:complexType name="LayoutWithHeaderAndFooter"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Layout"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="height" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="autoScroll" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="maxLines" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="showMinimized" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="toolWindow" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="controlName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="formName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="width" minOccurs="0" maxOccurs="1" type="xs:integer" /> - <xs:element name="word-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxWordColoringRule" /> - <xs:element name="useDefaultRowColoringRules" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="row-coloring" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.RichTextBoxRowColoringRule" /> - </xs:choice> - <xs:attribute name="name" type="xs:string"> - <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> - </xs:annotation> - </xs:attribute> + <xs:element name="header" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="footer" minOccurs="0" maxOccurs="1" type="Layout" /> + </xs:choice> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Body layout (can be repeated multiple times).</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="height" type="xs:integer"> + <xs:attribute name="header" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Initial height of the form with rich text box.</xs:documentation> + <xs:documentation>Header layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="autoScroll" type="xs:boolean"> + <xs:attribute name="footer" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether scroll bar will be moved automatically to show most recent log entries.</xs:documentation> + <xs:documentation>Footer layout.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="maxLines" type="xs:integer"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="Log4JXmlEventLayout"> + <xs:complexContent> + <xs:extension base="Layout"> + <xs:choice minOccurs="0" maxOccurs="unbounded" /> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="SimpleLayout"> + <xs:complexContent> + <xs:extension base="Layout"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="text" type="xs:string"> <xs:annotation> - <xs:documentation>Maximum number of lines the rich text box will store (or 0 to disable this feature).</xs:documentation> + <xs:documentation>Layout text.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="showMinimized" type="xs:boolean"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="when"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + </xs:choice> + <xs:attribute name="condition" type="Condition"> <xs:annotation> - <xs:documentation>Indicates whether the created form will be initially minimized.</xs:documentation> + <xs:documentation>Condition expression.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="toolWindow" type="xs:boolean"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Indicates whether the created window will be a tool window.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="controlName" type="xs:string"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:simpleType name="FilterResult"> + <xs:restriction base="xs:string"> + <xs:enumeration value="Neutral" /> + <xs:enumeration value="Log" /> + <xs:enumeration value="Ignore" /> + <xs:enumeration value="LogFinal" /> + <xs:enumeration value="IgnoreFinal" /> + </xs:restriction> + </xs:simpleType> + <xs:complexType name="whenContains"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + </xs:choice> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of RichTextBox to which Nlog will write.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="formName" type="xs:string"> + <xs:attribute name="substring" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the Form on which the control is located. If there is no open form of a specified name than NLog will create a new one.</xs:documentation> + <xs:documentation>Substring to be matched.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="width" type="xs:integer"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Initial width of the form with rich text box.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useDefaultRowColoringRules" type="xs:boolean"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to use default coloring rules.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:simpleType name="System.Drawing.FontStyle"> - <xs:restriction base="xs:string"> - <xs:enumeration value="Regular" /> - <xs:enumeration value="Bold" /> - <xs:enumeration value="Italic" /> - <xs:enumeration value="Underline" /> - <xs:enumeration value="Strikeout" /> - </xs:restriction> - </xs:simpleType> - <xs:complexType name="NLog.Targets.RichTextBoxWordColoringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="regex" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> - <xs:element name="text" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="wholeWords" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Background color. Names are identical with KnownColor enum extended with Empty value which means that background color won't be changed.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="fontColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Font color. Names are identical with KnownColor enum extended with Empty value which means that font color won't be changed.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="ignoreCase" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to ignore case when comparing texts.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="regex" type="xs:string"> - <xs:annotation> - <xs:documentation>Regular expression to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="style" type="System.Drawing.FontStyle"> - <xs:annotation> - <xs:documentation>Font style of matched text. Possible values are the same as in FontStyle enum in System.Drawing.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="text" type="xs:string"> - <xs:annotation> - <xs:documentation>Text to be matched. You must specify either text or regex.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="wholeWords" type="xs:boolean"> - <xs:annotation> - <xs:documentation>Indicates whether to match whole words only.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="NLog.Targets.RichTextBoxRowColoringRule"> - <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="backgroundColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="condition" minOccurs="0" maxOccurs="1" type="Condition" /> - <xs:element name="fontColor" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="style" minOccurs="0" maxOccurs="1" type="System.Drawing.FontStyle" /> - </xs:choice> - <xs:attribute name="backgroundColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Background color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="condition" type="Condition"> - <xs:annotation> - <xs:documentation>Condition that must be met in order to set the specified font color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="fontColor" type="xs:string"> - <xs:annotation> - <xs:documentation>Font color.</xs:documentation> - </xs:annotation> - </xs:attribute> - <xs:attribute name="style" type="System.Drawing.FontStyle"> - <xs:annotation> - <xs:documentation>Font style of matched text.</xs:documentation> - </xs:annotation> - </xs:attribute> - </xs:complexType> - <xs:complexType name="Trace"> + <xs:complexType name="whenEqual"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Filter"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Layout used to format log messages.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="action" type="FilterResult"> + <xs:annotation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="compareTo" type="xs:string"> + <xs:annotation> + <xs:documentation>String to compare the layout to.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> </xs:complexContent> </xs:complexType> - <xs:complexType name="LogReceiverService"> + <xs:complexType name="whenNotContains"> <xs:complexContent> - <xs:extension base="Target"> + <xs:extension base="Filter"> <xs:choice minOccurs="0" maxOccurs="unbounded"> - <xs:element name="name" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="endpointConfigurationName" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="endpointAddress" minOccurs="0" maxOccurs="1" type="xs:string" /> - <xs:element name="useBinaryEncoding" minOccurs="0" maxOccurs="1" type="xs:boolean" /> - <xs:element name="parameter" minOccurs="0" maxOccurs="unbounded" type="NLog.Targets.MethodCallParameter" /> - <xs:element name="clientId" minOccurs="0" maxOccurs="1" type="Layout" /> - <xs:element name="includeEventProperties" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="substring" minOccurs="0" maxOccurs="1" type="xs:string" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> </xs:choice> - <xs:attribute name="name" type="xs:string"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Name of the target.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="endpointConfigurationName" type="xs:string"> + <xs:attribute name="substring" type="xs:string"> <xs:annotation> - <xs:documentation>Name of the endpoint configuration in WCF configuration file.</xs:documentation> + <xs:documentation>Substring to be matched.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="endpointAddress" type="xs:string"> + <xs:attribute name="action" type="FilterResult"> <xs:annotation> - <xs:documentation>Endpoint address.</xs:documentation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="useBinaryEncoding" type="xs:boolean"> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Indicates whether to use binary message encoding.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="clientId" type="SimpleLayoutAttribute"> + </xs:extension> + </xs:complexContent> + </xs:complexType> + <xs:complexType name="whenNotEqual"> + <xs:complexContent> + <xs:extension base="Filter"> + <xs:choice minOccurs="0" maxOccurs="unbounded"> + <xs:element name="ignoreCase" minOccurs="0" maxOccurs="1" type="xs:boolean" /> + <xs:element name="layout" minOccurs="0" maxOccurs="1" type="Layout" /> + <xs:element name="action" minOccurs="0" maxOccurs="1" type="FilterResult" /> + <xs:element name="compareTo" minOccurs="0" maxOccurs="1" type="xs:string" /> + </xs:choice> + <xs:attribute name="ignoreCase" type="xs:boolean"> <xs:annotation> - <xs:documentation>Client ID.</xs:documentation> + <xs:documentation>Indicates whether to ignore case when comparing strings.</xs:documentation> </xs:annotation> </xs:attribute> - <xs:attribute name="includeEventProperties" type="xs:boolean"> + <xs:attribute name="layout" type="SimpleLayoutAttribute"> <xs:annotation> - <xs:documentation>Indicates whether to include per-event properties in the payload sent to the server.</xs:documentation> + <xs:documentation>Layout to be used to filter log messages.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="action" type="FilterResult"> + <xs:annotation> + <xs:documentation>Action to be taken when filter matches.</xs:documentation> + </xs:annotation> + </xs:attribute> + <xs:attribute name="compareTo" type="xs:string"> + <xs:annotation> + <xs:documentation>String to compare the layout to.</xs:documentation> </xs:annotation> </xs:attribute> </xs:extension> diff --git a/src/NzbDrone.Update/NzbDrone.Update.csproj b/src/NzbDrone.Update/NzbDrone.Update.csproj index 3aa8ea3a4..d09ab8021 100644 --- a/src/NzbDrone.Update/NzbDrone.Update.csproj +++ b/src/NzbDrone.Update/NzbDrone.Update.csproj @@ -42,11 +42,11 @@ <ItemGroup> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> diff --git a/src/NzbDrone.Update/packages.config b/src/NzbDrone.Update/packages.config index f145903f2..7dd376ea4 100644 --- a/src/NzbDrone.Update/packages.config +++ b/src/NzbDrone.Update/packages.config @@ -1,7 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <packages> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> - <package id="NLog.Config" version="2.0.1.2" targetFramework="net40" /> - <package id="NLog.Schema" version="2.0.1.2" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> + <package id="NLog.Schema" version="2.1.0" targetFramework="net40" /> </packages> \ No newline at end of file diff --git a/src/NzbDrone.sln b/src/NzbDrone.sln index f118155ff..d7333e186 100644 --- a/src/NzbDrone.sln +++ b/src/NzbDrone.sln @@ -1,5 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.21005.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{57A04B72-8088-4F75-A582-1158CF8291F7}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test.Common", "Test.Common", "{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}" @@ -58,6 +60,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{486ADF86-D EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.SignalR", "NzbDrone.SignalR\NzbDrone.SignalR.csproj", "{7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Automation.Test", "NzbDrone.Automation.Test\NzbDrone.Automation.Test.csproj", "{CC26800D-F67E-464B-88DE-8EB1A0C227A3}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -278,6 +282,16 @@ Global {7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}.Release|Mixed Platforms.Build.0 = Release|x86 {7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}.Release|x86.ActiveCfg = Release|x86 {7C2CC69F-5CA0-4E5C-85CB-983F9F6C3B36}.Release|x86.Build.0 = Release|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Debug|Any CPU.ActiveCfg = Debug|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Debug|Mixed Platforms.Build.0 = Debug|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Debug|x86.ActiveCfg = Debug|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Debug|x86.Build.0 = Debug|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Release|Any CPU.ActiveCfg = Release|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Release|Mixed Platforms.ActiveCfg = Release|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Release|Mixed Platforms.Build.0 = Release|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Release|x86.ActiveCfg = Release|x86 + {CC26800D-F67E-464B-88DE-8EB1A0C227A3}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -291,6 +305,7 @@ Global {D18A5DEB-5102-4775-A1AF-B75DAAA8907B} = {57A04B72-8088-4F75-A582-1158CF8291F7} {CBF6B8B0-A015-413A-8C86-01238BB45770} = {57A04B72-8088-4F75-A582-1158CF8291F7} {8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB} = {57A04B72-8088-4F75-A582-1158CF8291F7} + {CC26800D-F67E-464B-88DE-8EB1A0C227A3} = {57A04B72-8088-4F75-A582-1158CF8291F7} {FAFB5948-A222-4CF6-AD14-026BE7564802} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} {CADDFCE0-7509-4430-8364-2074E1EEFCA2} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} {6BCE712F-846D-4846-9D1B-A66B858DA755} = {F9E67978-5CD6-4A5F-827B-4249711C0B02} diff --git a/src/NzbDrone/NzbDrone.csproj b/src/NzbDrone/NzbDrone.csproj index f428eae7b..7111bc03a 100644 --- a/src/NzbDrone/NzbDrone.csproj +++ b/src/NzbDrone/NzbDrone.csproj @@ -81,11 +81,11 @@ </Reference> <Reference Include="Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net40\Newtonsoft.Json.dll</HintPath> + <HintPath>..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll</HintPath> </Reference> - <Reference Include="NLog, Version=2.0.1.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> + <Reference Include="NLog, Version=2.1.0.0, Culture=neutral, PublicKeyToken=5120e14c03d0593c, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\NLog.2.0.1.2\lib\net40\NLog.dll</HintPath> + <HintPath>..\packages\NLog.2.1.0\lib\net40\NLog.dll</HintPath> </Reference> <Reference Include="Owin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=f0ebd12fd5e55cc5, processorArchitecture=MSIL"> <SpecificVersion>False</SpecificVersion> diff --git a/src/NzbDrone/Properties/Resources.resx b/src/NzbDrone/Properties/Resources.resx index ad9178376..408bab357 100644 --- a/src/NzbDrone/Properties/Resources.resx +++ b/src/NzbDrone/Properties/Resources.resx @@ -119,6 +119,6 @@ </resheader> <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> <data name="NzbDroneIcon" type="System.Resources.ResXFileRef, System.Windows.Forms"> - <value>..\..\nzbdrone.host\nzbdrone.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> + <value>..\..\NzbDrone.Host\NzbDrone.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> </data> </root> \ No newline at end of file diff --git a/src/NzbDrone/packages.config b/src/NzbDrone/packages.config index 19f3a3d8b..8c5b8f6f8 100644 --- a/src/NzbDrone/packages.config +++ b/src/NzbDrone/packages.config @@ -4,7 +4,7 @@ <package id="Microsoft.AspNet.SignalR.Owin" version="1.1.3" targetFramework="net40" /> <package id="Microsoft.Owin" version="1.1.0-beta2" targetFramework="net40" /> <package id="Microsoft.Owin.Hosting" version="1.1.0-beta2" targetFramework="net40" /> - <package id="Newtonsoft.Json" version="5.0.6" targetFramework="net40" /> - <package id="NLog" version="2.0.1.2" targetFramework="net40" /> + <package id="Newtonsoft.Json" version="5.0.8" targetFramework="net40" /> + <package id="NLog" version="2.1.0" targetFramework="net40" /> <package id="Owin" version="1.0" targetFramework="net40" /> -</packages> \ No newline at end of file +</packages> diff --git a/src/UI/AddSeries/AddSeriesView.js b/src/UI/AddSeries/AddSeriesView.js index 1f96de134..179cc4a52 100644 --- a/src/UI/AddSeries/AddSeriesView.js +++ b/src/UI/AddSeries/AddSeriesView.js @@ -80,7 +80,7 @@ define( this.collection.reset(); if (!options.term || options.term === this.collection.term) { - return $.Deferred().resolve(); + return Marionette.$.Deferred().resolve(); } this.searchResult.show(new LoadingView()); diff --git a/src/UI/AddSeries/Existing/UnmappedFolderCollection.js b/src/UI/AddSeries/Existing/UnmappedFolderCollection.js index a6328a521..cbebd6af7 100644 --- a/src/UI/AddSeries/Existing/UnmappedFolderCollection.js +++ b/src/UI/AddSeries/Existing/UnmappedFolderCollection.js @@ -2,8 +2,9 @@ define( [ 'backbone', - 'AddSeries/Existing/UnmappedFolderModel' - ], function (Backbone, UnmappedFolderModel) { + 'AddSeries/Existing/UnmappedFolderModel', + 'underscore' + ], function (Backbone, UnmappedFolderModel,_) { return Backbone.Collection.extend({ model: UnmappedFolderModel, diff --git a/src/UI/AddSeries/SearchResultViewTemplate.html b/src/UI/AddSeries/SearchResultViewTemplate.html index 091c8bb35..5b64b09a9 100644 --- a/src/UI/AddSeries/SearchResultViewTemplate.html +++ b/src/UI/AddSeries/SearchResultViewTemplate.html @@ -1,4 +1,4 @@ -<div class="search-item {{#unless isExisting}}search-item-new{{/unless}}"> +<div class="search-item {{#unless isExisting}}search-item-new{{/unless}}"> <div class="row"> <div class="span2"> <a href="{{traktUrl}}" target="_blank"> @@ -9,7 +9,12 @@ <div class="span9"> <div class="row"> - <h2>{{titleWithYear}}</h2> + <h2 class="series-title"> + {{titleWithYear}} + {{#unless_eq status compare="continuing"}} + <span class="label label-important">Ended</span> + {{/unless_eq}} + </h2> </div> <div class="row new-series-overview x-overview"> {{overview}} diff --git a/src/UI/AddSeries/addSeries.less b/src/UI/AddSeries/addSeries.less index 6a4d0258d..1d36d9906 100644 --- a/src/UI/AddSeries/addSeries.less +++ b/src/UI/AddSeries/addSeries.less @@ -57,6 +57,13 @@ .search-item { + .series-title { + .label { + margin-left: 15px; + vertical-align: middle; + } + } + .new-series-overview { overflow : hidden; height : 120px; diff --git a/src/UI/Calendar/CalendarView.js b/src/UI/Calendar/CalendarView.js index 0d4422845..727c8f578 100644 --- a/src/UI/Calendar/CalendarView.js +++ b/src/UI/Calendar/CalendarView.js @@ -7,7 +7,7 @@ define( 'moment', 'Calendar/Collection', 'fullcalendar' - ], function (vent, Marionette, Moment, CalendarCollection) { + ], function (vent, Marionette, moment, CalendarCollection) { var _instance; @@ -16,7 +16,10 @@ define( this.collection = new CalendarCollection(); }, render : function () { - $(this.$el).empty().fullCalendar({ + + var self = this; + + this.$el.empty().fullCalendar({ defaultView : 'basicWeek', allDayDefault : false, ignoreTimezone: false, @@ -34,8 +37,8 @@ define( }, events : this.getEvents, eventRender : function (event, element) { - $(element).addClass(event.statusLevel); - $(element).children('.fc-event-inner').addClass(event.statusLevel); + self.$(element).addClass(event.statusLevel); + self.$(element).children('.fc-event-inner').addClass(event.statusLevel); }, eventClick : function (event) { vent.trigger(vent.Commands.ShowEpisodeDetails, {episode: event.model}); @@ -50,8 +53,8 @@ define( }, getEvents: function (start, end, callback) { - var startDate = Moment(start).toISOString(); - var endDate = Moment(end).toISOString(); + var startDate = moment(start).toISOString(); + var endDate = moment(end).toISOString(); _instance.collection.fetch({ data : { start: startDate, end: endDate }, @@ -61,7 +64,7 @@ define( var seriesTitle = element.get('series').title; var start = element.get('airDateUtc'); var runtime = element.get('series').runtime; - var end = Moment(start).add('minutes', runtime).toISOString(); + var end = moment(start).add('minutes', runtime).toISOString(); element.set({ @@ -83,9 +86,9 @@ define( getStatusLevel: function (element) { var hasFile = element.get('hasFile'); - var currentTime = Moment(); - var start = Moment(element.get('airDateUtc')); - var end = Moment(element.get('end')); + var currentTime = moment(); + var start = moment(element.get('airDateUtc')); + var end = moment(element.get('end')); var statusLevel = 'primary'; @@ -94,10 +97,6 @@ define( } else if (currentTime.isAfter(start) && currentTime.isBefore(end)) { - var s = start.toISOString(); - var e = end.toISOString(); - var c = currentTime.toISOString(); - statusLevel = 'warning'; } diff --git a/src/UI/Cells/EpisodeNumberCell.js b/src/UI/Cells/EpisodeNumberCell.js index 0daf55b81..41a034ba2 100644 --- a/src/UI/Cells/EpisodeNumberCell.js +++ b/src/UI/Cells/EpisodeNumberCell.js @@ -3,8 +3,9 @@ define( [ 'Cells/NzbDroneCell', - 'Shared/FormatHelpers' - ], function (NzbDroneCell, FormatHelpers) { + 'Shared/FormatHelpers', + 'underscore' + ], function (NzbDroneCell, FormatHelpers, _) { return NzbDroneCell.extend({ className: 'episode-number-cell', diff --git a/src/UI/Cells/NzbDroneCell.js b/src/UI/Cells/NzbDroneCell.js index e5e6c595e..15bd99e76 100644 --- a/src/UI/Cells/NzbDroneCell.js +++ b/src/UI/Cells/NzbDroneCell.js @@ -2,8 +2,9 @@ define( [ - 'backgrid' - ], function (Backgrid) { + 'backgrid', + 'backbone' + ], function (Backgrid, Backbone) { return Backgrid.Cell.extend({ _originalInit: Backgrid.Cell.prototype.initialize, @@ -15,8 +16,8 @@ define( this.listenTo(this.model, 'change', this._refresh); if (this._onEdit) { - this.listenTo(this.model, "backgrid:edit", function (model, column, cell, editor) { - if (column.get("name") == this.column.get("name")) { + this.listenTo(this.model, 'backgrid:edit', function (model, column, cell, editor) { + if (column.get('name') === this.column.get('name')) { this._onEdit(model, column, cell, editor); } }); diff --git a/src/UI/Cells/QualityProfileCell.js b/src/UI/Cells/QualityProfileCell.js index 292a1dd41..7cd6efd88 100644 --- a/src/UI/Cells/QualityProfileCell.js +++ b/src/UI/Cells/QualityProfileCell.js @@ -2,8 +2,9 @@ define( [ 'backgrid', - 'Quality/QualityProfileCollection' - ], function (Backgrid, QualityProfileCollection) { + 'Quality/QualityProfileCollection', + 'underscore' + ], function (Backgrid, QualityProfileCollection,_) { return Backgrid.Cell.extend({ className: 'quality-profile-cell', diff --git a/src/UI/Config.js b/src/UI/Config.js index f1bbf757c..7721fa79f 100644 --- a/src/UI/Config.js +++ b/src/UI/Config.js @@ -18,7 +18,7 @@ define( getValue: function (key, defaultValue) { - var storeValue = localStorage.getItem(key); + var storeValue = window.localStorage.getItem(key); if (!storeValue) { return defaultValue; @@ -35,7 +35,7 @@ define( return; } - localStorage.setItem(key, value); + window.localStorage.setItem(key, value); vent.trigger(this.Events.ConfigUpdatedEvent, {key: key, value: value}); } diff --git a/src/UI/Controller.js b/src/UI/Controller.js index ff9dec7ef..bd5be1819 100644 --- a/src/UI/Controller.js +++ b/src/UI/Controller.js @@ -9,7 +9,7 @@ define( 'AddSeries/AddSeriesLayout', 'Missing/MissingLayout', 'Calendar/CalendarLayout', - 'Release/Layout', + 'Release/ReleaseLayout', 'System/SystemLayout', 'SeasonPass/SeasonPassLayout', 'System/Update/UpdateLayout' @@ -29,49 +29,49 @@ define( addSeries: function (action) { this.setTitle('Add Series'); - AppLayout.mainRegion.show(new AddSeriesLayout({action: action})); + this.showMainRegion(new AddSeriesLayout({action: action})); }, calendar: function () { this.setTitle('Calendar'); - AppLayout.mainRegion.show(new CalendarLayout()); + this.showMainRegion(new CalendarLayout()); }, settings: function (action) { this.setTitle('Settings'); - AppLayout.mainRegion.show(new SettingsLayout({ action: action })); + this.showMainRegion(new SettingsLayout({ action: action })); }, missing: function () { this.setTitle('Missing'); - AppLayout.mainRegion.show(new MissingLayout()); + this.showMainRegion(new MissingLayout()); }, history: function (action) { this.setTitle('History'); - AppLayout.mainRegion.show(new HistoryLayout({ action: action })); + this.showMainRegion(new HistoryLayout({ action: action })); }, rss: function () { this.setTitle('RSS'); - AppLayout.mainRegion.show(new ReleaseLayout()); + this.showMainRegion(new ReleaseLayout()); }, system: function (action) { this.setTitle('System'); - AppLayout.mainRegion.show(new SystemLayout({ action: action })); + this.showMainRegion(new SystemLayout({ action: action })); }, seasonPass: function () { this.setTitle('Season Pass'); - AppLayout.mainRegion.show(new SeasonPassLayout()); + this.showMainRegion(new SeasonPassLayout()); }, update: function () { this.setTitle('Updates'); - AppLayout.mainRegion.show(new UpdateLayout()); + this.showMainRegion(new UpdateLayout()); } }); }); diff --git a/src/UI/Episode/Search/EpisodeSearchLayout.js b/src/UI/Episode/Search/EpisodeSearchLayout.js index f527ec038..20767ebd1 100644 --- a/src/UI/Episode/Search/EpisodeSearchLayout.js +++ b/src/UI/Episode/Search/EpisodeSearchLayout.js @@ -5,7 +5,7 @@ define( 'marionette', 'Episode/Search/ButtonsView', 'Episode/Search/ManualLayout', - 'Release/Collection', + 'Release/ReleaseCollection', 'Series/SeriesCollection', 'Commands/CommandController', 'Shared/LoadingView' diff --git a/src/UI/Form/FormBuilder.js b/src/UI/Form/FormBuilder.js index c0d4535ff..bb391f162 100644 --- a/src/UI/Form/FormBuilder.js +++ b/src/UI/Form/FormBuilder.js @@ -1,8 +1,10 @@ 'use strict'; define( [ - 'handlebars' - ], function (Handlebars) { + 'marionette', + 'handlebars', + 'underscore' + ], function (Marionette, Handlebars, _) { var _fieldBuilder = function (field) { if (!field.type) { diff --git a/src/UI/Instrumentation/ErrorHandler.js b/src/UI/Instrumentation/ErrorHandler.js index 92ccd4db1..d55c10735 100644 --- a/src/UI/Instrumentation/ErrorHandler.js +++ b/src/UI/Instrumentation/ErrorHandler.js @@ -4,6 +4,10 @@ window.Messenger().post(message); }; + var addError = function(message){ + window.$('#errors').append('<div>' + message + '</div>'); + }; + window.onerror = function (msg, url, line) { try { @@ -28,6 +32,8 @@ window.Messenger().post(message); + addError(message.message); + } catch (error) { console.log('An error occurred while reporting error. ' + error); @@ -38,7 +44,7 @@ return false; //don't suppress default alerts and logs. }; - $(document).ajaxError(function (event, xmlHttpRequest, ajaxOptions) { + window.$(document).ajaxError(function (event, xmlHttpRequest, ajaxOptions) { //don't report 200 error codes if (xmlHttpRequest.status >= 200 && xmlHttpRequest.status <= 300) { @@ -58,22 +64,23 @@ if (xmlHttpRequest.status === 0 && xmlHttpRequest.readyState === 0) { return false; - //message.message = 'NzbDrone Server Not Reachable. make sure NzbDrone is running.'; } - else if (xmlHttpRequest.status === 400 && ajaxOptions.isValidatedCall) { + + if (xmlHttpRequest.status === 400 && ajaxOptions.isValidatedCall) { return false; } - else if (xmlHttpRequest.status === 503) { + if (xmlHttpRequest.status === 503) { message.message = xmlHttpRequest.responseJSON.message; } - else - { + else { message.message = '[{0}] {1} : {2}'.format(ajaxOptions.type, xmlHttpRequest.statusText, ajaxOptions.url); } window.Messenger().post(message); + addError(message.message); + return false; }); diff --git a/src/UI/JsLibraries/backbone.deep.model.js b/src/UI/JsLibraries/backbone.deep.model.js index cbea78c52..7d65d8802 100644 --- a/src/UI/JsLibraries/backbone.deep.model.js +++ b/src/UI/JsLibraries/backbone.deep.model.js @@ -1,3 +1,124 @@ +/*jshint expr:true eqnull:true */ +/** + * + * Backbone.DeepModel v0.10.4 + * + * Copyright (c) 2013 Charles Davison, Pow Media Ltd + * + * https://github.com/powmedia/backbone-deep-model + * Licensed under the MIT License + */ + +/** + * Underscore mixins for deep objects + * + * Based on https://gist.github.com/echong/3861963 + */ +(function() { + var arrays, basicObjects, deepClone, deepExtend, deepExtendCouple, isBasicObject, + __slice = [].slice; + + deepClone = function(obj) { + var func, isArr; + if (!_.isObject(obj) || _.isFunction(obj)) { + return obj; + } + if (obj instanceof Backbone.Collection || obj instanceof Backbone.Model) { + return obj; + } + if (_.isDate(obj)) { + return new Date(obj.getTime()); + } + if (_.isRegExp(obj)) { + return new RegExp(obj.source, obj.toString().replace(/.*\//, "")); + } + isArr = _.isArray(obj || _.isArguments(obj)); + func = function(memo, value, key) { + if (isArr) { + memo.push(deepClone(value)); + } else { + memo[key] = deepClone(value); + } + return memo; + }; + return _.reduce(obj, func, isArr ? [] : {}); + }; + + isBasicObject = function(object) { + if (object == null) return false; + return (object.prototype === {}.prototype || object.prototype === Object.prototype) && _.isObject(object) && !_.isArray(object) && !_.isFunction(object) && !_.isDate(object) && !_.isRegExp(object) && !_.isArguments(object); + }; + + basicObjects = function(object) { + return _.filter(_.keys(object), function(key) { + return isBasicObject(object[key]); + }); + }; + + arrays = function(object) { + return _.filter(_.keys(object), function(key) { + return _.isArray(object[key]); + }); + }; + + deepExtendCouple = function(destination, source, maxDepth) { + var combine, recurse, sharedArrayKey, sharedArrayKeys, sharedObjectKey, sharedObjectKeys, _i, _j, _len, _len1; + if (maxDepth == null) { + maxDepth = 20; + } + if (maxDepth <= 0) { + console.warn('_.deepExtend(): Maximum depth of recursion hit.'); + return _.extend(destination, source); + } + sharedObjectKeys = _.intersection(basicObjects(destination), basicObjects(source)); + recurse = function(key) { + return source[key] = deepExtendCouple(destination[key], source[key], maxDepth - 1); + }; + for (_i = 0, _len = sharedObjectKeys.length; _i < _len; _i++) { + sharedObjectKey = sharedObjectKeys[_i]; + recurse(sharedObjectKey); + } + sharedArrayKeys = _.intersection(arrays(destination), arrays(source)); + combine = function(key) { + return source[key] = _.union(destination[key], source[key]); + }; + for (_j = 0, _len1 = sharedArrayKeys.length; _j < _len1; _j++) { + sharedArrayKey = sharedArrayKeys[_j]; + combine(sharedArrayKey); + } + return _.extend(destination, source); + }; + + deepExtend = function() { + var finalObj, maxDepth, objects, _i; + objects = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), maxDepth = arguments[_i++]; + if (!_.isNumber(maxDepth)) { + objects.push(maxDepth); + maxDepth = 20; + } + if (objects.length <= 1) { + return objects[0]; + } + if (maxDepth <= 0) { + return _.extend.apply(this, objects); + } + finalObj = objects.shift(); + while (objects.length > 0) { + finalObj = deepExtendCouple(finalObj, deepClone(objects.shift()), maxDepth); + } + return finalObj; + }; + + _.mixin({ + deepClone: deepClone, + isBasicObject: isBasicObject, + basicObjects: basicObjects, + arrays: arrays, + deepExtend: deepExtend + }); + +}).call(this); + /** * Main source */ @@ -208,15 +329,11 @@ //<custom code> var separator = DeepModel.keyPathSeparator; - var alreadyTriggered = {}; // * @restorer for (var i = 0, l = changes.length; i < l; i++) { var key = changes[i]; - if (!alreadyTriggered.hasOwnProperty(key) || !alreadyTriggered[key]) { // * @restorer - alreadyTriggered[key] = true; // * @restorer - this.trigger('change:' + key, this, getNested(current, key), options); - } // * @restorer + this.trigger('change:' + key, this, getNested(current, key), options); var fields = key.split(separator); @@ -225,17 +342,7 @@ var parentKey = _.first(fields, n).join(separator), wildcardKey = parentKey + separator + '*'; - if (!alreadyTriggered.hasOwnProperty(wildcardKey) || !alreadyTriggered[wildcardKey]) { // * @restorer - alreadyTriggered[wildcardKey] = true; // * @restorer - this.trigger('change:' + wildcardKey, this, getNested(current, parentKey), options); - } // * @restorer - - // + @restorer - if (!alreadyTriggered.hasOwnProperty(parentKey) || !alreadyTriggered[parentKey]) { - alreadyTriggered[parentKey] = true; - this.trigger('change:' + parentKey, this, getNested(current, parentKey), options); - } - // - @restorer + this.trigger('change:' + wildcardKey, this, getNested(current, parentKey), options); } //</custom code> } diff --git a/src/UI/LifeCycle.js b/src/UI/LifeCycle.js new file mode 100644 index 000000000..919f27fba --- /dev/null +++ b/src/UI/LifeCycle.js @@ -0,0 +1,6 @@ +'use strict'; +define(function () { + window.onbeforeunload = function () { + window.NzbDrone.unloading = true; + }; +}); diff --git a/src/UI/Mixins/AutoComplete.js b/src/UI/Mixins/AutoComplete.js index 7903cef05..a80610313 100644 --- a/src/UI/Mixins/AutoComplete.js +++ b/src/UI/Mixins/AutoComplete.js @@ -1,6 +1,6 @@ 'use strict'; -define(function () { +define(['jquery'],function ($) { $.fn.autoComplete = function (resource) { $(this).typeahead({ diff --git a/src/UI/Mixins/underscore.mixin.deepExtend.js b/src/UI/Mixins/underscore.mixin.deepExtend.js deleted file mode 100644 index 70596a584..000000000 --- a/src/UI/Mixins/underscore.mixin.deepExtend.js +++ /dev/null @@ -1,122 +0,0 @@ -/** - * Underscore mixins for deep objects - * - * Based on https://gist.github.com/echong/3861963 - */ -define( - [ - 'underscore' - ], function (_) { - - var arrays, basicObjects, deepClone, deepExtend, deepExtendCouple, isBasicObject, __slice = - [ - ].slice; - - deepClone = function (obj) { - var func, isArr; - if (!_.isObject(obj) || _.isFunction(obj)) { - return obj; - } - if (obj instanceof Backbone.Collection || obj instanceof Backbone.Model) { - return obj; - } - if (_.isDate(obj)) { - return new Date(obj.getTime()); - } - if (_.isRegExp(obj)) { - return new RegExp(obj.source, obj.toString().replace(/.*\//, '')); - } - isArr = _.isArray(obj || _.isArguments(obj)); - func = function (memo, value, key) { - if (isArr) { - memo.push(deepClone(value)); - } - else { - memo[key] = deepClone(value); - } - return memo; - }; - return _.reduce(obj, func, isArr ? - [ - ] :{}); - }; - - isBasicObject = function (object) { - if (object == null) { - return false; - } - return (object.prototype === {}.prototype || object.prototype === Object.prototype) && _.isObject(object) && !_.isArray(object) && !_.isFunction(object) && !_.isDate(object) && !_.isRegExp(object) && !_.isArguments(object); - }; - - basicObjects = function (object) { - return _.filter(_.keys(object), function (key) { - return isBasicObject(object[key]); - }); - }; - - arrays = function (object) { - return _.filter(_.keys(object), function (key) { - return _.isArray(object[key]); - }); - }; - - deepExtendCouple = function (destination, source, maxDepth) { - var combine, recurse, sharedArrayKey, sharedArrayKeys, sharedObjectKey, sharedObjectKeys, _i, _j, _len, _len1; - if (maxDepth == null) { - maxDepth = 20; - } - if (maxDepth <= 0) { - console.warn('_.deepExtend(): Maximum depth of recursion hit.'); - return _.extend(destination, source); - } - sharedObjectKeys = _.intersection(basicObjects(destination), basicObjects(source)); - recurse = function (key) { - return source[key] = deepExtendCouple(destination[key], source[key], maxDepth - 1); - }; - for (_i = 0, _len = sharedObjectKeys.length; _i < _len; _i++) { - sharedObjectKey = sharedObjectKeys[_i]; - recurse(sharedObjectKey); - } - sharedArrayKeys = _.intersection(arrays(destination), arrays(source)); - combine = function (key) { - return source[key] = _.union(destination[key], source[key]); - }; - for (_j = 0, _len1 = sharedArrayKeys.length; _j < _len1; _j++) { - sharedArrayKey = sharedArrayKeys[_j]; - combine(sharedArrayKey); - } - return _.extend(destination, source); - }; - - deepExtend = function () { - var finalObj, maxDepth, objects, _i; - objects = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) :(_i = 0, - [ - ]), maxDepth = arguments[_i++]; - if (!_.isNumber(maxDepth)) { - objects.push(maxDepth); - maxDepth = 20; - } - if (objects.length <= 1) { - return objects[0]; - } - if (maxDepth <= 0) { - return _.extend.apply(this, objects); - } - finalObj = objects.shift(); - while (objects.length > 0) { - finalObj = deepExtendCouple(finalObj, deepClone(objects.shift()), maxDepth); - } - return finalObj; - }; - - - _.mixin({ - deepClone : deepClone, - isBasicObject: isBasicObject, - basicObjects : basicObjects, - arrays : arrays, - deepExtend : deepExtend - }); - }); - diff --git a/src/UI/Navbar/NavbarView.js b/src/UI/Navbar/NavbarView.js index 85ca28cb6..b44a13562 100644 --- a/src/UI/Navbar/NavbarView.js +++ b/src/UI/Navbar/NavbarView.js @@ -2,10 +2,11 @@ define( [ 'marionette', + 'jquery', 'Navbar/Search' - ], function (Marionette) { + ], function (Marionette, $) { return Marionette.ItemView.extend({ - template : 'Navbar/NavbarTemplate', + template: 'Navbar/NavbarTemplate', ui: { search: '.x-series-search' @@ -15,7 +16,7 @@ define( 'click a': 'onClick' }, - onRender: function (){ + onRender: function () { this.ui.search.bindSearch(); }, diff --git a/src/UI/Quality/QualitySizeCollection.js b/src/UI/Quality/QualitySizeCollection.js index b29fc62f7..92c580647 100644 --- a/src/UI/Quality/QualitySizeCollection.js +++ b/src/UI/Quality/QualitySizeCollection.js @@ -1,8 +1,9 @@ 'use strict'; define( [ + 'backbone', 'Quality/QualitySizeModel' - ], function (QualitySizeModel) { + ], function (Backbone, QualitySizeModel) { return Backbone.Collection.extend({ model: QualitySizeModel, url : window.NzbDrone.ApiRoot + '/qualitysize' diff --git a/src/UI/Release/DownloadReportCell.js b/src/UI/Release/DownloadReportCell.js index a9a1c7a3e..75ff71b20 100644 --- a/src/UI/Release/DownloadReportCell.js +++ b/src/UI/Release/DownloadReportCell.js @@ -22,21 +22,22 @@ define( var self = this; this.$el.html('<i class="icon-spinner icon-spin" />'); - var promise = this.model.save(); - promise.done(function () { - self.$el.html('<i class="icon-ok" title="Added to downloaded queue" />'); - }); - - promise.fail(function () { - self.$el.html('<i class="icon-download-alt" title="Add to download queue" />'); - }); + //Using success callback instead of promise so it + //gets called before the sync event is triggered + this.model.save(null, { success: function () { + self.model.set('queued', true); + }}); }, render: function () { this.$el.empty(); - if (this.model.get('downloadAllowed')) + if (this.model.get('queued')) { + this.$el.html('<i class="icon-nd-downloading" title="Added to downloaded queue" />'); + } + + else if (this.model.get('downloadAllowed')) { this.$el.html('<i class="icon-download-alt" title="Add to download queue" />'); } diff --git a/src/UI/Release/Collection.js b/src/UI/Release/ReleaseCollection.js similarity index 79% rename from src/UI/Release/Collection.js rename to src/UI/Release/ReleaseCollection.js index fb2a2ec63..c53ddccb7 100644 --- a/src/UI/Release/Collection.js +++ b/src/UI/Release/ReleaseCollection.js @@ -2,7 +2,7 @@ define( [ 'backbone', - 'Release/Model' + 'Release/ReleaseModel' ], function (Backbone, ReleaseModel) { return Backbone.Collection.extend({ url : window.NzbDrone.ApiRoot + '/release', @@ -13,7 +13,7 @@ define( }, fetchEpisodeReleases: function (episodeId) { - return this.fetch({ data: { episodeId: episodeId }}); + return this.fetch({ data: { episodeId: episodeId }}); } }); }); diff --git a/src/UI/Release/Layout.js b/src/UI/Release/ReleaseLayout.js similarity index 87% rename from src/UI/Release/Layout.js rename to src/UI/Release/ReleaseLayout.js index 05fd8e30b..8a427e283 100644 --- a/src/UI/Release/Layout.js +++ b/src/UI/Release/ReleaseLayout.js @@ -3,7 +3,7 @@ define( [ 'marionette', 'backgrid', - 'Release/Collection', + 'Release/ReleaseCollection', 'Cells/IndexerCell', 'Cells/EpisodeNumberCell', 'Cells/FileSizeCell', @@ -12,7 +12,7 @@ define( 'Shared/LoadingView' ], function (Marionette, Backgrid, ReleaseCollection, IndexerCell, EpisodeNumberCell, FileSizeCell, QualityCell, ApprovalStatusCell, LoadingView) { return Marionette.Layout.extend({ - template: 'Release/LayoutTemplate', + template: 'Release/ReleaseLayoutTemplate', regions: { grid : '#x-grid', @@ -27,7 +27,6 @@ define( sortable: true, cell : IndexerCell }, - { name : 'title', label : 'Title', @@ -52,7 +51,6 @@ define( sortable: true, cell : QualityCell }, - { name : 'rejections', label: '', @@ -60,7 +58,17 @@ define( } ], - showTable: function () { + initialize: function () { + this.collection = new ReleaseCollection(); + this.listenTo(this.collection, 'sync', this._showTable); + }, + + onRender: function () { + this.grid.show(new LoadingView()); + this.collection.fetch(); + }, + + _showTable: function () { if (!this.isClosed) { this.grid.show(new Backgrid.Grid({ row : Backgrid.Row, @@ -69,23 +77,6 @@ define( className : 'table table-hover' })); } - }, - - initialize: function () { - this.collection = new ReleaseCollection(); - this.fetchPromise = this.collection.fetch(); - }, - - onShow: function () { - - var self = this; - - this.grid.show(new LoadingView()); - - this.fetchPromise.done(function () { - self.showTable(); - }); } - }); }); diff --git a/src/UI/Release/LayoutTemplate.html b/src/UI/Release/ReleaseLayoutTemplate.html similarity index 100% rename from src/UI/Release/LayoutTemplate.html rename to src/UI/Release/ReleaseLayoutTemplate.html diff --git a/src/UI/Release/Model.js b/src/UI/Release/ReleaseModel.js similarity index 100% rename from src/UI/Release/Model.js rename to src/UI/Release/ReleaseModel.js diff --git a/src/UI/Require/require.api.js b/src/UI/Require/require.api.js index e3d855279..920cb76b0 100644 --- a/src/UI/Require/require.api.js +++ b/src/UI/Require/require.api.js @@ -1,9 +1,12 @@ -define(function () { +define( + [ + 'jquery' + ], function ($) { 'use strict'; return { load: function (name, parentRequire, onload, config) { - if(config.isBuild){ + if (config.isBuild) { return onload(); } @@ -19,7 +22,7 @@ define(function () { xhr : xhr, status: status, error : error}); - }); + }); } }; }); diff --git a/src/UI/SeasonPass/SeriesLayout.js b/src/UI/SeasonPass/SeriesLayout.js index 828f25341..b4e6d3bff 100644 --- a/src/UI/SeasonPass/SeriesLayout.js +++ b/src/UI/SeasonPass/SeriesLayout.js @@ -112,13 +112,13 @@ define( var element; if (e.target.localName === 'i') { - seasonNumber = parseInt($(e.target).parent('td').attr('data-season-number'), 10); - element = $(e.target); + seasonNumber = parseInt(this.$(e.target).parent('td').attr('data-season-number'), 10); + element = this.$(e.target); } else { - seasonNumber = parseInt($(e.target).attr('data-season-number'), 10); - element = $(e.target).children('i'); + seasonNumber = parseInt(this.$(e.target).attr('data-season-number'), 10); + element = this.$(e.target).children('i'); } this.model.setSeasonMonitored(seasonNumber); @@ -146,7 +146,7 @@ define( } }, - _toggleSeriesMonitored: function (e) { + _toggleSeriesMonitored: function () { var savePromise = this.model.save('monitored', !this.model.get('monitored'), { wait: true }); diff --git a/src/UI/Series/Details/InfoViewTemplate.html b/src/UI/Series/Details/InfoViewTemplate.html index 5c3753ea0..bef8be3df 100644 --- a/src/UI/Series/Details/InfoViewTemplate.html +++ b/src/UI/Series/Details/InfoViewTemplate.html @@ -2,6 +2,12 @@ <span class="label label-info">{{network}}</span> <span class="label label-info">{{runtime}} minutes</span> <span class="label label-info">{{path}}</span> +{{#if_eq status compare="continuing"}} + <span class="label label-info">Continuing</span> +{{else}} + <span class="label">Ended</span> +{{/if_eq}} + <span class="pull-right"> <a href="{{traktUrl}}" class="label label-info">Trakt</a> diff --git a/src/UI/Series/Details/SeriesDetailsLayout.js b/src/UI/Series/Details/SeriesDetailsLayout.js index e2b4ce627..b04aa0aa9 100644 --- a/src/UI/Series/Details/SeriesDetailsLayout.js +++ b/src/UI/Series/Details/SeriesDetailsLayout.js @@ -1,6 +1,7 @@ 'use strict'; define( [ + 'jquery', 'vent', 'reqres', 'marionette', @@ -15,7 +16,7 @@ define( 'underscore', 'backstrech', 'Mixins/backbone.signalr.mixin' - ], function (vent,reqres, Marionette, Backbone, EpisodeCollection, EpisodeFileCollection, SeasonCollection, SeasonCollectionView, InfoView, CommandController, LoadingView, _) { + ], function ($,vent,reqres, Marionette, Backbone, EpisodeCollection, EpisodeFileCollection, SeasonCollection, SeasonCollectionView, InfoView, CommandController, LoadingView, _) { return Marionette.Layout.extend({ itemViewContainer: '.x-series-seasons', diff --git a/src/UI/Series/EpisodeCollection.js b/src/UI/Series/EpisodeCollection.js index 3bd6d9979..8c72b2440 100644 --- a/src/UI/Series/EpisodeCollection.js +++ b/src/UI/Series/EpisodeCollection.js @@ -54,7 +54,7 @@ define( options = {}; } - options['data'] = { seriesId: this.seriesId }; + options.data = { seriesId: this.seriesId }; return this.originalFetch.call(this, options); } diff --git a/src/UI/Series/EpisodeFileCollection.js b/src/UI/Series/EpisodeFileCollection.js index 5cd65aaad..42472d0ed 100644 --- a/src/UI/Series/EpisodeFileCollection.js +++ b/src/UI/Series/EpisodeFileCollection.js @@ -23,7 +23,7 @@ define( options = {}; } - options['data'] = { seriesId: this.seriesId }; + options.data = { seriesId: this.seriesId }; return this.originalFetch.call(this, options); } diff --git a/src/UI/Series/Index/SeriesIndexLayout.js b/src/UI/Series/Index/SeriesIndexLayout.js index 704e7f725..6a78e0754 100644 --- a/src/UI/Series/Index/SeriesIndexLayout.js +++ b/src/UI/Series/Index/SeriesIndexLayout.js @@ -2,6 +2,7 @@ define( [ 'marionette', + 'backgrid', 'Series/Index/Posters/CollectionView', 'Series/Index/List/CollectionView', 'Series/Index/EmptyView', @@ -16,8 +17,10 @@ define( 'Cells/SeriesStatusCell', 'Series/Index/FooterView', 'Series/Index/FooterModel', - 'Shared/Toolbar/ToolbarLayout' + 'Shared/Toolbar/ToolbarLayout', + 'underscore' ], function (Marionette, + Backgrid, PosterCollectionView, ListCollectionView, EmptyView, @@ -32,7 +35,8 @@ define( SeriesStatusCell, FooterView, FooterModel, - ToolbarLayout) { + ToolbarLayout, + _) { return Marionette.Layout.extend({ template: 'Series/Index/SeriesIndexLayoutTemplate', diff --git a/src/UI/ServerStatus.js b/src/UI/ServerStatus.js index 589d45fc6..95e1fd968 100644 --- a/src/UI/ServerStatus.js +++ b/src/UI/ServerStatus.js @@ -1,6 +1,6 @@ window.NzbDrone.ApiRoot = '/api'; -var statusText = $.ajax({ +var statusText = window.$.ajax({ type : 'GET', url : window.NzbDrone.ApiRoot + '/system/status', async: false, @@ -13,10 +13,13 @@ window.NzbDrone.ServerStatus = JSON.parse(statusText); var footerText = window.NzbDrone.ServerStatus.version; -$(document).ready(function () { - if (window.NzbDrone.ServerStatus.branch != 'master') { +window.$(document).ready(function () { + if (window.NzbDrone.ServerStatus.branch !== 'master') { footerText += '</br>' + window.NzbDrone.ServerStatus.branch; } - $('#footer-region .version').html(footerText); + window.$('#footer-region .version').html(footerText); }); + + + diff --git a/src/UI/Settings/SettingsLayout.js b/src/UI/Settings/SettingsLayout.js index f03ac5416..20ae6912d 100644 --- a/src/UI/Settings/SettingsLayout.js +++ b/src/UI/Settings/SettingsLayout.js @@ -83,7 +83,7 @@ define( this.indexerSettings = new IndexerCollection(); this.notificationSettings = new NotificationCollection(); - $.when(this.settings.fetch(), + Backbone.$.when(this.settings.fetch(), this.generalSettings.fetch(), this.namingSettings.fetch(), this.indexerSettings.fetch(), diff --git a/src/UI/Shared/FormatHelpers.js b/src/UI/Shared/FormatHelpers.js index c29e1606a..badfc18f3 100644 --- a/src/UI/Shared/FormatHelpers.js +++ b/src/UI/Shared/FormatHelpers.js @@ -51,7 +51,7 @@ define( return ''; } - return input.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ","); + return input.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); } - } + }; }); diff --git a/src/UI/Shared/Grid/Pager.js b/src/UI/Shared/Grid/Pager.js index 7ddfe4ab5..e230f8d1d 100644 --- a/src/UI/Shared/Grid/Pager.js +++ b/src/UI/Shared/Grid/Pager.js @@ -1,8 +1,9 @@ 'use strict'; define( [ + 'marionette', 'backgrid.paginator' - ], function (Paginator) { + ], function (Marionette, Paginator) { return Paginator.extend({ @@ -24,7 +25,7 @@ define( changePage: function (e) { e.preventDefault(); - var target = $(e.target); + var target =this.$(e.target); if (target.closest('li').hasClass('disabled')) { return; @@ -59,7 +60,7 @@ define( } var state = collection.state; - var pageIndex = $(e.target).text() * 1; + var pageIndex = target.text(); collection.getPage(state.firstPage === 0 ? pageIndex - 1 :pageIndex); }, diff --git a/src/UI/Shared/Messenger.js b/src/UI/Shared/Messenger.js index ab53a619a..04823f984 100644 --- a/src/UI/Shared/Messenger.js +++ b/src/UI/Shared/Messenger.js @@ -23,12 +23,13 @@ define(function () { } } - return window.Messenger().post({ + return window.Messenger().post({ message : options.message, type : options.type, showCloseButton: true, hideAfter : options.hideAfter, - id : options.id + id : options.id, + actions : options.actions }); }, diff --git a/src/UI/Shared/NzbDroneController.js b/src/UI/Shared/NzbDroneController.js index 2ff57cfd4..0d2383fad 100644 --- a/src/UI/Shared/NzbDroneController.js +++ b/src/UI/Shared/NzbDroneController.js @@ -1,23 +1,43 @@ 'use strict'; define( [ + 'vent', 'AppLayout', 'marionette', 'Shared/NotFoundView' - ], function (AppLayout, Marionette, NotFoundView) { + ], function (vent, AppLayout, Marionette, NotFoundView) { return Marionette.AppRouter.extend({ + initialize: function () { + this.listenTo(vent, vent.Events.ServerUpdated, this._onServerUpdated); + }, + showNotFound: function () { this.setTitle('Not Found'); - AppLayout.mainRegion.show(new NotFoundView(this)); + this.showMainRegion(new NotFoundView(this)); }, setTitle: function (title) { if (title.toLocaleLowerCase() === 'nzbdrone') { - window.document.title = 'NzbDrone'; + document.title = 'NzbDrone'; + } + else { + document.title = title + ' - NzbDrone'; + } + }, + + _onServerUpdated: function () { + this.pendingUpdate = true; + }, + + showMainRegion: function (view) { + if (this.pendingUpdate) { + window.location.reload(); } + else { - window.document.title = title + ' - NzbDrone'; + //AppLayout + AppLayout.mainRegion.show(view); } } }); diff --git a/src/UI/Shared/SignalRBroadcaster.js b/src/UI/Shared/SignalRBroadcaster.js index 453b08843..a91e08a5c 100644 --- a/src/UI/Shared/SignalRBroadcaster.js +++ b/src/UI/Shared/SignalRBroadcaster.js @@ -2,8 +2,11 @@ define( [ 'vent', + 'jquery', + 'Shared/Messenger', + 'System/StatusModel', 'signalR' - ], function (vent) { + ], function (vent, $, Messenger, StatusModel) { return { appInitializer: function () { @@ -24,6 +27,9 @@ define( } }; + var tryingToReconnect = false; + var messengerId = 'signalR'; + this.signalRconnection = $.connection('/signalr'); this.signalRconnection.stateChanged(function (change) { @@ -34,6 +40,62 @@ define( vent.trigger('server:' + message.name, message.body); }); + this.signalRconnection.reconnecting(function() { + if (window.NzbDrone.unloading) { + return; + } + + tryingToReconnect = true; + + Messenger.show({ + id : messengerId, + type : 'info', + hideAfter : 0, + message : 'Connection to backend lost, attempting to reconnect' + }); + }); + + this.signalRconnection.reconnected(function() { + tryingToReconnect = false; + + var currentVersion = StatusModel.get('version'); + + var promise = StatusModel.fetch(); + promise.done(function () { + if (StatusModel.get('version') !== currentVersion) { + vent.trigger(vent.Events.ServerUpdated); + } + }); + + Messenger.show({ + id : messengerId, + type : 'success', + hideAfter : 5, + message : 'Connection to backend restored' + }); + }); + + this.signalRconnection.disconnected(function () { + if (tryingToReconnect) { + $('<div class="modal-backdrop"></div>').appendTo(document.body); + + Messenger.show({ + id : messengerId, + type : 'error', + hideAfter : 0, + message : 'Connection to backend lost', + actions : { + cancel: { + label: 'Reload', + action: function() { + window.location.reload(); + } + } + } + }); + } + }); + this.signalRconnection.start({ transport: [ 'longPolling' diff --git a/src/UI/Shared/Toolbar/Button/ButtonView.js b/src/UI/Shared/Toolbar/Button/ButtonView.js index a35d1a048..45300e988 100644 --- a/src/UI/Shared/Toolbar/Button/ButtonView.js +++ b/src/UI/Shared/Toolbar/Button/ButtonView.js @@ -11,6 +11,10 @@ define( template : 'Shared/Toolbar/ButtonTemplate', className: 'btn', + ui: { + icon: 'i' + }, + events: { 'click': 'onClick' }, @@ -73,7 +77,7 @@ define( var callback = this.model.get('callback'); if (callback) { - callback.call(this.model.ownerContext); + callback.call(this.model.ownerContext, this); } } }); diff --git a/src/UI/Shared/Toolbar/ToolbarLayout.js b/src/UI/Shared/Toolbar/ToolbarLayout.js index 8945337a2..7f4b64bf9 100644 --- a/src/UI/Shared/Toolbar/ToolbarLayout.js +++ b/src/UI/Shared/Toolbar/ToolbarLayout.js @@ -5,8 +5,9 @@ define( 'Shared/Toolbar/ButtonCollection', 'Shared/Toolbar/ButtonModel', 'Shared/Toolbar/Radio/RadioButtonCollectionView', - 'Shared/Toolbar/Button/ButtonCollectionView' - ], function (Marionette, ButtonCollection, ButtonModel, RadioButtonCollectionView, ButtonCollectionView) { + 'Shared/Toolbar/Button/ButtonCollectionView', + 'underscore' + ], function (Marionette, ButtonCollection, ButtonModel, RadioButtonCollectionView, ButtonCollectionView,_) { return Marionette.Layout.extend({ template: 'Shared/Toolbar/ToolbarLayoutTemplate', diff --git a/src/UI/System/Logs/Files/LogFileCollection.js b/src/UI/System/Logs/Files/LogFileCollection.js index b26a983fe..88fefca42 100644 --- a/src/UI/System/Logs/Files/LogFileCollection.js +++ b/src/UI/System/Logs/Files/LogFileCollection.js @@ -1,14 +1,17 @@ -'use strict'; +'use strict'; -define(['System/Logs/Files/LogFileModel' ], -function (LogFileModel) { - return Backbone.Collection.extend({ - url : window.NzbDrone.ApiRoot + '/log/files', - model: LogFileModel, +define( + [ + 'backbone', + 'System/Logs/Files/LogFileModel' + ], function (Backbone, LogFileModel) { + return Backbone.Collection.extend({ + url : window.NzbDrone.ApiRoot + '/log/files', + model: LogFileModel, - state: { - sortKey : 'lastWriteTime', - order : 1 - } + state: { + sortKey: 'lastWriteTime', + order : 1 + } + }); }); -}); diff --git a/src/UI/System/Logs/Files/LogFileLayout.js b/src/UI/System/Logs/Files/LogFileLayout.js index f8de17828..a324f8cfa 100644 --- a/src/UI/System/Logs/Files/LogFileLayout.js +++ b/src/UI/System/Logs/Files/LogFileLayout.js @@ -12,7 +12,8 @@ define( 'System/Logs/Files/ContentsView', 'System/Logs/Files/ContentsModel', 'Shared/Toolbar/ToolbarLayout', - 'Shared/LoadingView' + 'Shared/LoadingView', + 'jQuery/jquery.spin' ], function (vent, Marionette, Backgrid, @@ -139,9 +140,10 @@ define( this.contents.show(new ContentsView({ model: model })); }, - _refreshLogs: function () { + _refreshLogs: function (buttonContext) { this.contents.close(); - this.collection.fetch(); + var promise = this.collection.fetch(); + buttonContext.ui.icon.spinForPromise(promise); }, _commandComplete: function (options) { diff --git a/src/UI/System/Logs/Table/LogsTableLayout.js b/src/UI/System/Logs/Table/LogsTableLayout.js index 95a59851a..82960ba79 100644 --- a/src/UI/System/Logs/Table/LogsTableLayout.js +++ b/src/UI/System/Logs/Table/LogsTableLayout.js @@ -10,7 +10,8 @@ define( 'Shared/Grid/Pager', 'System/Logs/LogsCollection', 'Shared/Toolbar/ToolbarLayout', - 'Shared/LoadingView' + 'Shared/LoadingView', + 'jQuery/jquery.spin' ], function (vent, Marionette, Backgrid, LogTimeCell, LogLevelCell, LogRow, GridPager, LogCollection, ToolbarLayout, LoadingView) { return Marionette.Layout.extend({ template: 'System/Logs/Table/LogsTableLayoutTemplate', @@ -58,22 +59,18 @@ define( initialize: function () { this.collection = new LogCollection(); - this.collectionPromise = this.collection.fetch(); + this.listenTo(this.collection, 'sync', this._showTable); vent.on(vent.Events.CommandComplete, this._commandComplete, this); }, onRender: function () { this.grid.show(new LoadingView()); + this.collection.fetch(); }, onShow: function () { - var self = this; this._showToolbar(); - - this.collectionPromise.done(function () { - self._showTable(); - }); }, _showTable: function () { @@ -120,10 +117,10 @@ define( })); }, - _refreshLogs: function () { + _refreshLogs: function (buttonContext) { this.collection.state.currentPage = 1; - this.collection.fetch({ reset: true }); - this._showTable(); + var promise = this.collection.fetch({ reset: true }); + buttonContext.ui.icon.spinForPromise(promise); }, _commandComplete: function (options) { diff --git a/src/UI/System/StatusModel.js b/src/UI/System/StatusModel.js index 3210fe3e6..97dc696ca 100644 --- a/src/UI/System/StatusModel.js +++ b/src/UI/System/StatusModel.js @@ -8,7 +8,6 @@ define( url: window.NzbDrone.ApiRoot + '/system/status' }); - var instance = new StatusModel(); instance.fetch(); return instance; diff --git a/src/UI/System/Update/UpdateItemViewTemplate.html b/src/UI/System/Update/UpdateItemViewTemplate.html index 7c2953838..796f1070e 100644 --- a/src/UI/System/Update/UpdateItemViewTemplate.html +++ b/src/UI/System/Update/UpdateItemViewTemplate.html @@ -6,7 +6,15 @@ {{#if installed}}<i class="icon-ok" title="Installed"></i>{{/if}} {{#if_windows}} - {{#if isUpgrade}}<span class="label label-inverse install-update x-install-update">Install</span>{{/if}} + {{#if isUpgrade}} + <span class="label label-inverse install-update x-install-update">Install</span> + {{/if}} + {{else}} + {{#if isUpgrade}} + <span class="label label-inverse install-update"> + <a href="https://github.com/NzbDrone/NzbDrone/wiki/Installation#linux">Install</a> + </span> + {{/if}} {{/if_windows}} </span> </legend> diff --git a/src/UI/System/Update/update.less b/src/UI/System/Update/update.less index 26751cd49..48c138f40 100644 --- a/src/UI/System/Update/update.less +++ b/src/UI/System/Update/update.less @@ -29,4 +29,13 @@ .clickable(); margin-left: 10px; } + + a { + color: white; + text-decoration: none; + } + + a:hover { + text-decoration: none; + } } \ No newline at end of file diff --git a/src/UI/app.js b/src/UI/app.js index 7d4aab71d..0c0dd9cc0 100644 --- a/src/UI/app.js +++ b/src/UI/app.js @@ -21,7 +21,7 @@ require.config({ 'signalR' : 'JsLibraries/jquery.signalR', 'jquery.knob' : 'JsLibraries/jquery.knob', 'jquery.dotdotdot' : 'JsLibraries/jquery.dotdotdot', - 'jquery' : 'JsLibraries/jquery', + 'jquery' : 'jQuery/jquery.shim', 'libs' : 'JsLibraries/', 'api': 'Require/require.api' @@ -29,6 +29,11 @@ require.config({ shim: { + + jquery :{ + exports: '$' + }, + signalR: { deps: [ @@ -77,20 +82,6 @@ require.config({ }, - 'backbone.deepmodel': { - deps: - [ - 'Mixins/underscore.mixin.deepExtend' - ] - }, - - 'backbone.validation': { - deps : - [ - 'backbone' - ], - exports: 'Backbone.Validation' - }, marionette: { deps: @@ -102,8 +93,8 @@ require.config({ exports: 'Marionette', init : function (Backbone, TemplateMixin, AsNamedView) { - TemplateMixin.call(Marionette.TemplateCache); - AsNamedView.call(Marionette.ItemView.prototype); + TemplateMixin.call(window.Marionette.TemplateCache); + AsNamedView.call(window.Marionette.ItemView.prototype); } }, @@ -128,6 +119,26 @@ require.config({ 'backbone' ] }, + 'backbone.deepmodel': { + deps: + [ + 'backbone', + 'underscore' + ] + }, + 'backbone.validation': { + deps : + [ + 'backbone' + ], + exports: 'Backbone.Validation' + }, + 'backbone.modelbinder':{ + deps : + [ + 'backbone' + ] + }, backgrid : { deps: @@ -143,7 +154,7 @@ require.config({ 'Shared/Grid/HeaderCell' ], function () { - Backgrid.Column.prototype.defaults = { + window.Backgrid.Column.prototype.defaults = { name : undefined, label : undefined, sortable : true, @@ -194,7 +205,8 @@ define( 'Series/SeriesController', 'Router', 'Shared/Modal/Controller', - 'Instrumentation/StringFormat' + 'Instrumentation/StringFormat', + 'LifeCycle' ], function ($, Backbone, Marionette, RouteBinder, SignalRBroadcaster, NavbarView, AppLayout, SeriesController, Router, ModalController) { new SeriesController(); diff --git a/src/UI/index.html b/src/UI/index.html index 5af3cf1a8..515edecb9 100644 --- a/src/UI/index.html +++ b/src/UI/index.html @@ -61,7 +61,8 @@ </div> </footer> </body> - +<div id="errors"> +</div> <script type="text/javascript"> window.NzbDrone = window.NzbDrone || {}; window.NzbDrone.ApiKey = 'API_KEY'; diff --git a/src/UI/jQuery/RouteBinder.js b/src/UI/jQuery/RouteBinder.js index fcd7effeb..8a1fac21f 100644 --- a/src/UI/jQuery/RouteBinder.js +++ b/src/UI/jQuery/RouteBinder.js @@ -1,55 +1,59 @@ 'use strict'; -define(['backbone'],function (Backbone) { - //This module will automatically route all relative links through backbone router rather than - //causing links to reload pages. +define( + [ + 'backbone', + 'jquery' + ], function (Backbone,$) { + //This module will automatically route all relative links through backbone router rather than + //causing links to reload pages. - var routeBinder = { + var routeBinder = { - bind: function () { - var self = this; - $(document).on('click', 'a[href]', function (event) { - self._handleClick(event); - }); - }, + bind: function () { + var self = this; + $(document).on('click', 'a[href]', function (event) { + self._handleClick(event); + }); + }, - _handleClick: function (event) { - var $target = $(event.target); + _handleClick: function (event) { + var $target = $(event.target); - //check if tab nav - if ($target.parents('.nav-tabs').length) { - return; - } + //check if tab nav + if ($target.parents('.nav-tabs').length) { + return; + } - if ($target.hasClass('no-router')) { - return; - } + if ($target.hasClass('no-router')) { + return; + } - event.preventDefault(); + event.preventDefault(); - var href = event.target.getAttribute('href'); + var href = event.target.getAttribute('href'); - if (!href && $target.parent('a') && $target.parent('a')[0]) { + if (!href && $target.parent('a') && $target.parent('a')[0]) { - var linkElement = $target.parent('a')[0]; + var linkElement = $target.parent('a')[0]; - href = linkElement.getAttribute('href'); - } + href = linkElement.getAttribute('href'); + } - if (!href) { - throw 'couldn\'t find route target'; - } + if (!href) { + throw 'couldn\'t find route target'; + } - if (!href.startsWith('http')) { - Backbone.history.navigate(href, { trigger: true }); - } + if (!href.startsWith('http')) { + Backbone.history.navigate(href, { trigger: true }); + } - else { - //Open in new tab - window.open(href, '_blank'); + else { + //Open in new tab + window.open(href, '_blank'); + } } - } - }; + }; - return routeBinder; -}); + return routeBinder; + }); diff --git a/src/UI/jQuery/jquery.shim.js b/src/UI/jQuery/jquery.shim.js new file mode 100644 index 000000000..8afee0490 --- /dev/null +++ b/src/UI/jQuery/jquery.shim.js @@ -0,0 +1,7 @@ +'use strict'; +define( + [ + + ], function () { + return window.$; + }); diff --git a/src/UI/jQuery/jquery.validation.js b/src/UI/jQuery/jquery.validation.js index 6f94a50db..362dffaef 100644 --- a/src/UI/jQuery/jquery.validation.js +++ b/src/UI/jQuery/jquery.validation.js @@ -50,7 +50,7 @@ define( }; $.fn.addFormError = function (error) { - this.find('.control-group').parent().prepend('<div class="alert alert-error validation-error">' + error.errorMessage + '</div>') + this.find('.control-group').parent().prepend('<div class="alert alert-error validation-error">' + error.errorMessage + '</div>'); }; $.fn.removeAllErrors = function () { diff --git a/src/UI/vent.js b/src/UI/vent.js index 4170ac72b..7ee771295 100644 --- a/src/UI/vent.js +++ b/src/UI/vent.js @@ -11,7 +11,8 @@ define( SeriesAdded : 'series:added', SeriesDeleted : 'series:deleted', SeasonRenamed : 'season:renamed', - CommandComplete: 'command:complete' + CommandComplete: 'command:complete', + ServerUpdated : 'server:updated' }; vent.Commands = { diff --git a/wix/nzbdrone.wxs b/wix/nzbdrone.wxs new file mode 100644 index 000000000..fed16ce94 --- /dev/null +++ b/wix/nzbdrone.wxs @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8"?> +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> + <Product Id="*" Name="NzbDrone" Language="1033" Version="$(env.BUILD_NUMBER)" Manufacturer="NzbDrone" UpgradeCode="56833D74-A480-4CA2-B562-5A018B3A0F99"> + <Package Description="NzbDrone" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" Platform="x86" Manufacturer="NzbDrone" /> + <Media Id="1" Cabinet="nzbdrone.cab" EmbedCab="yes" CompressionLevel="high" /> + <Property Id="ARPPRODUCTICON" Value="SX_ICON" /> + <Directory Id="TARGETDIR" Name="SourceDir"> + <Directory Id="LocalAppDataFolder" Name="AppDataFolder"> + <Directory Name="SyntikX" Id="SX_ROOT"> + <Component Id="SX_APP_COMP" DiskId="1" Guid="9c3ac309-cde4-4338-be75-a914cbce2601"> + <File Id="CONSOLE_EXE_FILE" Name="NzbDrone.Console.exe" Source="..\_output\NzbDrone.Console.exe" /> + <RegistryValue Root="HKCU" Key="Software\Microsoft\SyntikX" Name="installed" Type="integer" Value="1" KeyPath="yes" /> + <RemoveFolder Id="SX_ROOT" On="uninstall" /> + </Component> + </Directory> + </Directory> + <!-- + <Directory Id="DesktopFolder"> + <Component Id="SX_DESKTOP_SHORTCUT_COMP" Guid="1f395635-7a9d-454d-aab4-95a5a4e70be4"> + <Shortcut Id="SX_DESKTOP_SHORTCUT" Name="SyntikX" Description="SyntikX Backup Client" Target="[SX_ROOT]SyntikX.Client.exe" WorkingDirectory="SX_ROOT" /> + <RegistryValue Root="HKCU" Key="Software\Microsoft\SyntikX" Name="installed" Type="integer" Value="1" KeyPath="yes" /> + </Component> + </Directory> + <Directory Id="ProgramMenuFolder"> + <Directory Id="SX_START_DIR" Name="SyntikX"> + <Component Id="SX_START_SHORTCUT_COMP" Guid="8b3d54c6-712b-4bc2-b1e9-7cf40bcc1344"> + <Shortcut Id="SX_START_SHORTCUT" Name="SyntikX" Description="SyntikX Backup Client" Target="[SX_ROOT]SyntikX.Client.exe" WorkingDirectory="SX_ROOT" /> + <RemoveFolder Id="SX_START_DIR" On="uninstall" /> + <RegistryValue Root="HKCU" Key="Software\Microsoft\SyntikX" Name="installed" Type="integer" Value="1" KeyPath="yes" /> + </Component> + </Directory> + <Directory Id="StartupFolder" Name="Startup"> + <Component Id="SX_STARTUP_SHORTCUT_COMP" Guid="0fdfe510-621e-4925-a0d4-395617fb7cbc"> + <Shortcut Id="SX_STARTUP_SHORTCUT" Name="SyntikX" Description="SyntikX Backup Client" Target="[SX_ROOT]SyntikX.Client.exe" Arguments="/startup" WorkingDirectory="SX_ROOT" /> + <RegistryValue Root="HKCU" Key="Software\Microsoft\SyntikX" Name="installed" Type="integer" Value="1" KeyPath="yes" /> + </Component> + </Directory> + </Directory> --> + </Directory> + <!--<UIRef Id="WixUI_Minimal" />--> + <UI /> + <MajorUpgrade AllowDowngrades="no" AllowSameVersionUpgrades="yes" MigrateFeatures="yes" Schedule="afterInstallValidate" DowngradeErrorMessage="Newer version of Nzbdrone is already installed." /> + <Feature Id="DefaultFeature" Title="Main Feature" Level="1"> + <ComponentRef Id="SX_APP_COMP" /> + <!-- + <ComponentRef Id="SX_START_SHORTCUT_COMP" /> + <ComponentRef Id="SX_STARTUP_SHORTCUT_COMP" /> + <ComponentRef Id="SX_DESKTOP_SHORTCUT_COMP" /> + + --> + </Feature> + <PropertyRef Id="NETFRAMEWORK40FULL" /> + <Condition Message="This application requires .NET Framework 4.0 or later. Please install the .NET Framework then run this installer again.">NETFRAMEWORK40FULL</Condition> + <Icon Id="SX_ICON" SourceFile="..\_output\NzbDrone.exe" /> + <InstallExecuteSequence> + <InstallInitialize /> + <!-- <Custom Action="SX_START_ACTION" After="InstallFiles" /> --> + <InstallFinalize /> + </InstallExecuteSequence> + <CustomAction Id="SX_START_ACTION" FileKey="CONSOLE_EXE_FILE" ExeCommand="" Execute="deferred" Impersonate="no" Return="asyncNoWait" /> + </Product> +</Wix> \ No newline at end of file diff --git a/wix/package.bat b/wix/package.bat new file mode 100644 index 000000000..86495f562 --- /dev/null +++ b/wix/package.bat @@ -0,0 +1,4 @@ +SET BUILD_NUMBER=1.9.9.9 + +"bin\candle.exe" -nologo "nzbdrone.wxs" -out "nzbdrone.wixobj" -ext WixNetFxExtension -ext WixUIExtension +"bin\light.exe" -nologo "nzbdrone.wixobj" -out "nzbdrone.msi" -ext WixNetFxExtension -ext WixUIExtension \ No newline at end of file