diff --git a/.gitignore b/.gitignore index f9ae2f4e1..ce725c264 100644 --- a/.gitignore +++ b/.gitignore @@ -1,71 +1,220 @@ -#OS junk files -[Tt]humbs.db -*.DS_Store +# Created by https://www.gitignore.io/api/visualstudio -#Visual Studio files -*.[Oo]bj +### VisualStudio ### +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo *.user -*.aps -*.pch -*.vspscc -*.vssscc +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + *_i.c *_p.c -*.ncb -*.suo +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr *.tlb +*.tli *.tlh -*.bak -*.[Cc]ache -*.ilk +*.tmp +*.tmp_proj *.log -*.lib -*.sbr -*.sdf -*.opensdf -*.unsuccessfulbuild +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files ipch/ -obj/ -[Bb]in -bin40/ -Ankh.NoLoad -*.vspx +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler *.psess +*.vsp +*.vspx -#MonoDevelop -*.pidb -*.userprefs +# TFS 2012 Local Workspace +$tf/ -#Tooling +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in _ReSharper*/ -*.resharper -[Tt]est[Rr]esult* -*.sass-cache -*.orig -*.GhostDoc.xml +*.[Rr]e[Ss]harper +*.DotSettings.user -#Project files -[Bb]uild/ -*.ide +# JustCode is a .NET coding add-in +.JustCode -#Subversion files -.svn +# TeamCity is a build add-in +_TeamCity* -# Office Temp Files -~$* +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html -#NuGet -packages/* -src/serilog/packages/* -!packages/repositories.config +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# NuGet Packages *.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ -#ncrunch -*ncrunch* -*crunch*.local.xml +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ -# visual studio database projects +# Others +ClientBin/ +[Ss]tyle[Cc]op.* +~$* +*~ *.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm -#Test files -*.testsettings +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions +*.orig diff --git a/Build.ps1 b/Build.ps1 index bde75f2da..ae539c910 100644 --- a/Build.ps1 +++ b/Build.ps1 @@ -1,87 +1,103 @@ -param( - [String] $majorMinor = "0.0", # 1.4 - [String] $patch = "0", # $env:APPVEYOR_BUILD_VERSION - [String] $branch = "private", # $env:APPVEYOR_REPO_BRANCH - [String] $customLogger = "", # C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll - [Switch] $notouch -) - -function Set-AssemblyVersions($informational, $file, $assembly) +function Install-Dnvm { - (Get-Content assets/CommonAssemblyInfo.cs) | - ForEach-Object { $_ -replace """1.0.0.0""", """$assembly""" } | - ForEach-Object { $_ -replace """1.0.0""", """$informational""" } | - ForEach-Object { $_ -replace """1.1.1.1""", """$file""" } | - Set-Content assets/CommonAssemblyInfo.cs + & where.exe dnvm 2>&1 | Out-Null + if(($LASTEXITCODE -ne 0) -Or ((Test-Path Env:\APPVEYOR) -eq $true)) + { + Write-Host "DNVM not found" + &{$Branch='dev';iex ((New-Object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/dev/dnvminstall.ps1'))} + + # Normally this happens automatically during install but AppVeyor has + # an issue where you may need to manually re-run setup from within this process. + if($env:DNX_HOME -eq $NULL) + { + Write-Host "Initial DNVM environment setup failed; running manual setup" + $tempDnvmPath = Join-Path $env:TEMP "dnvminstall" + $dnvmSetupCmdPath = Join-Path $tempDnvmPath "dnvm.ps1" + & $dnvmSetupCmdPath setup + } + } } -function Install-NuGetPackages() +function Get-DnxVersion { - nuget restore Serilog.sln + $globalJson = Join-Path $PSScriptRoot "global.json" + $jsonData = Get-Content -Path $globalJson -Raw | ConvertFrom-JSON + return $jsonData.sdk.version } -function Invoke-MSBuild($solution, $customLogger) +function Restore-Packages { - if ($customLogger) - { - msbuild "$solution" /verbosity:minimal /p:Configuration=Release /logger:"$customLogger" - } - else - { - msbuild "$solution" /verbosity:minimal /p:Configuration=Release - } + param([string] $DirectoryName) + & dnu restore ("""" + $DirectoryName + """") } -function Invoke-NuGetPackProj($csproj) +function Build-Projects { - nuget pack -Prop Configuration=Release -Symbols $csproj + param([string] $DirectoryName) + & dnu build ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\testbin; if($LASTEXITCODE -ne 0) { exit 1 } + & dnu pack ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\packages; if($LASTEXITCODE -ne 0) { exit 1 } } -function Invoke-NuGetPackSpec($nuspec, $version) +function Build-TestProjects { - nuget pack $nuspec -Version $version -OutputDirectory ..\..\ + param([string] $DirectoryName) + & dnu build ("""" + $DirectoryName + """") --configuration Release --out .\artifacts\testbin; if($LASTEXITCODE -ne 0) { exit 1 } } -function Invoke-NuGetPack($version) +function Test-Projects { - ls src/**/*.csproj | - Where-Object { -not ($_.Name -like "*net40*") } | - Where-Object { -not ($_.Name -like "*FullNetFx*") } | - Where-Object { -not ($_.Name -eq "Serilog.csproj") } | - ForEach-Object { Invoke-NuGetPackProj $_ } - - pushd .\src\Serilog - Invoke-NuGetPackSpec "Serilog.nuspec" $version - popd + param([string] $DirectoryName) + & dnx -p ("""" + $DirectoryName + """") test; if($LASTEXITCODE -ne 0) { exit 2 } } -function Invoke-Build($majorMinor, $patch, $branch, $customLogger, $notouch) +function Remove-PathVariable { - $target = (Get-Content ./CHANGES.md -First 1).Trim() - $file = "$target.$patch" - $package = $target - if ($branch -ne "master") - { - $package = "$target-pre-$patch" - } + param([string] $VariableToRemove) + $path = [Environment]::GetEnvironmentVariable("PATH", "User") + $newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "User") + $path = [Environment]::GetEnvironmentVariable("PATH", "Process") + $newItems = $path.Split(';') | Where-Object { $_.ToString() -inotlike $VariableToRemove } + [Environment]::SetEnvironmentVariable("PATH", [System.String]::Join(';', $newItems), "Process") +} - Write-Output "Building Serilog $package" +Push-Location $PSScriptRoot - if (-not $notouch) - { - $assembly = "$majorMinor.0.0" +$dnxVersion = Get-DnxVersion - Write-Output "Assembly version will be set to $assembly" - Set-AssemblyVersions $package $file $assembly - } +# Clean +if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } - Install-NuGetPackages - - Invoke-MSBuild "Serilog-net40.sln" $customLogger - Invoke-MSBuild "Serilog.sln" $customLogger +# Remove the installed DNVM from the path and force use of +# per-user DNVM (which we can upgrade as needed without admin permissions) +Remove-PathVariable "*Program Files\Microsoft DNX\DNVM*" - Invoke-NuGetPack $package -} +# Make sure per-user DNVM is installed +Install-Dnvm + +# Install DNX +dnvm install $dnxVersion -r CoreCLR -NoNative +dnvm install $dnxVersion -r CLR -NoNative +dnvm use $dnxVersion -r CLR + +# Package restore +Get-ChildItem -Path . -Filter *.xproj -Recurse | ForEach-Object { Restore-Packages $_.DirectoryName } + +# Set build number +$env:DNX_BUILD_VERSION = @{ $true = $env:APPVEYOR_BUILD_NUMBER; $false = 1 }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; +Write-Host "Build number: " $env:DNX_BUILD_VERSION + +# Build/package +Get-ChildItem -Path .\src -Filter *.xproj -Recurse | ForEach-Object { Build-Projects $_.DirectoryName } +Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Build-TestProjects $_.DirectoryName } + +# Test +Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName } + +# Switch to Core CLR +dnvm use $dnxVersion -r CoreCLR + +# Test again +Get-ChildItem -Path .\test -Filter *.xproj -Recurse | ForEach-Object { Test-Projects $_.DirectoryName } -$ErrorActionPreference = "Stop" -Invoke-Build $majorMinor $patch $branch $customLogger $notouch +Pop-Location diff --git a/NuGet.Config b/NuGet.Config new file mode 100644 index 000000000..26aec7095 --- /dev/null +++ b/NuGet.Config @@ -0,0 +1,6 @@ + + + + + + diff --git a/Serilog-net40.sln b/Serilog-net40.sln deleted file mode 100644 index 3f67c8365..000000000 --- a/Serilog-net40.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog-net40", "src\Serilog\Serilog-net40.csproj", "{0915DBD9-0F7C-4439-8D9E-74C3D579B219}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.FullNetFx-net40", "src\Serilog.FullNetFx\Serilog.FullNetFx-net40.csproj", "{7A9E1095-167D-402A-B43D-B36B97FF183D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Tests-net40", "test\Serilog.Tests\Serilog.Tests-net40.csproj", "{D5648551-D19D-41E3-9FC1-E74B111EEF41}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.Build.0 = Release|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.Build.0 = Release|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Serilog.sln b/Serilog.sln index 5da528f9e..f725e1bfd 100644 --- a/Serilog.sln +++ b/Serilog.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2013 -VisualStudioVersion = 12.0.31101.0 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{037440DE-440B-4129-9F7A-09B42D00397E}" EndProject @@ -12,21 +12,15 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "assets", "assets", "{E9D1B5 .editorconfig = .editorconfig Build.ps1 = Build.ps1 assets\CommonAssemblyInfo.cs = assets\CommonAssemblyInfo.cs + global.json = global.json + NuGet.Config = NuGet.Config README.md = README.md assets\Serilog.snk = assets\Serilog.snk EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog", "src\Serilog\Serilog.csproj", "{0915DBD9-0F7C-4439-8D9E-74C3D579B219}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog", "src\Serilog\Serilog.xproj", "{803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.csproj", "{D5648551-D19D-41E3-9FC1-E74B111EEF41}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.FullNetFx", "src\Serilog.FullNetFx\Serilog.FullNetFx.csproj", "{7A9E1095-167D-402A-B43D-B36B97FF183D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.PerformanceTests", "test\Serilog.PerformanceTests\Serilog.PerformanceTests.csproj", "{6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.SmokeTest", "test\Serilog.SmokeTest\Serilog.SmokeTest.csproj", "{58563C46-B781-4799-ABD5-9745F94478FD}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Serilog.MsTests", "test\Serilog.MsTests\Serilog.MsTests.csproj", "{7FC9FC46-5014-4461-A448-815E6CCE21E5}" +Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Serilog.Tests", "test\Serilog.Tests\Serilog.Tests.xproj", "{3C2D8E01-5580-426A-BDD9-EC59CD98E618}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -34,40 +28,20 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219}.Release|Any CPU.Build.0 = Release|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41}.Release|Any CPU.Build.0 = Release|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7A9E1095-167D-402A-B43D-B36B97FF183D}.Release|Any CPU.Build.0 = Release|Any CPU - {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A}.Release|Any CPU.Build.0 = Release|Any CPU - {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58563C46-B781-4799-ABD5-9745F94478FD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58563C46-B781-4799-ABD5-9745F94478FD}.Release|Any CPU.Build.0 = Release|Any CPU - {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FC9FC46-5014-4461-A448-815E6CCE21E5}.Release|Any CPU.Build.0 = Release|Any CPU + {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C}.Release|Any CPU.Build.0 = Release|Any CPU + {3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3C2D8E01-5580-426A-BDD9-EC59CD98E618}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} = {037440DE-440B-4129-9F7A-09B42D00397E} - {D5648551-D19D-41E3-9FC1-E74B111EEF41} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} - {7A9E1095-167D-402A-B43D-B36B97FF183D} = {037440DE-440B-4129-9F7A-09B42D00397E} - {6A6504BF-CD5B-4C9E-88EB-5BD71CE3106A} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} - {58563C46-B781-4799-ABD5-9745F94478FD} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} - {7FC9FC46-5014-4461-A448-815E6CCE21E5} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} + {803CD13A-D54B-4CEC-A55F-E22AE3D93B3C} = {037440DE-440B-4129-9F7A-09B42D00397E} + {3C2D8E01-5580-426A-BDD9-EC59CD98E618} = {0D135C0C-A60B-454A-A2F4-CD74A30E04B0} EndGlobalSection EndGlobal diff --git a/Serilog.sln.DotSettings b/Serilog.sln.DotSettings index b861b831b..e2434be72 100644 --- a/Serilog.sln.DotSettings +++ b/Serilog.sln.DotSettings @@ -29,6 +29,7 @@ DO_NOT_SHOW DO_NOT_SHOW DO_NOT_SHOW + HINT ERROR WARNING ERROR @@ -41,6 +42,7 @@ ERROR ERROR WARNING + HINT ERROR ERROR ERROR @@ -123,7 +125,8 @@ CHOP_ALWAYS True True - <Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> + <?xml version="1.0" encoding="utf-16"?> +<Patterns xmlns="urn:schemas-jetbrains-com:member-reordering-patterns"> <TypePattern DisplayName="COM interfaces or structs"> <TypePattern.Match> <Or> @@ -134,77 +137,67 @@ <HasAttribute Name="System.Runtime.InteropServices.ComImport" /> </Or> </And> - <HasAttribute Name="System.Runtime.InteropServices.StructLayoutAttribute" /> + <Kind Is="Struct" /> </Or> </TypePattern.Match> </TypePattern> - <TypePattern DisplayName="NUnit Test Fixtures" RemoveRegions="All"> <TypePattern.Match> <And> <Kind Is="Class" /> - <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="true" /> - <HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="true" /> + <HasAttribute Name="NUnit.Framework.TestFixtureAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.TestCaseFixtureAttribute" Inherited="True" /> </And> </TypePattern.Match> - <Entry DisplayName="Setup/Teardown Methods"> <Entry.Match> <And> <Kind Is="Method" /> <Or> - <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="true" /> - <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="true" /> - <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="true" /> - <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="true" /> + <HasAttribute Name="NUnit.Framework.SetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.TearDownAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureSetUpAttribute" Inherited="True" /> + <HasAttribute Name="NUnit.Framework.FixtureTearDownAttribute" Inherited="True" /> </Or> </And> </Entry.Match> </Entry> - <Entry DisplayName="All other members" /> - - <Entry DisplayName="Test Methods" Priority="100"> + <Entry Priority="100" DisplayName="Test Methods"> <Entry.Match> <And> <Kind Is="Method" /> - <HasAttribute Name="NUnit.Framework.TestAttribute" Inherited="false" /> + <HasAttribute Name="NUnit.Framework.TestAttribute" /> </And> </Entry.Match> - <Entry.SortBy> <Name /> </Entry.SortBy> </Entry> </TypePattern> - <TypePattern DisplayName="Default Pattern"> - <Entry DisplayName="Public Delegates" Priority="100"> + <Entry Priority="100" DisplayName="Public Delegates"> <Entry.Match> <And> <Access Is="Public" /> <Kind Is="Delegate" /> </And> </Entry.Match> - <Entry.SortBy> <Name /> </Entry.SortBy> </Entry> - - <Entry DisplayName="Public Enums" Priority="100"> + <Entry Priority="100" DisplayName="Public Enums"> <Entry.Match> <And> <Access Is="Public" /> <Kind Is="Enum" /> </And> </Entry.Match> - <Entry.SortBy> <Name /> </Entry.SortBy> </Entry> - <Entry DisplayName="Static Fields and Constants"> <Entry.Match> <Or> @@ -215,17 +208,10 @@ </And> </Or> </Entry.Match> - <Entry.SortBy> - <Kind> - <Kind.Order> - <DeclarationKind>Constant</DeclarationKind> - <DeclarationKind>Field</DeclarationKind> - </Kind.Order> - </Kind> + <Kind Order="Constant Field" /> </Entry.SortBy> </Entry> - <Entry DisplayName="Fields"> <Entry.Match> <And> @@ -235,23 +221,19 @@ </Not> </And> </Entry.Match> - <Entry.SortBy> <Readonly /> <Name /> </Entry.SortBy> </Entry> - <Entry DisplayName="Constructors"> <Entry.Match> <Kind Is="Constructor" /> </Entry.Match> - <Entry.SortBy> - <Static/> + <Static /> </Entry.SortBy> </Entry> - <Entry DisplayName="Properties, Indexers"> <Entry.Match> <Or> @@ -260,30 +242,25 @@ </Or> </Entry.Match> </Entry> - - <Entry DisplayName="Interface Implementations" Priority="100"> + <Entry Priority="100" DisplayName="Interface Implementations"> <Entry.Match> <And> <Kind Is="Member" /> <ImplementsInterface /> </And> </Entry.Match> - <Entry.SortBy> - <ImplementsInterface Immediate="true" /> + <ImplementsInterface Immediate="True" /> </Entry.SortBy> </Entry> - <Entry DisplayName="All other members" /> - <Entry DisplayName="Nested Types"> <Entry.Match> <Kind Is="Type" /> </Entry.Match> </Entry> </TypePattern> -</Patterns> - +</Patterns> <?xml version="1.0" encoding="utf-8" ?> <!-- @@ -548,6 +525,8 @@ II.2.12 <HandlesEvent /> <Policy Inspect="True" Prefix="T" Suffix="" Style="AaBb" /> <Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /> True + True + True True True True diff --git a/global.json b/global.json new file mode 100644 index 000000000..b073e32a1 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "projects": [ "src", "test" ], + "sdk": { + "version": "1.0.0-beta8" + } +} diff --git a/packages/repositories.config b/packages/repositories.config deleted file mode 100644 index ef84a0768..000000000 --- a/packages/repositories.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs b/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs deleted file mode 100644 index e6774366a..000000000 --- a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions-net40.cs +++ /dev/null @@ -1,279 +0,0 @@ -// Copyright 2014 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.ComponentModel; -using System.Diagnostics; -using System.Threading; -using Serilog.Configuration; -using Serilog.Debugging; -using Serilog.Enrichers; -using Serilog.Events; -using Serilog.Formatting.Display; -using Serilog.Formatting.Raw; -using Serilog.Settings.AppSettings; -using Serilog.Sinks.DiagnosticTrace; -using Serilog.Sinks.IOFile; -using Serilog.Sinks.RollingFile; -using Serilog.Sinks.SystemConsole; - -namespace Serilog -{ - /// - /// Extends to add Full .NET Framework - /// capabilities. - /// - public static class LoggerConfigurationFullNetFxExtensions - { - const string DefaultOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz} [{Level}] {Message}{NewLine}{Exception}"; - const string DefaultConsoleOutputTemplate = "{Timestamp:yyyy-MM-dd HH:mm:ss} [{Level}] {Message}{NewLine}{Exception}"; - const long DefaultFileSizeLimitBytes = 1L * 1024 * 1024 * 1024; - const int DefaultRetainedFileCountLimit = 31; // A long month of logs - - /// - /// Writes log events to . - /// - /// Logger sink configuration. - /// The minimum level for - /// events passed through the sink. - /// A message template describing the format used to write to the sink. - /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". - /// Supplies culture-specific formatting information, or null. - /// Configuration object allowing method chaining. - public static LoggerConfiguration Console( - this LoggerSinkConfiguration sinkConfiguration, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, - string outputTemplate = DefaultConsoleOutputTemplate, - IFormatProvider formatProvider = null) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - return sinkConfiguration.Sink(new ConsoleSink(formatter), restrictedToMinimumLevel); - } - - /// - /// Writes log events to , using color to differentiate - /// between levels. - /// - /// Logger sink configuration. - /// The minimum level for - /// events passed through the sink. - /// A message template describing the format used to write to the sink. - /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". - /// Supplies culture-specific formatting information, or null. - /// Configuration object allowing method chaining. - public static LoggerConfiguration ColoredConsole( - this LoggerSinkConfiguration sinkConfiguration, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, - string outputTemplate = DefaultConsoleOutputTemplate, - IFormatProvider formatProvider = null) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - return sinkConfiguration.Sink(new ColoredConsoleSink(outputTemplate, formatProvider), restrictedToMinimumLevel); - } - - /// - /// Write log events in a simple text dump format to the specified file. - /// - /// Logger sink configuration. - /// Path to the dump file. - /// The minimum level for - /// events passed through the sink. - /// Configuration object allowing method chaining. - [Obsolete("Please use WriteTo.Sink(new FileSink(path, new RawFormatter(), null)) instead", true), EditorBrowsable(EditorBrowsableState.Never)] - public static LoggerConfiguration DumpFile( - this LoggerSinkConfiguration sinkConfiguration, - string path, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (path == null) throw new ArgumentNullException("path"); - return sinkConfiguration.Sink(new FileSink(path, new RawFormatter(), null), restrictedToMinimumLevel); - } - - /// - /// Write log events to the specified file. - /// - /// Logger sink configuration. - /// Path to the file. - /// The minimum level for - /// events passed through the sink. - /// Supplies culture-specific formatting information, or null. - /// A message template describing the format used to write to the sink. - /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". - /// The maximum size, in bytes, to which a log file will be allowed to grow. - /// For unrestricted growth, pass null. The default is 1 GB. - /// Configuration object allowing method chaining. - /// The file will be written using the UTF-8 character set. - public static LoggerConfiguration File( - this LoggerSinkConfiguration sinkConfiguration, - string path, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, - string outputTemplate = DefaultOutputTemplate, - IFormatProvider formatProvider = null, - long? fileSizeLimitBytes = DefaultFileSizeLimitBytes) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - - FileSink sink; - try - { - sink = new FileSink(path, formatter, fileSizeLimitBytes); - } - catch (ArgumentException) - { - throw; - } - catch (Exception ex) - { - SelfLog.WriteLine("Unable to open file sink for {0}: {1}", path, ex); - return sinkConfiguration.Sink(new NullSink()); - } - - return sinkConfiguration.Sink(sink, restrictedToMinimumLevel); - } - - /// - /// Write log events to a series of files. Each file will be named according to - /// the date of the first log entry written to it. Only simple date-based rolling is - /// currently supported. - /// - /// Logger sink configuration. - /// String describing the location of the log files, - /// with {Date} in the place of the file date. E.g. "Logs\myapp-{Date}.log" will result in log - /// files such as "Logs\myapp-2013-10-20.log", "Logs\myapp-2013-10-21.log" and so on. - /// The minimum level for - /// events passed through the sink. - /// A message template describing the format used to write to the sink. - /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". - /// Supplies culture-specific formatting information, or null. - /// The maximum size, in bytes, to which any single log file will be allowed to grow. - /// For unrestricted growth, pass null. The default is 1 GB. - /// The maximum number of log files that will be retained, - /// including the current log file. For unlimited retention, pass null. The default is 31. - /// Configuration object allowing method chaining. - /// The file will be written using the UTF-8 character set. - public static LoggerConfiguration RollingFile( - this LoggerSinkConfiguration sinkConfiguration, - string pathFormat, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, - string outputTemplate = DefaultOutputTemplate, - IFormatProvider formatProvider = null, - long? fileSizeLimitBytes = DefaultFileSizeLimitBytes, - int? retainedFileCountLimit = DefaultRetainedFileCountLimit) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - var sink = new RollingFileSink(pathFormat, formatter, fileSizeLimitBytes, retainedFileCountLimit); - return sinkConfiguration.Sink(sink, restrictedToMinimumLevel); - } - - /// - /// Write log events to the . - /// - /// Logger sink configuration. - /// The minimum level for - /// events passed through the sink. - /// A message template describing the format used to write to the sink. - /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". - /// Supplies culture-specific formatting information, or null. - /// Configuration object allowing method chaining. - public static LoggerConfiguration Trace( - this LoggerSinkConfiguration sinkConfiguration, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, - string outputTemplate = DefaultOutputTemplate, - IFormatProvider formatProvider = null) - { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - return sinkConfiguration.Sink(new DiagnosticTraceSink(formatter), restrictedToMinimumLevel); - } - - /// - /// Enrich log events with properties from . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - /// -#if !ASPNETCORE50 - public static LoggerConfiguration FromLogContext( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); - return enrichmentConfiguration.With(); - } -#endif - - /// - /// Enrich log events with a ThreadId property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - /// - public static LoggerConfiguration WithThreadId( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); - return enrichmentConfiguration.With(); - } - - /// - /// Enrich log events with a ProcessId property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - public static LoggerConfiguration WithProcessId( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); - return enrichmentConfiguration.With(); - } - - /// - /// Enrich log events with a MachineName property containing the current . - /// - /// Logger enrichment configuration. - /// Configuration object allowing method chaining. - public static LoggerConfiguration WithMachineName( - this LoggerEnrichmentConfiguration enrichmentConfiguration) - { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); - return enrichmentConfiguration.With(); - } - - - /// - /// Reads the <appSettings> element of App.config or Web.config, searching for for keys - /// that look like: serilog:*, which are used to configure - /// the logger. To add a sink, use a key like serilog:write-to:File.path for - /// each parameter to the sink's configuration method. To add an additional assembly - /// containing sinks, use serilog:using. To set the level use - /// serilog:minimum-level. - /// - /// Logger setting configuration - /// An object allowing configuration to continue. - public static LoggerConfiguration AppSettings( - this LoggerSettingsConfiguration settingConfiguration) - { - if (settingConfiguration == null) throw new ArgumentNullException("settingConfiguration"); - return settingConfiguration.Settings(new AppSettingsSettings()); - } - } -} diff --git a/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs b/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs deleted file mode 100644 index daca6b6d9..000000000 --- a/src/Serilog.FullNetFx/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("Serilog.FullNetFx")] -[assembly: AssemblyDescription("Serilog Logging Library Full .NET Framework Support")] -[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2013")] - -#if !ASPNETCORE50 -[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" + - "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" + - "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" + - "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" + - "b19485ec")] -#else -[assembly: InternalsVisibleTo("Serilog.Tests")] -#endif \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj b/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj deleted file mode 100644 index f70eb219e..000000000 --- a/src/Serilog.FullNetFx/Serilog.FullNetFx-net40.csproj +++ /dev/null @@ -1,93 +0,0 @@ - - - - - Debug - AnyCPU - {7A9E1095-167D-402A-B43D-B36B97FF183D} - Library - Properties - Serilog - Serilog.FullNetFx - v4.0 - 512 - Client - - - true - full - false - bin40\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin40\Debug\Serilog.FullNetFx.XML - - - pdbonly - true - bin40\Release\ - TRACE - prompt - 4 - true - bin40\Release\Serilog.FullNetFx.XML - - - true - - - ..\..\assets\Serilog.snk - - - - - - - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - Serilog.snk - - - - - - - - - - - {0915dbd9-0f7c-4439-8d9e-74c3d579b219} - Serilog-net40 - - - - \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj b/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj deleted file mode 100644 index 7e418021c..000000000 --- a/src/Serilog.FullNetFx/Serilog.FullNetFx.csproj +++ /dev/null @@ -1,88 +0,0 @@ - - - - - Debug - AnyCPU - {7A9E1095-167D-402A-B43D-B36B97FF183D} - Library - Properties - Serilog - Serilog.FullNetFx - v4.5 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Serilog.FullNetFx.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Serilog.FullNetFx.XML - - - true - - - ..\..\assets\Serilog.snk - - - - - - - - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - - - - - - - - - Serilog.snk - - - - - {0915dbd9-0f7c-4439-8d9e-74c3d579b219} - Serilog - - - - - \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs b/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs deleted file mode 100644 index fdc99a348..000000000 --- a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink-net40.cs +++ /dev/null @@ -1,219 +0,0 @@ -// Copyright 2014 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Concurrent; -using System.Collections.Generic; -using System.Threading; -using Serilog.Core; -using Serilog.Debugging; -using Serilog.Events; - -namespace Serilog.Sinks.PeriodicBatching -{ - /// - /// Base class for sinks that log events in batches. Batching is - /// triggered asynchronously on a timer. - /// - /// - /// To avoid unbounded memory growth, events are discarded after attempting - /// to send a batch, regardless of whether the batch succeeded or not. Implementers - /// that want to change this behavior need to either implement from scratch, or - /// embed retry logic in the batch emitting functions. - /// - public abstract class PeriodicBatchingSink : ILogEventSink, IDisposable - { - readonly int _batchSizeLimit; - readonly ConcurrentQueue _queue; - readonly BatchedConnectionStatus _status; - readonly Queue _waitingBatch = new Queue(); - - readonly object _stateLock = new object(); - readonly Timer _timer; - bool _unloading; - bool _started; - - /// - /// Construct a sink posting to the specified database. - /// - /// The maximum number of events to include in a single batch. - /// The time to wait between checking for event batches. - protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period) - { - _batchSizeLimit = batchSizeLimit; - _queue = new ConcurrentQueue(); - _timer = new Timer(s => OnTick()); - _status = new BatchedConnectionStatus(period); - - AppDomain.CurrentDomain.DomainUnload += OnAppDomainUnloading; - AppDomain.CurrentDomain.ProcessExit += OnAppDomainUnloading; - AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnloading; - } - - void OnAppDomainUnloading(object sender, EventArgs args) - { - var eventArgs = args as UnhandledExceptionEventArgs; - if (eventArgs != null && !eventArgs.IsTerminating) - return; - - CloseAndFlush(); - } - - void CloseAndFlush() - { - lock (_stateLock) - { - if (!_started || _unloading) - return; - - _unloading = true; - } - - AppDomain.CurrentDomain.DomainUnload -= OnAppDomainUnloading; - AppDomain.CurrentDomain.ProcessExit -= OnAppDomainUnloading; - AppDomain.CurrentDomain.UnhandledException -= OnAppDomainUnloading; - - var wh = new ManualResetEvent(false); - if (_timer.Dispose(wh)) - wh.WaitOne(); - - OnTick(); - } - - /// - /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - /// - /// 2 - public void Dispose() - { - Dispose(true); - } - - /// - /// Free resources held by the sink. - /// - /// If true, called because the object is being disposed; if false, - /// the object is being disposed from the finalizer. - protected virtual void Dispose(bool disposing) - { - if (!disposing) return; - CloseAndFlush(); - } - - /// - /// Emit a batch of log events, running to completion synchronously. - /// - /// The events to emit. - protected abstract void EmitBatch(IEnumerable events); - - void OnTick() - { - try - { - do - { - LogEvent next; - while (_waitingBatch.Count < _batchSizeLimit && - _queue.TryDequeue(out next)) - { - if (CanInclude(next)) - _waitingBatch.Enqueue(next); - } - - if (_waitingBatch.Count == 0) - { - OnEmptyBatch(); - return; - } - - EmitBatch(_waitingBatch); - _waitingBatch.Clear(); - _status.MarkSuccess(); - } - while (true); - } - catch (Exception ex) - { - SelfLog.WriteLine("Exception while emitting periodic batch from {0}: {1}", this, ex); - _status.MarkFailure(); - } - finally - { - if (_status.ShouldDropBatch) - _waitingBatch.Clear(); - - if (_status.ShouldDropQueue) - { - LogEvent evt; - while (_queue.TryDequeue(out evt)) { } - } - - lock (_stateLock) - { - if (!_unloading) - _timer.Change(_status.NextInterval, TimeSpan.FromMilliseconds(-1)); - } - } - } - - /// - /// Emit the provided log event to the sink. If the sink is being disposed or - /// the app domain unloaded, then the event is ignored. - /// - /// Log event to emit. - /// The event is null. - /// - /// The sink implements the contract that any events whose Emit() method has - /// completed at the time of sink disposal will be flushed (or attempted to, - /// depending on app domain state). - /// - public void Emit(LogEvent logEvent) - { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - - lock (_stateLock) - { - if (_unloading) return; - if (!_started) - { - // Special handling to try to get the first event across as quickly - // as possible to show we're alive! - _started = true; - _timer.Change(TimeSpan.Zero, TimeSpan.FromMilliseconds(-1)); - } - } - - _queue.Enqueue(logEvent); - } - - /// - /// Determine whether a queued log event should be included in the batch. If - /// an override returns false, the event will be dropped. - /// - /// - /// - protected virtual bool CanInclude(LogEvent evt) - { - return true; - } - - /// - /// Allows derived sinks to perform periodic work without requiring additional threads - /// or timers (thus avoiding additional flush/shut-down complexity). - /// - protected virtual void OnEmptyBatch() - { - } - } -} diff --git a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs b/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs deleted file mode 100644 index 28e679143..000000000 --- a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink-net40.cs +++ /dev/null @@ -1,170 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.IO; -using Serilog.Core; -using Serilog.Events; -using System.Collections.Generic; -using Serilog.Formatting.Display; -using Serilog.Parsing; - -namespace Serilog.Sinks.SystemConsole -{ - class ColoredConsoleSink : ILogEventSink - { - readonly IFormatProvider _formatProvider; - - class Palette - { - public ConsoleColor Base { get; set; } - public ConsoleColor BaseText { get; set; } - public ConsoleColor Highlight { get; set; } - public ConsoleColor HighlightText { get; set; } - } - - static readonly Palette DefaultPalette = new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Gray, - Highlight = ConsoleColor.DarkGray, HighlightText = ConsoleColor.Gray }; - - static readonly IDictionary LevelPalettes = new Dictionary - { - { LogEventLevel.Verbose, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.DarkGray, - Highlight = ConsoleColor.Black, HighlightText = ConsoleColor.Gray } }, - { LogEventLevel.Debug, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Gray, - Highlight = ConsoleColor.Black, HighlightText = ConsoleColor.White } }, - { LogEventLevel.Information, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.White, - Highlight = ConsoleColor.DarkBlue, HighlightText = ConsoleColor.White } }, - { LogEventLevel.Warning, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Yellow, - Highlight = ConsoleColor.DarkYellow, HighlightText = ConsoleColor.White } }, - { LogEventLevel.Error, new Palette { Base = ConsoleColor.Black, BaseText = ConsoleColor.Red, - Highlight = ConsoleColor.Red, HighlightText = ConsoleColor.White } }, - { LogEventLevel.Fatal, new Palette { Base = ConsoleColor.DarkRed, BaseText = ConsoleColor.White, - Highlight = ConsoleColor.Red, HighlightText = ConsoleColor.White } } - }; - - readonly object _syncRoot = new object(); - readonly MessageTemplate _outputTemplate; - - public ColoredConsoleSink(string outputTemplate, IFormatProvider formatProvider) - { - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - _outputTemplate = new MessageTemplateParser().Parse(outputTemplate); - _formatProvider = formatProvider; - } - - const string StackFrameLinePrefix = " "; - - public void Emit(LogEvent logEvent) - { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - - var outputProperties = OutputProperties.GetOutputProperties(logEvent); - var palette = GetPalette(logEvent.Level); - var output = Console.Out; - - lock (_syncRoot) - { - try - { - foreach (var outputToken in _outputTemplate.Tokens) - { - var propertyToken = outputToken as PropertyToken; - if (propertyToken == null) - { - RenderOutputToken(palette, outputToken, outputProperties, output); - } - else switch (propertyToken.PropertyName) - { - case OutputProperties.MessagePropertyName: - RenderMessageToken(logEvent, palette, output); - break; - case OutputProperties.ExceptionPropertyName: - RenderExceptionToken(palette, propertyToken, outputProperties, output); - break; - default: - RenderOutputToken(palette, outputToken, outputProperties, output); - break; - } - } - } - finally { Console.ResetColor(); } - } - } - - void RenderExceptionToken(Palette palette, MessageTemplateToken outputToken, IDictionary outputProperties, TextWriter output) - { - var sw = new StringWriter(); - outputToken.Render(outputProperties, sw, _formatProvider); - var lines = new StringReader(sw.ToString()); - string nextLine; - while ((nextLine = lines.ReadLine()) != null) - { - if (nextLine.StartsWith(StackFrameLinePrefix)) - SetBaseColors(palette); - else - SetHighlightColors(palette); - output.WriteLine(nextLine); - } - } - - void RenderMessageToken(LogEvent logEvent, Palette palette, TextWriter output) - { - foreach (var messageToken in logEvent.MessageTemplate.Tokens) - { - var messagePropertyToken = messageToken as PropertyToken; - if (messagePropertyToken != null) - { - SetHighlightColors(palette); - messageToken.Render(logEvent.Properties, output, _formatProvider); - } - else - { - SetBaseColors(palette); - messageToken.Render(logEvent.Properties, output, _formatProvider); - } - } - } - - void RenderOutputToken(Palette palette, MessageTemplateToken outputToken, IDictionary outputProperties, TextWriter output) - { - SetBaseColors(palette); - outputToken.Render(outputProperties, output, _formatProvider); - } - - static Palette GetPalette(LogEventLevel level) - { - Palette palette; - if (!LevelPalettes.TryGetValue(level, out palette)) - palette = DefaultPalette; - - return palette; - } - - static void SetBaseColors(Palette palette) - { - SetColors(palette.Base, palette.BaseText); - } - - static void SetHighlightColors(Palette palette) - { - SetColors(palette.Highlight, palette.HighlightText); - } - - static void SetColors(ConsoleColor background, ConsoleColor foreground) - { - Console.BackgroundColor = background; - Console.ForegroundColor = foreground; - } - } -} diff --git a/src/Serilog/Configuration/ILoggerSettings.cs b/src/Serilog/Configuration/ILoggerSettings.cs index a5506e05d..4f7c50dcd 100644 --- a/src/Serilog/Configuration/ILoggerSettings.cs +++ b/src/Serilog/Configuration/ILoggerSettings.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Configuration/LoggerDestructuringConfiguration.cs b/src/Serilog/Configuration/LoggerDestructuringConfiguration.cs index 88af10d28..61c476e08 100644 --- a/src/Serilog/Configuration/LoggerDestructuringConfiguration.cs +++ b/src/Serilog/Configuration/LoggerDestructuringConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -34,9 +34,9 @@ internal LoggerDestructuringConfiguration( Action addPolicy, Action setMaximumDepth) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - if (addScalar == null) throw new ArgumentNullException("addScalar"); - if (addPolicy == null) throw new ArgumentNullException("addPolicy"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); + if (addScalar == null) throw new ArgumentNullException(nameof(addScalar)); + if (addPolicy == null) throw new ArgumentNullException(nameof(addPolicy)); _loggerConfiguration = loggerConfiguration; _addScalar = addScalar; _addPolicy = addPolicy; @@ -51,7 +51,7 @@ internal LoggerDestructuringConfiguration( /// Configuration object allowing method chaining. public LoggerConfiguration AsScalar(Type scalarType) { - if (scalarType == null) throw new ArgumentNullException("scalarType"); + if (scalarType == null) throw new ArgumentNullException(nameof(scalarType)); _addScalar(scalarType); return _loggerConfiguration; } @@ -75,7 +75,7 @@ public LoggerConfiguration AsScalar() // ReSharper disable once MemberCanBePrivate.Global public LoggerConfiguration With(params IDestructuringPolicy[] destructuringPolicies) { - if (destructuringPolicies == null) throw new ArgumentNullException("destructuringPolicies"); + if (destructuringPolicies == null) throw new ArgumentNullException(nameof(destructuringPolicies)); foreach (var destructuringPolicy in destructuringPolicies) { if (destructuringPolicy == null) @@ -107,7 +107,7 @@ public LoggerConfiguration With() /// public LoggerConfiguration ByTransforming(Func transformation) { - if (transformation == null) throw new ArgumentNullException("transformation"); + if (transformation == null) throw new ArgumentNullException(nameof(transformation)); var policy = new ProjectedDestructuringPolicy(t => t == typeof(TValue), o => transformation((TValue)o)); return With(policy); @@ -123,7 +123,7 @@ public LoggerConfiguration ByTransforming(Func transform /// public LoggerConfiguration ToMaximumDepth(int maximumDestructuringDepth) { - if (maximumDestructuringDepth < 0) throw new ArgumentOutOfRangeException("maximumDestructuringDepth"); + if (maximumDestructuringDepth < 0) throw new ArgumentOutOfRangeException(nameof(maximumDestructuringDepth)); _setMaximumDepth(maximumDestructuringDepth); return _loggerConfiguration; } diff --git a/src/Serilog/Configuration/LoggerEnrichmentConfiguration.cs b/src/Serilog/Configuration/LoggerEnrichmentConfiguration.cs index 33d153c24..c7f0f9eb1 100644 --- a/src/Serilog/Configuration/LoggerEnrichmentConfiguration.cs +++ b/src/Serilog/Configuration/LoggerEnrichmentConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -30,8 +30,8 @@ internal LoggerEnrichmentConfiguration( LoggerConfiguration loggerConfiguration, Action addEnricher) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - if (addEnricher == null) throw new ArgumentNullException("addEnricher"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); + if (addEnricher == null) throw new ArgumentNullException(nameof(addEnricher)); _loggerConfiguration = loggerConfiguration; _addEnricher = addEnricher; } @@ -45,7 +45,7 @@ internal LoggerEnrichmentConfiguration( /// Configuration object allowing method chaining. public LoggerConfiguration With(params ILogEventEnricher[] enrichers) { - if (enrichers == null) throw new ArgumentNullException("enrichers"); + if (enrichers == null) throw new ArgumentNullException(nameof(enrichers)); foreach (var logEventEnricher in enrichers) { if (logEventEnricher == null) diff --git a/src/Serilog/Configuration/LoggerFilterConfiguration.cs b/src/Serilog/Configuration/LoggerFilterConfiguration.cs index 4d5752e4c..a134b6ed1 100644 --- a/src/Serilog/Configuration/LoggerFilterConfiguration.cs +++ b/src/Serilog/Configuration/LoggerFilterConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -31,8 +31,8 @@ internal LoggerFilterConfiguration( LoggerConfiguration loggerConfiguration, Action addFilter) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - if (addFilter == null) throw new ArgumentNullException("addFilter"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); + if (addFilter == null) throw new ArgumentNullException(nameof(addFilter)); _loggerConfiguration = loggerConfiguration; _addFilter = addFilter; } @@ -45,7 +45,7 @@ internal LoggerFilterConfiguration( /// Configuration object allowing method chaining. public LoggerConfiguration With(params ILogEventFilter[] filters) { - if (filters == null) throw new ArgumentNullException("filters"); + if (filters == null) throw new ArgumentNullException(nameof(filters)); foreach (var logEventFilter in filters) { if (logEventFilter == null) diff --git a/src/Serilog/Configuration/LoggerMinimumLevelConfiguration.cs b/src/Serilog/Configuration/LoggerMinimumLevelConfiguration.cs index ebe323688..2148957a0 100644 --- a/src/Serilog/Configuration/LoggerMinimumLevelConfiguration.cs +++ b/src/Serilog/Configuration/LoggerMinimumLevelConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,8 +29,8 @@ public class LoggerMinimumLevelConfiguration internal LoggerMinimumLevelConfiguration(LoggerConfiguration loggerConfiguration, Action setMinimum, Action setLevelSwitch) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - if (setMinimum == null) throw new ArgumentNullException("setMinimum"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); + if (setMinimum == null) throw new ArgumentNullException(nameof(setMinimum)); _loggerConfiguration = loggerConfiguration; _setMinimum = setMinimum; _setLevelSwitch = setLevelSwitch; @@ -54,7 +54,7 @@ public LoggerConfiguration Is(LogEventLevel minimumLevel) /// Configuration object allowing method chaining. public LoggerConfiguration ControlledBy(LoggingLevelSwitch levelSwitch) { - if (levelSwitch == null) throw new ArgumentNullException("levelSwitch"); + if (levelSwitch == null) throw new ArgumentNullException(nameof(levelSwitch)); _setLevelSwitch(levelSwitch); return _loggerConfiguration; } diff --git a/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs b/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs deleted file mode 100644 index 77b64f1f9..000000000 --- a/src/Serilog/Configuration/LoggerSettingsConfiguration-net40.cs +++ /dev/null @@ -1,58 +0,0 @@ -// Copyright 2015 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using Serilog.Settings.KeyValuePairs; - -namespace Serilog.Configuration -{ - /// - /// Allows additional setting sources to drive the logger configuration. - /// - public class LoggerSettingsConfiguration - { - readonly LoggerConfiguration _loggerConfiguration; - - internal LoggerSettingsConfiguration(LoggerConfiguration loggerConfiguration) - { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - _loggerConfiguration = loggerConfiguration; - } - - /// - /// Apply external settings to the logger configuration. - /// - /// Configuration object allowing method chaining. - public LoggerConfiguration Settings(ILoggerSettings settings) - { - if (settings == null) throw new ArgumentNullException("settings"); - - settings.Configure(_loggerConfiguration); - - return _loggerConfiguration; - } - - /// - /// Apply settings specified in the Serilog key-value setting format to the logger configuration. - /// - /// A list of key-value pairs describing logger settings. - /// Configuration object allowing method chaining. - public LoggerConfiguration KeyValuePairs(IEnumerable> settings) - { - if (settings == null) throw new ArgumentNullException("settings"); - return Settings(new KeyValuePairSettings(settings)); - } - } -} diff --git a/src/Serilog/Configuration/LoggerSettingsConfiguration.cs b/src/Serilog/Configuration/LoggerSettingsConfiguration.cs index 77b64f1f9..2d9485b1c 100644 --- a/src/Serilog/Configuration/LoggerSettingsConfiguration.cs +++ b/src/Serilog/Configuration/LoggerSettingsConfiguration.cs @@ -27,7 +27,7 @@ public class LoggerSettingsConfiguration internal LoggerSettingsConfiguration(LoggerConfiguration loggerConfiguration) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); _loggerConfiguration = loggerConfiguration; } @@ -37,7 +37,7 @@ internal LoggerSettingsConfiguration(LoggerConfiguration loggerConfiguration) /// Configuration object allowing method chaining. public LoggerConfiguration Settings(ILoggerSettings settings) { - if (settings == null) throw new ArgumentNullException("settings"); + if (settings == null) throw new ArgumentNullException(nameof(settings)); settings.Configure(_loggerConfiguration); @@ -51,7 +51,7 @@ public LoggerConfiguration Settings(ILoggerSettings settings) /// Configuration object allowing method chaining. public LoggerConfiguration KeyValuePairs(IEnumerable> settings) { - if (settings == null) throw new ArgumentNullException("settings"); + if (settings == null) throw new ArgumentNullException(nameof(settings)); return Settings(new KeyValuePairSettings(settings)); } } diff --git a/src/Serilog/Configuration/LoggerSinkConfiguration.cs b/src/Serilog/Configuration/LoggerSinkConfiguration.cs index 3026728e2..c6fcfef6a 100644 --- a/src/Serilog/Configuration/LoggerSinkConfiguration.cs +++ b/src/Serilog/Configuration/LoggerSinkConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,9 +13,11 @@ // limitations under the License. using System; +using System.ComponentModel; using System.IO; using Serilog.Core; using Serilog.Core.Sinks; +using Serilog.Debugging; using Serilog.Events; using Serilog.Formatting.Display; using Serilog.Sinks.IOTextWriter; @@ -35,8 +37,8 @@ public class LoggerSinkConfiguration internal LoggerSinkConfiguration(LoggerConfiguration loggerConfiguration, Action addSink) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - if (addSink == null) throw new ArgumentNullException("addSink"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); + if (addSink == null) throw new ArgumentNullException(nameof(addSink)); _loggerConfiguration = loggerConfiguration; _addSink = addSink; } @@ -48,13 +50,44 @@ internal LoggerSinkConfiguration(LoggerConfiguration loggerConfiguration, Action /// The minimum level for /// events passed through the sink. /// Configuration object allowing method chaining. + /// Provided for binary compatibility for earlier versions, + /// should be removed in 2.0. Not marked obsolete because warnings + /// would be syntactically annoying to avoid. + [EditorBrowsable(EditorBrowsableState.Never)] public LoggerConfiguration Sink( ILogEventSink logEventSink, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) + LogEventLevel restrictedToMinimumLevel) + { + return Sink(logEventSink, restrictedToMinimumLevel, null); + } + + /// + /// Write log events to the specified . + /// + /// The sink. + /// The minimum level for + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. + /// Configuration object allowing method chaining. + public LoggerConfiguration Sink( + ILogEventSink logEventSink, + LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + // ReSharper disable once MethodOverloadWithOptionalParameter + LoggingLevelSwitch levelSwitch = null) { var sink = logEventSink; - if (restrictedToMinimumLevel > LevelAlias.Minimum) - sink = new RestrictedSink(sink, restrictedToMinimumLevel); + if (levelSwitch != null) + { + if (restrictedToMinimumLevel != LevelAlias.Minimum) + SelfLog.WriteLine("Sink {0} was configured with both a level switch and minimum level '{1}'; the minimum level will be ignored and the switch level used", sink, restrictedToMinimumLevel); + + sink = new RestrictedSink(sink, levelSwitch); + } + else if (restrictedToMinimumLevel > LevelAlias.Minimum) + { + sink = new RestrictedSink(sink, new LoggingLevelSwitch(restrictedToMinimumLevel)); + } _addSink(sink); return _loggerConfiguration; @@ -65,12 +98,16 @@ public LoggerConfiguration Sink( /// /// The sink. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// Configuration object allowing method chaining. - public LoggerConfiguration Sink(LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) + public LoggerConfiguration Sink( + LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + LoggingLevelSwitch levelSwitch = null) where TSink : ILogEventSink, new() { - return Sink(new TSink(), restrictedToMinimumLevel); + return Sink(new TSink(), restrictedToMinimumLevel, levelSwitch); } /// @@ -79,7 +116,9 @@ public LoggerConfiguration Sink(LogEventLevel restrictedToMinimumLevel = /// The text writer to write log events to. /// Message template describing the output format. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// Configuration object allowing method chaining. /// Supplies culture-specific formatting information, or null. /// @@ -87,14 +126,15 @@ public LoggerConfiguration TextWriter( TextWriter textWriter, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, string outputTemplate = DefaultOutputTemplate, - IFormatProvider formatProvider = null) + IFormatProvider formatProvider = null, + LoggingLevelSwitch levelSwitch = null) { - if (textWriter == null) throw new ArgumentNullException("textWriter"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (textWriter == null) throw new ArgumentNullException(nameof(textWriter)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); var sink = new TextWriterSink(textWriter, formatter); - return Sink(sink, restrictedToMinimumLevel); + return Sink(sink, restrictedToMinimumLevel, levelSwitch); } /// @@ -105,13 +145,16 @@ public LoggerConfiguration TextWriter( /// /// An action that configures the sub-logger. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// Configuration object allowing method chaining. public LoggerConfiguration Logger( Action configureLogger, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) + LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + LoggingLevelSwitch levelSwitch = null) { - if (configureLogger == null) throw new ArgumentNullException("configureLogger"); + if (configureLogger == null) throw new ArgumentNullException(nameof(configureLogger)); var lc = new LoggerConfiguration(); configureLogger(lc); return Sink(new SecondaryLoggerSink(lc.CreateLogger(), attemptDispose: true), restrictedToMinimumLevel); @@ -132,7 +175,7 @@ public LoggerConfiguration Logger( ILogger logger, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { - if (logger == null) throw new ArgumentNullException("logger"); + if (logger == null) throw new ArgumentNullException(nameof(logger)); return Sink(new SecondaryLoggerSink(logger, attemptDispose: false), restrictedToMinimumLevel); } @@ -142,16 +185,19 @@ public LoggerConfiguration Logger( /// An action that provides an observable /// to which observers can subscribe. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// Configuration object allowing method chaining. public LoggerConfiguration Observers( Action> configureObservers, - LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) + LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, + LoggingLevelSwitch levelSwitch = null) { - if (configureObservers == null) throw new ArgumentNullException("configureObservers"); + if (configureObservers == null) throw new ArgumentNullException(nameof(configureObservers)); var observable = new ObservableSink(); configureObservers(observable); - return Sink(observable, restrictedToMinimumLevel); + return Sink(observable, restrictedToMinimumLevel, levelSwitch); } } } diff --git a/src/Serilog.FullNetFx/Context/ImmutableStack.cs b/src/Serilog/Context/ImmutableStack.cs similarity index 93% rename from src/Serilog.FullNetFx/Context/ImmutableStack.cs rename to src/Serilog/Context/ImmutableStack.cs index 237cf2ef2..01d12f973 100644 --- a/src/Serilog.FullNetFx/Context/ImmutableStack.cs +++ b/src/Serilog/Context/ImmutableStack.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if !ASPNETCORE50 +#if !PROFILE259 && !DNXCORE50 using System; using System.Collections.Generic; using System.Runtime.Serialization; @@ -40,7 +40,7 @@ public ImmutableStack(SerializationInfo info, StreamingContext context) ImmutableStack(ImmutableStack under, T top) { - if (under == null) throw new ArgumentNullException("under"); + if (under == null) throw new ArgumentNullException(nameof(under)); _under = under; _count = under.Count + 1; _top = top; diff --git a/src/Serilog.FullNetFx/Context/LogContext.cs b/src/Serilog/Context/LogContext.cs similarity index 98% rename from src/Serilog.FullNetFx/Context/LogContext.cs rename to src/Serilog/Context/LogContext.cs index 21ed80f03..52f61af4c 100644 --- a/src/Serilog.FullNetFx/Context/LogContext.cs +++ b/src/Serilog/Context/LogContext.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if !ASPNETCORE50 +#if !PROFILE259 && !DNXCORE50 using System; using System.Runtime.Remoting.Messaging; using Serilog.Core; @@ -89,7 +89,7 @@ public static IDisposable PushProperty(string name, object value, bool destructu /// public static IDisposable PushProperties(params ILogEventEnricher[] properties) { - if (properties == null) throw new ArgumentNullException("properties"); + if (properties == null) throw new ArgumentNullException(nameof(properties)); var stack = GetOrCreateEnricherStack(); var bookmark = new ContextStackBookmark(stack); diff --git a/src/Serilog/Core/Constants.cs b/src/Serilog/Core/Constants.cs index cce7dc064..bf1eec71c 100644 --- a/src/Serilog/Core/Constants.cs +++ b/src/Serilog/Core/Constants.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/Enrichers/FixedPropertyEnricher.cs b/src/Serilog/Core/Enrichers/FixedPropertyEnricher.cs index bd830c767..899493410 100644 --- a/src/Serilog/Core/Enrichers/FixedPropertyEnricher.cs +++ b/src/Serilog/Core/Enrichers/FixedPropertyEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,13 +23,13 @@ class FixedPropertyEnricher : ILogEventEnricher public FixedPropertyEnricher(LogEventProperty logEventProperty) { - if (logEventProperty == null) throw new ArgumentNullException("logEventProperty"); + if (logEventProperty == null) throw new ArgumentNullException(nameof(logEventProperty)); _logEventProperty = logEventProperty; } public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); logEvent.AddPropertyIfAbsent(_logEventProperty); } } diff --git a/src/Serilog/Core/Enrichers/PropertyEnricher.cs b/src/Serilog/Core/Enrichers/PropertyEnricher.cs index 0319db8d1..35f5147a2 100644 --- a/src/Serilog/Core/Enrichers/PropertyEnricher.cs +++ b/src/Serilog/Core/Enrichers/PropertyEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public class PropertyEnricher : ILogEventEnricher /// public PropertyEnricher(string name, object value, bool destructureObjects = false) { - if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Property name must not be null or empty.", "name"); + if (string.IsNullOrWhiteSpace(name)) throw new ArgumentException("Property name must not be null or empty.", nameof(name)); _name = name; _value = value; _destructureObjects = destructureObjects; @@ -52,8 +52,8 @@ public PropertyEnricher(string name, object value, bool destructureObjects = fal /// Factory for creating new properties to add to the event. public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - if (propertyFactory == null) throw new ArgumentNullException("propertyFactory"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); + if (propertyFactory == null) throw new ArgumentNullException(nameof(propertyFactory)); var property = propertyFactory.CreateProperty(_name, _value, _destructureObjects); logEvent.AddPropertyIfAbsent(property); } diff --git a/src/Serilog/Core/Filters/DelegateFilter.cs b/src/Serilog/Core/Filters/DelegateFilter.cs index b076e1a92..76a976337 100644 --- a/src/Serilog/Core/Filters/DelegateFilter.cs +++ b/src/Serilog/Core/Filters/DelegateFilter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,13 +23,13 @@ class DelegateFilter : ILogEventFilter public DelegateFilter(Func isEnabled) { - if (isEnabled == null) throw new ArgumentNullException("isEnabled"); + if (isEnabled == null) throw new ArgumentNullException(nameof(isEnabled)); _isEnabled = isEnabled; } public bool IsEnabled(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); return _isEnabled(logEvent); } } diff --git a/src/Serilog/Core/IDestructuringPolicy.cs b/src/Serilog/Core/IDestructuringPolicy.cs index 4e9e57d6d..774cb9969 100644 --- a/src/Serilog/Core/IDestructuringPolicy.cs +++ b/src/Serilog/Core/IDestructuringPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/ILogEventEnricher.cs b/src/Serilog/Core/ILogEventEnricher.cs index 6cd5f7680..53f76834e 100644 --- a/src/Serilog/Core/ILogEventEnricher.cs +++ b/src/Serilog/Core/ILogEventEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/ILogEventFilter.cs b/src/Serilog/Core/ILogEventFilter.cs index cbf793883..5fcdda2b3 100644 --- a/src/Serilog/Core/ILogEventFilter.cs +++ b/src/Serilog/Core/ILogEventFilter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/ILogEventPropertyFactory.cs b/src/Serilog/Core/ILogEventPropertyFactory.cs index 2340df6a0..56d707b37 100644 --- a/src/Serilog/Core/ILogEventPropertyFactory.cs +++ b/src/Serilog/Core/ILogEventPropertyFactory.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/ILogEventSink.cs b/src/Serilog/Core/ILogEventSink.cs index cf917d189..eee6b9e13 100644 --- a/src/Serilog/Core/ILogEventSink.cs +++ b/src/Serilog/Core/ILogEventSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/IMessageTemplateParser.cs b/src/Serilog/Core/IMessageTemplateParser.cs index 0cdf8fdfa..63ad9ed03 100644 --- a/src/Serilog/Core/IMessageTemplateParser.cs +++ b/src/Serilog/Core/IMessageTemplateParser.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/LoggingLevelSwitch.cs b/src/Serilog/Core/LoggingLevelSwitch.cs index 8a1e1ef13..34a058b65 100644 --- a/src/Serilog/Core/LoggingLevelSwitch.cs +++ b/src/Serilog/Core/LoggingLevelSwitch.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/Pipeline/Logger.cs b/src/Serilog/Core/Pipeline/Logger.cs index 732c4089a..681402f93 100644 --- a/src/Serilog/Core/Pipeline/Logger.cs +++ b/src/Serilog/Core/Pipeline/Logger.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -65,8 +65,8 @@ public Logger( Action dispose = null, LoggingLevelSwitch levelSwitch = null) { - if (sink == null) throw new ArgumentNullException("sink"); - if (enrichers == null) throw new ArgumentNullException("enrichers"); + if (sink == null) throw new ArgumentNullException(nameof(sink)); + if (enrichers == null) throw new ArgumentNullException(nameof(enrichers)); _messageTemplateProcessor = messageTemplateProcessor; _minimumLevel = minimumLevel; @@ -96,7 +96,7 @@ public ILogger ForContext(string propertyName, object value, bool destructureObj public ILogger ForContext(Type source) { - if (source == null) throw new ArgumentNullException("source"); + if (source == null) throw new ArgumentNullException(nameof(source)); return ForContext(Constants.SourceContextPropertyName, source.FullName); } @@ -150,7 +150,7 @@ public void Write(LogEvent logEvent) public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); Write(logEvent); } diff --git a/src/Serilog/Core/Pipeline/MessageTemplateCache.cs b/src/Serilog/Core/Pipeline/MessageTemplateCache.cs index e53d527b2..c369614d9 100644 --- a/src/Serilog/Core/Pipeline/MessageTemplateCache.cs +++ b/src/Serilog/Core/Pipeline/MessageTemplateCache.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,13 +29,13 @@ class MessageTemplateCache : IMessageTemplateParser public MessageTemplateCache(IMessageTemplateParser innerParser) { - if (innerParser == null) throw new ArgumentNullException("innerParser"); + if (innerParser == null) throw new ArgumentNullException(nameof(innerParser)); _innerParser = innerParser; } public MessageTemplate Parse(string messageTemplate) { - if (messageTemplate == null) throw new ArgumentNullException("messageTemplate"); + if (messageTemplate == null) throw new ArgumentNullException(nameof(messageTemplate)); if (messageTemplate.Length > MaxCachedTemplateLength) return _innerParser.Parse(messageTemplate); diff --git a/src/Serilog/Core/Pipeline/SilentLogger.cs b/src/Serilog/Core/Pipeline/SilentLogger.cs index 0abe3bbb7..114b8845e 100644 --- a/src/Serilog/Core/Pipeline/SilentLogger.cs +++ b/src/Serilog/Core/Pipeline/SilentLogger.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Core/Sinks/FilteringSink.cs b/src/Serilog/Core/Sinks/FilteringSink.cs index 645f20d40..c2fe7cb71 100644 --- a/src/Serilog/Core/Sinks/FilteringSink.cs +++ b/src/Serilog/Core/Sinks/FilteringSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ class FilteringSink : ILogEventSink public FilteringSink(ILogEventSink sink, IEnumerable filters) { - if (sink == null) throw new ArgumentNullException("sink"); - if (filters == null) throw new ArgumentNullException("filters"); + if (sink == null) throw new ArgumentNullException(nameof(sink)); + if (filters == null) throw new ArgumentNullException(nameof(filters)); _sink = sink; _filters = filters.ToArray(); } diff --git a/src/Serilog/Core/Sinks/RestrictedSink.cs b/src/Serilog/Core/Sinks/RestrictedSink.cs index ee082c93b..d1e1a6933 100644 --- a/src/Serilog/Core/Sinks/RestrictedSink.cs +++ b/src/Serilog/Core/Sinks/RestrictedSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,20 +20,21 @@ namespace Serilog.Core.Sinks class RestrictedSink : ILogEventSink { readonly ILogEventSink _sink; - readonly LogEventLevel _restrictedMinimumLevel; + readonly LoggingLevelSwitch _levelSwitch; - public RestrictedSink(ILogEventSink sink, LogEventLevel restrictedMinimumLevel) + public RestrictedSink(ILogEventSink sink, LoggingLevelSwitch levelSwitch) { - if (sink == null) throw new ArgumentNullException("sink"); + if (sink == null) throw new ArgumentNullException(nameof(sink)); + if (levelSwitch == null) throw new ArgumentNullException(nameof(levelSwitch)); _sink = sink; - _restrictedMinimumLevel = restrictedMinimumLevel; + _levelSwitch = levelSwitch; } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); - if (logEvent.Level < _restrictedMinimumLevel) + if ((int)logEvent.Level < (int)_levelSwitch.MinimumLevel) return; _sink.Emit(logEvent); diff --git a/src/Serilog/Core/Sinks/SafeAggregateSink.cs b/src/Serilog/Core/Sinks/SafeAggregateSink.cs index e9f2d65d7..c406ee6b0 100644 --- a/src/Serilog/Core/Sinks/SafeAggregateSink.cs +++ b/src/Serilog/Core/Sinks/SafeAggregateSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,7 +25,7 @@ class SafeAggregateSink : ILogEventSink public SafeAggregateSink(IEnumerable sinks) { - if (sinks == null) throw new ArgumentNullException("sinks"); + if (sinks == null) throw new ArgumentNullException(nameof(sinks)); _sinks = sinks; } diff --git a/src/Serilog/Core/Sinks/SecondaryLoggerSink.cs b/src/Serilog/Core/Sinks/SecondaryLoggerSink.cs index 3239dd09a..d416f4560 100644 --- a/src/Serilog/Core/Sinks/SecondaryLoggerSink.cs +++ b/src/Serilog/Core/Sinks/SecondaryLoggerSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -32,14 +32,14 @@ sealed class SecondaryLoggerSink : ILogEventSink, IDisposable public SecondaryLoggerSink(ILogger logger, bool attemptDispose = false) { - if (logger == null) throw new ArgumentNullException("logger"); + if (logger == null) throw new ArgumentNullException(nameof(logger)); _logger = logger; _attemptDispose = attemptDispose; } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); var copy = new LogEvent( logEvent.Timestamp, diff --git a/src/Serilog/Debugging/LoggingFailedException.cs b/src/Serilog/Debugging/LoggingFailedException.cs index 8bcfc6f10..bd47060d1 100644 --- a/src/Serilog/Debugging/LoggingFailedException.cs +++ b/src/Serilog/Debugging/LoggingFailedException.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Debugging/SelfLog.cs b/src/Serilog/Debugging/SelfLog.cs index 205c82437..c38959637 100644 --- a/src/Serilog/Debugging/SelfLog.cs +++ b/src/Serilog/Debugging/SelfLog.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ public static class SelfLog /// /// SelfLog.Out = Console.Error; /// + // ReSharper disable once MemberCanBePrivate.Global, UnusedAutoPropertyAccessor.Global public static TextWriter Out { get; set; } /// diff --git a/src/Serilog.FullNetFx/Enrichers/EnvironmentUserNameEnricher.cs b/src/Serilog/Enrichers/EnvironmentUserNameEnricher.cs similarity index 92% rename from src/Serilog.FullNetFx/Enrichers/EnvironmentUserNameEnricher.cs rename to src/Serilog/Enrichers/EnvironmentUserNameEnricher.cs index 81ba56b0d..710cad5bd 100644 --- a/src/Serilog.FullNetFx/Enrichers/EnvironmentUserNameEnricher.cs +++ b/src/Serilog/Enrichers/EnvironmentUserNameEnricher.cs @@ -12,6 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !PROFILE259 + using System; using Serilog.Core; using Serilog.Events; @@ -43,16 +45,16 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) private static string GetEnvironmentUserName() { -#if !ASPNETCORE50 +#if !DNXCORE50 var userDomainName = Environment.UserDomainName; var userName = Environment.UserName; #else var userDomainName = Environment.GetEnvironmentVariable("USERNAME"); var userName = Environment.GetEnvironmentVariable("USERDOMAIN"); #endif - return !string.IsNullOrWhiteSpace(userDomainName) - ? string.Format(@"{0}\{1}", userDomainName, userName) - : userName; + return !string.IsNullOrWhiteSpace(userDomainName) ? $@"{userDomainName}\{userName}" : userName; } } } + +#endif diff --git a/src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs b/src/Serilog/Enrichers/LogContextEnricher.cs similarity index 92% rename from src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs rename to src/Serilog/Enrichers/LogContextEnricher.cs index f464ace27..e6c21f680 100644 --- a/src/Serilog.FullNetFx/Enrichers/LogContextEnricher.cs +++ b/src/Serilog/Enrichers/LogContextEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if !ASPNETCORE50 +#if !PROFILE259 && !DNXCORE50 using Serilog.Context; using Serilog.Core; using Serilog.Events; diff --git a/src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs b/src/Serilog/Enrichers/MachineNameEnricher.cs similarity index 95% rename from src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs rename to src/Serilog/Enrichers/MachineNameEnricher.cs index f6be9a7af..efc627285 100644 --- a/src/Serilog.FullNetFx/Enrichers/MachineNameEnricher.cs +++ b/src/Serilog/Enrichers/MachineNameEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ using Serilog.Core; using Serilog.Events; +#if !PROFILE259 namespace Serilog.Enrichers { /// @@ -37,7 +38,7 @@ public class MachineNameEnricher : ILogEventEnricher /// Factory for creating new properties to add to the event. public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { -#if !ASPNETCORE50 +#if !DNXCORE50 _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.MachineName); #else _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(MachineNamePropertyName, Environment.GetEnvironmentVariable("COMPUTERNAME")); @@ -46,3 +47,4 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) } } } +#endif diff --git a/src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs b/src/Serilog/Enrichers/ProcessIdEnricher.cs similarity index 87% rename from src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs rename to src/Serilog/Enrichers/ProcessIdEnricher.cs index 3a58d7947..6dbf681ca 100644 --- a/src/Serilog.FullNetFx/Enrichers/ProcessIdEnricher.cs +++ b/src/Serilog/Enrichers/ProcessIdEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,14 +12,14 @@ // See the License for the specific language governing permissions and // limitations under the License. -using System.Diagnostics; using Serilog.Core; using Serilog.Events; +#if !PROFILE259 namespace Serilog.Enrichers { /// - /// Enriches log events with a ProcessId property containing the current . + /// Enriches log events with a ProcessId property containing the current . /// public class ProcessIdEnricher : ILogEventEnricher { @@ -37,8 +37,9 @@ public class ProcessIdEnricher : ILogEventEnricher /// Factory for creating new properties to add to the event. public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) { - _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(ProcessIdPropertyName, Process.GetCurrentProcess().Id); + _cachedProperty = _cachedProperty ?? propertyFactory.CreateProperty(ProcessIdPropertyName, System.Diagnostics.Process.GetCurrentProcess().Id); logEvent.AddPropertyIfAbsent(_cachedProperty); } } } +#endif diff --git a/src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs b/src/Serilog/Enrichers/ThreadIdEnricher.cs similarity index 95% rename from src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs rename to src/Serilog/Enrichers/ThreadIdEnricher.cs index f2cb9cf3f..429c2df4d 100644 --- a/src/Serilog.FullNetFx/Enrichers/ThreadIdEnricher.cs +++ b/src/Serilog/Enrichers/ThreadIdEnricher.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ using Serilog.Core; using Serilog.Events; +#if !PROFILE259 namespace Serilog.Enrichers { /// @@ -39,3 +40,4 @@ public void Enrich(LogEvent logEvent, ILogEventPropertyFactory propertyFactory) } } } +#endif diff --git a/src/Serilog/Events/DictionaryValue-net40.cs b/src/Serilog/Events/DictionaryValue-net40.cs deleted file mode 100644 index 39d718a03..000000000 --- a/src/Serilog/Events/DictionaryValue-net40.cs +++ /dev/null @@ -1,71 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Serilog.Events -{ - /// - /// A value represented as a mapping from keys to values. - /// - public class DictionaryValue : LogEventPropertyValue - { - readonly IDictionary _elements; - - /// - /// Create a with the provided . - /// - /// The key-value mappings represented in the dictionary. - /// - public DictionaryValue(IEnumerable> elements) - { - if (elements == null) throw new ArgumentNullException("elements"); - _elements = elements.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - } - - /// - /// The dictionary mapping. - /// - public IDictionary Elements { get { return _elements; } } - - /// - /// Render the value to the output. - /// - /// The output. - /// A format string applied to the value, or null. - /// A format provider to apply to the value, or null to use the default. - /// . - public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) - { - if (output == null) throw new ArgumentNullException("output"); - - output.Write('['); - var delim = "("; - foreach (var kvp in _elements) - { - output.Write(delim); - delim = ", ("; - kvp.Key.Render(output, null, formatProvider); - output.Write(": "); - kvp.Value.Render(output, null, formatProvider); - output.Write(")"); - } - - output.Write(']'); - } - } -} diff --git a/src/Serilog/Events/DictionaryValue.cs b/src/Serilog/Events/DictionaryValue.cs index e1403bef0..5ca23fe4f 100644 --- a/src/Serilog/Events/DictionaryValue.cs +++ b/src/Serilog/Events/DictionaryValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,12 @@ using System.IO; using System.Linq; +#if NET40 +using IScalarDictionary = System.Collections.Generic.IDictionary; +#else +using IScalarDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Events { /// @@ -24,7 +30,7 @@ namespace Serilog.Events /// public class DictionaryValue : LogEventPropertyValue { - readonly IReadOnlyDictionary _elements; + readonly IScalarDictionary _elements; /// /// Create a with the provided . @@ -33,14 +39,14 @@ public class DictionaryValue : LogEventPropertyValue /// public DictionaryValue(IEnumerable> elements) { - if (elements == null) throw new ArgumentNullException("elements"); + if (elements == null) throw new ArgumentNullException(nameof(elements)); _elements = elements.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); } /// /// The dictionary mapping. /// - public IReadOnlyDictionary Elements { get { return _elements; } } + public IScalarDictionary Elements { get { return _elements; } } /// /// Render the value to the output. @@ -51,7 +57,7 @@ public DictionaryValue(IEnumerable. public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) { - if (output == null) throw new ArgumentNullException("output"); + if (output == null) throw new ArgumentNullException(nameof(output)); output.Write('['); var delim = "("; diff --git a/src/Serilog/Events/LevelAlias.cs b/src/Serilog/Events/LevelAlias.cs index cbf291be3..d850654c1 100644 --- a/src/Serilog/Events/LevelAlias.cs +++ b/src/Serilog/Events/LevelAlias.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Events/LogEvent-net40.cs b/src/Serilog/Events/LogEvent-net40.cs deleted file mode 100644 index 4bb155ba1..000000000 --- a/src/Serilog/Events/LogEvent-net40.cs +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; - -namespace Serilog.Events -{ - /// - /// A log event. - /// - public class LogEvent - { - readonly DateTimeOffset _timestamp; - readonly LogEventLevel _level; - readonly Exception _exception; - readonly MessageTemplate _messageTemplate; - readonly Dictionary _properties; - - /// - /// Construct a new . - /// - /// The time at which the event occurred. - /// The level of the event. - /// An exception associated with the event, or null. - /// The message template describing the event. - /// Properties associated with the event, including those presented in . - public LogEvent(DateTimeOffset timestamp, LogEventLevel level, Exception exception, MessageTemplate messageTemplate, IEnumerable properties) - { - if (messageTemplate == null) throw new ArgumentNullException("messageTemplate"); - if (properties == null) throw new ArgumentNullException("properties"); - _timestamp = timestamp; - _level = level; - _exception = exception; - _messageTemplate = messageTemplate; - _properties = new Dictionary(); - foreach (var p in properties) - AddOrUpdateProperty(p); - } - - /// - /// The time at which the event occurred. - /// - public DateTimeOffset Timestamp - { - get { return _timestamp; } - } - - /// - /// The level of the event. - /// - public LogEventLevel Level - { - get { return _level; } - } - - /// - /// The message template describing the event. - /// - public MessageTemplate MessageTemplate - { - get { return _messageTemplate; } - } - - /// - /// Render the message template to the specified output, given the properties associated - /// with the event. - /// - /// The output. - /// Supplies culture-specific formatting information, or null. - public void RenderMessage(TextWriter output, IFormatProvider formatProvider = null) - { - MessageTemplate.Render(Properties, output, formatProvider); - } - - /// - /// Render the message template given the properties associated - /// with the event, and return the result. - /// - /// Supplies culture-specific formatting information, or null. - public string RenderMessage(IFormatProvider formatProvider = null) - { - return MessageTemplate.Render(Properties, formatProvider); - } - - /// - /// Properties associated with the event, including those presented in . - /// - public IDictionary Properties - { - get { return _properties; } - } - - /// - /// An exception associated with the event, or null. - /// - public Exception Exception - { - get { return _exception; } - } - - /// - /// Add a property to the event if not already present, otherwise, update its value. - /// - /// The property to add or update. - /// - public void AddOrUpdateProperty(LogEventProperty property) - { - if (property == null) throw new ArgumentNullException("property"); - _properties[property.Name] = property.Value; - } - - /// - /// Add a property to the event if not already present. - /// - /// The property to add. - /// - public void AddPropertyIfAbsent(LogEventProperty property) - { - if (property == null) throw new ArgumentNullException("property"); - if (!_properties.ContainsKey(property.Name)) - _properties.Add(property.Name, property.Value); - } - - /// - /// Remove a property from the event, if present. Otherwise no action - /// is performed. - /// - /// The name of the property to remove. - public void RemovePropertyIfPresent(string propertyName) - { - _properties.Remove(propertyName); - } - } -} \ No newline at end of file diff --git a/src/Serilog/Events/LogEvent.cs b/src/Serilog/Events/LogEvent.cs index d2e87d21e..7eccff9cd 100644 --- a/src/Serilog/Events/LogEvent.cs +++ b/src/Serilog/Events/LogEvent.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,12 @@ using System.Collections.Generic; using System.IO; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Events { /// @@ -39,8 +45,8 @@ public class LogEvent /// Properties associated with the event, including those presented in . public LogEvent(DateTimeOffset timestamp, LogEventLevel level, Exception exception, MessageTemplate messageTemplate, IEnumerable properties) { - if (messageTemplate == null) throw new ArgumentNullException("messageTemplate"); - if (properties == null) throw new ArgumentNullException("properties"); + if (messageTemplate == null) throw new ArgumentNullException(nameof(messageTemplate)); + if (properties == null) throw new ArgumentNullException(nameof(properties)); _timestamp = timestamp; _level = level; _exception = exception; @@ -98,7 +104,7 @@ public string RenderMessage(IFormatProvider formatProvider = null) /// /// Properties associated with the event, including those presented in . /// - public IReadOnlyDictionary Properties + public IPropertyDictionary Properties { get { return _properties; } } @@ -118,7 +124,7 @@ public Exception Exception /// public void AddOrUpdateProperty(LogEventProperty property) { - if (property == null) throw new ArgumentNullException("property"); + if (property == null) throw new ArgumentNullException(nameof(property)); _properties[property.Name] = property.Value; } @@ -129,7 +135,7 @@ public void AddOrUpdateProperty(LogEventProperty property) /// public void AddPropertyIfAbsent(LogEventProperty property) { - if (property == null) throw new ArgumentNullException("property"); + if (property == null) throw new ArgumentNullException(nameof(property)); if (!_properties.ContainsKey(property.Name)) _properties.Add(property.Name, property.Value); } diff --git a/src/Serilog/Events/LogEventLevel.cs b/src/Serilog/Events/LogEventLevel.cs index 9642abdfb..9ab996748 100644 --- a/src/Serilog/Events/LogEventLevel.cs +++ b/src/Serilog/Events/LogEventLevel.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Events/LogEventProperty.cs b/src/Serilog/Events/LogEventProperty.cs index d8f3e9046..46fe2fca2 100644 --- a/src/Serilog/Events/LogEventProperty.cs +++ b/src/Serilog/Events/LogEventProperty.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ public class LogEventProperty /// public LogEventProperty(string name, LogEventPropertyValue value) { - if (value == null) throw new ArgumentNullException("value"); + if (value == null) throw new ArgumentNullException(nameof(value)); if (!IsValidName(name)) throw new ArgumentException("Property name is not valid."); diff --git a/src/Serilog/Events/LogEventPropertyValue.cs b/src/Serilog/Events/LogEventPropertyValue.cs index 8979b004e..0063242bd 100644 --- a/src/Serilog/Events/LogEventPropertyValue.cs +++ b/src/Serilog/Events/LogEventPropertyValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Events/MessageTemplate-net40.cs b/src/Serilog/Events/MessageTemplate-net40.cs deleted file mode 100644 index bd44f190b..000000000 --- a/src/Serilog/Events/MessageTemplate-net40.cs +++ /dev/null @@ -1,157 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using Serilog.Debugging; -using Serilog.Parsing; - -namespace Serilog.Events -{ - /// - /// Represents a message template passed to a log method. The template - /// can subsequently render the template in textual form given the list - /// of properties. - /// - public class MessageTemplate - { - readonly string _text; - readonly MessageTemplateToken[] _tokens; - - // Optimisation for when the template is bound to - // property values. - readonly PropertyToken[] _positionalProperties; - readonly PropertyToken[] _namedProperties; - - /// - /// Construct a message template using manually-defined text and property tokens. - /// - /// The text and property tokens defining the template. - public MessageTemplate(IEnumerable tokens) - : this(string.Join("", tokens), tokens) - { - } - - /// - /// Construct a message template using manually-defined text and property tokens. - /// - /// The full text of the template; used by Serilog internally to avoid unneeded - /// string concatenation. - /// The text and property tokens defining the template. - public MessageTemplate(string text, IEnumerable tokens) - { - if (text == null) throw new ArgumentNullException("text"); - if (tokens == null) throw new ArgumentNullException("tokens"); - - _text = text; - _tokens = tokens.ToArray(); - - var propertyTokens = _tokens.OfType().ToArray(); - if (propertyTokens.Length != 0) - { - var allPositional = true; - var anyPositional = false; - foreach (var propertyToken in propertyTokens) - { - if (propertyToken.IsPositional) - anyPositional = true; - else - allPositional = false; - } - - if (allPositional) - { - _positionalProperties = propertyTokens; - } - else - { - if (anyPositional) - SelfLog.WriteLine("Message template is malformed: {0}", text); - - _namedProperties = propertyTokens; - } - } - } - - /// - /// The raw text describing the template. - /// - public string Text - { - get { return _text; } - } - - /// - /// Render the template as a string. - /// - /// The string representation of the template. - public override string ToString() - { - return Text; - } - - /// - /// The tokens parsed from the template. - /// - public IEnumerable Tokens - { - get { return _tokens; } - } - - internal PropertyToken[] NamedProperties - { - get { return _namedProperties; } - } - - internal PropertyToken[] PositionalProperties - { - get { return _positionalProperties; } - } - - /// - /// Convert the message template into a textual message, given the - /// properties matching the tokens in the message template. - /// - /// Properties matching template tokens. - /// Supplies culture-specific formatting information, or null. - /// The message created from the template and properties. If the - /// properties are mismatched with the template, the template will be - /// returned with incomplete substitution. - public string Render(IDictionary properties, IFormatProvider formatProvider = null) - { - var writer = new StringWriter(formatProvider); - Render(properties, writer, formatProvider); - return writer.ToString(); - } - - /// - /// Convert the message template into a textual message, given the - /// properties matching the tokens in the message template. - /// - /// Properties matching template tokens. - /// The message created from the template and properties. If the - /// properties are mismatched with the template, the template will be - /// returned with incomplete substitution. - /// Supplies culture-specific formatting information, or null. - public void Render(IDictionary properties, TextWriter output, IFormatProvider formatProvider = null) - { - foreach (var token in _tokens) - { - token.Render(properties, output, formatProvider); - } - } - } -} \ No newline at end of file diff --git a/src/Serilog/Events/MessageTemplate.cs b/src/Serilog/Events/MessageTemplate.cs index f09f3aa23..d1d0f5f79 100644 --- a/src/Serilog/Events/MessageTemplate.cs +++ b/src/Serilog/Events/MessageTemplate.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,6 +19,12 @@ using Serilog.Debugging; using Serilog.Parsing; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Events { /// @@ -53,8 +59,8 @@ public MessageTemplate(IEnumerable tokens) /// The text and property tokens defining the template. public MessageTemplate(string text, IEnumerable tokens) { - if (text == null) throw new ArgumentNullException("text"); - if (tokens == null) throw new ArgumentNullException("tokens"); + if (text == null) throw new ArgumentNullException(nameof(text)); + if (tokens == null) throw new ArgumentNullException(nameof(tokens)); _text = text; _tokens = tokens.ToArray(); @@ -130,7 +136,7 @@ internal PropertyToken[] PositionalProperties /// The message created from the template and properties. If the /// properties are mismatched with the template, the template will be /// returned with incomplete substitution. - public string Render(IReadOnlyDictionary properties, IFormatProvider formatProvider = null) + public string Render(IPropertyDictionary properties, IFormatProvider formatProvider = null) { var writer = new StringWriter(formatProvider); Render(properties, writer, formatProvider); @@ -146,7 +152,7 @@ public string Render(IReadOnlyDictionary properti /// properties are mismatched with the template, the template will be /// returned with incomplete substitution. /// Supplies culture-specific formatting information, or null. - public void Render(IReadOnlyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) + public void Render(IPropertyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) { foreach (var token in _tokens) { diff --git a/src/Serilog/Events/ScalarValue.cs b/src/Serilog/Events/ScalarValue.cs index 106d0b044..c6c66cbee 100644 --- a/src/Serilog/Events/ScalarValue.cs +++ b/src/Serilog/Events/ScalarValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ public ScalarValue(object value) /// . public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) { - if (output == null) throw new ArgumentNullException("output"); + if (output == null) throw new ArgumentNullException(nameof(output)); if (_value == null) { diff --git a/src/Serilog/Events/SequenceValue-net40.cs b/src/Serilog/Events/SequenceValue-net40.cs deleted file mode 100644 index 5d509f18b..000000000 --- a/src/Serilog/Events/SequenceValue-net40.cs +++ /dev/null @@ -1,70 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Serilog.Events -{ - /// - /// A value represented as an ordered sequence of values. - /// - public class SequenceValue : LogEventPropertyValue - { - readonly LogEventPropertyValue[] _elements; - - /// - /// Create a with the provided . - /// - /// The elements of the sequence. - /// - public SequenceValue(IEnumerable elements) - { - if (elements == null) throw new ArgumentNullException("elements"); - _elements = elements.ToArray(); - } - - /// - /// The elements of the sequence. - /// - public IList Elements { get { return _elements; } } - - /// - /// Render the value to the output. - /// - /// The output. - /// A format string applied to the value, or null. - /// A format provider to apply to the value, or null to use the default. - /// . - public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) - { - if (output == null) throw new ArgumentNullException("output"); - - output.Write('['); - var allButLast = _elements.Length - 1; - for (var i = 0; i < allButLast; ++i ) - { - _elements[i].Render(output, format, formatProvider); - output.Write(", "); - } - - if (_elements.Length > 0) - _elements[_elements.Length - 1].Render(output, format, formatProvider); - - output.Write(']'); - } - } -} \ No newline at end of file diff --git a/src/Serilog/Events/SequenceValue.cs b/src/Serilog/Events/SequenceValue.cs index bdc540df8..895f04861 100644 --- a/src/Serilog/Events/SequenceValue.cs +++ b/src/Serilog/Events/SequenceValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,12 @@ using System.IO; using System.Linq; +#if NET40 +using IPropertyValueList = System.Collections.Generic.IList; +#else +using IPropertyValueList = System.Collections.Generic.IReadOnlyList; +#endif + namespace Serilog.Events { /// @@ -33,14 +39,14 @@ public class SequenceValue : LogEventPropertyValue /// public SequenceValue(IEnumerable elements) { - if (elements == null) throw new ArgumentNullException("elements"); + if (elements == null) throw new ArgumentNullException(nameof(elements)); _elements = elements.ToArray(); } /// /// The elements of the sequence. /// - public IReadOnlyList Elements { get { return _elements; } } + public IPropertyValueList Elements { get { return _elements; } } /// /// Render the value to the output. @@ -51,7 +57,7 @@ public SequenceValue(IEnumerable elements) /// . public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) { - if (output == null) throw new ArgumentNullException("output"); + if (output == null) throw new ArgumentNullException(nameof(output)); output.Write('['); var allButLast = _elements.Length - 1; diff --git a/src/Serilog/Events/StructureValue-net40.cs b/src/Serilog/Events/StructureValue-net40.cs deleted file mode 100644 index 33530becc..000000000 --- a/src/Serilog/Events/StructureValue-net40.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Generic; -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System.IO; -using System.Linq; - -namespace Serilog.Events -{ - /// - /// A value represented as a collection of name-value properties. - /// - public class StructureValue : LogEventPropertyValue - { - readonly string _typeTag; - readonly LogEventProperty[] _properties; - - /// - /// Construct a with the provided properties. - /// - /// Optionally, a piece of metadata describing the "type" of the - /// structure. - /// The properties of the structure. - /// - public StructureValue(IEnumerable properties, string typeTag = null) - { - if (properties == null) throw new ArgumentNullException("properties"); - _typeTag = typeTag; - _properties = properties.ToArray(); - } - - /// - /// A piece of metadata describing the "type" of the - /// structure, or null. - /// - public string TypeTag { get { return _typeTag; } } - - /// - /// The properties of the structure. - /// - /// Not presented as a dictionary because dictionary construction is - /// relatively expensive; it is cheaper to build a dictionary over properties only - /// when the structure is of interest. - public IList Properties { get { return _properties; } } - - /// - /// Render the value to the output. - /// - /// The output. - /// A format string applied to the value, or null. - /// A format provider to apply to the value, or null to use the default. - /// . - public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) - { - if (output == null) throw new ArgumentNullException("output"); - - if (_typeTag != null) - { - output.Write(_typeTag); - output.Write(' '); - } - output.Write("{ "); - var allButLast = _properties.Length - 1; - for (var i = 0; i < allButLast; i++) - { - var property = _properties[i]; - Render(output, property, formatProvider); - output.Write(", "); - } - - if (_properties.Length > 0) - { - var last = _properties[_properties.Length - 1]; - Render(output, last, formatProvider); - } - - output.Write(" }"); - } - - static void Render(TextWriter output, LogEventProperty property, IFormatProvider formatProvider = null) - { - output.Write(property.Name); - output.Write(": "); - property.Value.Render(output, null, formatProvider); - } - } -} \ No newline at end of file diff --git a/src/Serilog/Events/StructureValue.cs b/src/Serilog/Events/StructureValue.cs index 3af1b5119..3c21bcdfb 100644 --- a/src/Serilog/Events/StructureValue.cs +++ b/src/Serilog/Events/StructureValue.cs @@ -1,6 +1,6 @@ using System; using System.Collections.Generic; -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,12 @@ using System.IO; using System.Linq; +#if NET40 +using IPropertyList = System.Collections.Generic.IList; +#else +using IPropertyList = System.Collections.Generic.IReadOnlyList; +#endif + namespace Serilog.Events { /// @@ -36,7 +42,7 @@ public class StructureValue : LogEventPropertyValue /// public StructureValue(IEnumerable properties, string typeTag = null) { - if (properties == null) throw new ArgumentNullException("properties"); + if (properties == null) throw new ArgumentNullException(nameof(properties)); _typeTag = typeTag; _properties = properties.ToArray(); } @@ -53,7 +59,7 @@ public StructureValue(IEnumerable properties, string typeTag = /// Not presented as a dictionary because dictionary construction is /// relatively expensive; it is cheaper to build a dictionary over properties only /// when the structure is of interest. - public IReadOnlyList Properties { get { return _properties; } } + public IPropertyList Properties { get { return _properties; } } /// /// Render the value to the output. @@ -64,7 +70,7 @@ public StructureValue(IEnumerable properties, string typeTag = /// . public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) { - if (output == null) throw new ArgumentNullException("output"); + if (output == null) throw new ArgumentNullException(nameof(output)); if (_typeTag != null) { diff --git a/src/Serilog/Filters/Matching.cs b/src/Serilog/Filters/Matching.cs index ee85655fa..e8e5bf998 100644 --- a/src/Serilog/Filters/Matching.cs +++ b/src/Serilog/Filters/Matching.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -41,7 +41,7 @@ public static Func FromSource() /// A function that matches log events emitted by the source. public static Func FromSource(string source) { - if (source == null) throw new ArgumentNullException("source"); + if (source == null) throw new ArgumentNullException(nameof(source)); var sourcePrefix = source + "."; return WithProperty(Constants.SourceContextPropertyName, s => s != null && (s == source || s.StartsWith(sourcePrefix))); } @@ -54,7 +54,7 @@ public static Func FromSource(string source) /// A predicate for matching events. public static Func WithProperty(string propertyName) { - if (propertyName == null) throw new ArgumentNullException("propertyName"); + if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); return e => e.Properties.ContainsKey(propertyName); } @@ -67,7 +67,7 @@ public static Func WithProperty(string propertyName) /// A predicate for matching events. public static Func WithProperty(string propertyName, object scalarValue) { - if (propertyName == null) throw new ArgumentNullException("propertyName"); + if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); var scalar = new ScalarValue(scalarValue); return e => { @@ -86,8 +86,8 @@ public static Func WithProperty(string propertyName, object scal /// A predicate for matching events. public static Func WithProperty(string propertyName, Func predicate) { - if (propertyName == null) throw new ArgumentNullException("propertyName"); - if (predicate == null) throw new ArgumentNullException("predicate"); + if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); + if (predicate == null) throw new ArgumentNullException(nameof(predicate)); return e => { diff --git a/src/Serilog/Formatting/Display/LiteralStringValue.cs b/src/Serilog/Formatting/Display/LiteralStringValue.cs index 8c3aacc49..20748dc3a 100644 --- a/src/Serilog/Formatting/Display/LiteralStringValue.cs +++ b/src/Serilog/Formatting/Display/LiteralStringValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ class LiteralStringValue : LogEventPropertyValue public LiteralStringValue(string value) { - if (value == null) throw new ArgumentNullException("value"); + if (value == null) throw new ArgumentNullException(nameof(value)); _value = value; } diff --git a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs deleted file mode 100644 index 4498b94bf..000000000 --- a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue-net40.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using Serilog.Events; - -namespace Serilog.Formatting.Display -{ - class LogEventPropertyMessageValue : LogEventPropertyValue - { - readonly MessageTemplate _template; - readonly IDictionary _properties; - - public LogEventPropertyMessageValue(MessageTemplate template, IDictionary properties) - { - _template = template; - _properties = properties; - } - - public override void Render(TextWriter output, string format = null, IFormatProvider formatProvider = null) - { - _template.Render(_properties, output, formatProvider); - } - } -} diff --git a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs index 791561c63..34bd1a0ac 100644 --- a/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs +++ b/src/Serilog/Formatting/Display/LogEventPropertyMessageValue.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,18 +13,23 @@ // limitations under the License. using System; -using System.Collections.Generic; using System.IO; using Serilog.Events; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Formatting.Display { class LogEventPropertyMessageValue : LogEventPropertyValue { readonly MessageTemplate _template; - readonly IReadOnlyDictionary _properties; + readonly IPropertyDictionary _properties; - public LogEventPropertyMessageValue(MessageTemplate template, IReadOnlyDictionary properties) + public LogEventPropertyMessageValue(MessageTemplate template, IPropertyDictionary properties) { _template = template; _properties = properties; diff --git a/src/Serilog/Formatting/Display/MessageTemplateTextFormatter.cs b/src/Serilog/Formatting/Display/MessageTemplateTextFormatter.cs index 6810b108a..43edb0275 100644 --- a/src/Serilog/Formatting/Display/MessageTemplateTextFormatter.cs +++ b/src/Serilog/Formatting/Display/MessageTemplateTextFormatter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ public class MessageTemplateTextFormatter : ITextFormatter /// Supplies culture-specific formatting information, or null. public MessageTemplateTextFormatter(string outputTemplate, IFormatProvider formatProvider) { - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); _outputTemplate = new MessageTemplateParser().Parse(outputTemplate); _formatProvider = formatProvider; } @@ -55,8 +55,8 @@ public MessageTemplateTextFormatter(string outputTemplate, IFormatProvider forma /// The output. public void Format(LogEvent logEvent, TextWriter output) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - if (output == null) throw new ArgumentNullException("output"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); + if (output == null) throw new ArgumentNullException(nameof(output)); // This could be lazier: the output properties include // everything from the log event, but often we won't need any more than diff --git a/src/Serilog/Formatting/Display/OutputProperties-net40.cs b/src/Serilog/Formatting/Display/OutputProperties-net40.cs deleted file mode 100644 index 36e7a5588..000000000 --- a/src/Serilog/Formatting/Display/OutputProperties-net40.cs +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using Serilog.Events; - -namespace Serilog.Formatting.Display -{ - /// - /// Describes the properties available in standard message template-based - /// output format strings. - /// - public static class OutputProperties - { - /// - /// The message rendered from the log event. - /// - public const string MessagePropertyName = "Message"; - - /// - /// The timestamp of the log event. - /// - public const string TimestampPropertyName = "Timestamp"; - - /// - /// The level of the log event. - /// - public const string LevelPropertyName = "Level"; - - /// - /// A new line. - /// - public const string NewLinePropertyName = "NewLine"; - - /// - /// The exception associated with the log event. - /// - public const string ExceptionPropertyName = "Exception"; - - /// - /// Create properties from the provided log event. - /// - /// The log event. - /// A dictionary with properties representing the log event. - public static IDictionary GetOutputProperties(LogEvent logEvent) - { - var result = logEvent.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); - - // "Special" output properties like Message will override any properties with the same name - // when used in format strings; this doesn't affect the rendering of the message template, - // which uses only the log event properties. - - result[MessagePropertyName] = new LogEventPropertyMessageValue(logEvent.MessageTemplate, logEvent.Properties); - result[TimestampPropertyName] = new ScalarValue(logEvent.Timestamp); - result[LevelPropertyName] = new ScalarValue(logEvent.Level); - result[NewLinePropertyName] = new LiteralStringValue(Environment.NewLine); - - var exception = logEvent.Exception == null ? "" : (logEvent.Exception + Environment.NewLine); - result[ExceptionPropertyName] = new LiteralStringValue(exception); - - return result; - } - } -} diff --git a/src/Serilog/Formatting/Display/OutputProperties.cs b/src/Serilog/Formatting/Display/OutputProperties.cs index 62ad6f987..f32b3e534 100644 --- a/src/Serilog/Formatting/Display/OutputProperties.cs +++ b/src/Serilog/Formatting/Display/OutputProperties.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,10 +13,15 @@ // limitations under the License. using System; -using System.Collections.Generic; using System.Linq; using Serilog.Events; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Formatting.Display { /// @@ -55,7 +60,7 @@ public static class OutputProperties /// /// The log event. /// A dictionary with properties representing the log event. - public static IReadOnlyDictionary GetOutputProperties(LogEvent logEvent) + public static IPropertyDictionary GetOutputProperties(LogEvent logEvent) { var result = logEvent.Properties.ToDictionary(kvp => kvp.Key, kvp => kvp.Value); diff --git a/src/Serilog/Formatting/ITextFormatter.cs b/src/Serilog/Formatting/ITextFormatter.cs index 4b7470a0c..82e4f7264 100644 --- a/src/Serilog/Formatting/ITextFormatter.cs +++ b/src/Serilog/Formatting/ITextFormatter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Formatting/Json/JsonFormatter-net40.cs b/src/Serilog/Formatting/Json/JsonFormatter-net40.cs deleted file mode 100644 index 1c9ee7ef0..000000000 --- a/src/Serilog/Formatting/Json/JsonFormatter-net40.cs +++ /dev/null @@ -1,476 +0,0 @@ -// Copyright 2014 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Text; -using Serilog.Events; -using Serilog.Parsing; - -namespace Serilog.Formatting.Json -{ - /// - /// Formats log events in a simple JSON structure. Instances of this class - /// are safe for concurrent access by multiple threads. - /// - public class JsonFormatter : ITextFormatter - { - readonly bool _omitEnclosingObject; - readonly string _closingDelimiter; - readonly bool _renderMessage; - readonly IFormatProvider _formatProvider; - readonly IDictionary> _literalWriters; - - /// - /// Construct a . Obsolete, please use named arguments - /// when calling this constructor. - /// - [Obsolete("Use named arguments with this method to guarantee forwards-compatibility."), EditorBrowsable(EditorBrowsableState.Never)] - public JsonFormatter(bool omitEnclosingObjectObsolete) - : this(omitEnclosingObject: omitEnclosingObjectObsolete) - { - } - - /// - /// Construct a . - /// - /// If true, the properties of the event will be written to - /// the output without enclosing braces. Otherwise, if false, each event will be written as a well-formed - /// JSON object. - /// A string that will be written after each log event is formatted. - /// If null, will be used. Ignored if - /// is true. - /// If true, the message will be rendered and written to the output as a - /// property named RenderedMessage. - /// Supplies culture-specific formatting information, or null. - public JsonFormatter( - bool omitEnclosingObject = false, - string closingDelimiter = null, - bool renderMessage = false, - IFormatProvider formatProvider = null) - { - _omitEnclosingObject = omitEnclosingObject; - _closingDelimiter = closingDelimiter ?? Environment.NewLine; - _renderMessage = renderMessage; - _formatProvider = formatProvider; - - _literalWriters = new Dictionary> - { - { typeof(bool), (v, q, w) => WriteBoolean((bool)v, w) }, - { typeof(char), (v, q, w) => WriteString(((char)v).ToString(), w) }, - { typeof(byte), WriteToString }, - { typeof(sbyte), WriteToString }, - { typeof(short), WriteToString }, - { typeof(ushort), WriteToString }, - { typeof(int), WriteToString }, - { typeof(uint), WriteToString }, - { typeof(long), WriteToString }, - { typeof(ulong), WriteToString }, - { typeof(float), WriteToString }, - { typeof(double), WriteToString }, - { typeof(decimal), WriteToString }, - { typeof(string), (v, q, w) => WriteString((string)v, w) }, - { typeof(DateTime), (v, q, w) => WriteDateTime((DateTime)v, w) }, - { typeof(DateTimeOffset), (v, q, w) => WriteOffset((DateTimeOffset)v, w) }, - { typeof(ScalarValue), (v, q, w) => WriteLiteral(((ScalarValue)v).Value, w, q) }, - { typeof(SequenceValue), (v, q, w) => WriteSequence(((SequenceValue)v).Elements, w) }, - { typeof(DictionaryValue), (v, q, w) => WriteDictionary(((DictionaryValue)v).Elements, w) }, - { typeof(StructureValue), (v, q, w) => WriteStructure(((StructureValue)v).TypeTag, ((StructureValue)v).Properties, w) }, - }; - } - - /// - /// Format the log event into the output. - /// - /// The event to format. - /// The output. - public void Format(LogEvent logEvent, TextWriter output) - { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - if (output == null) throw new ArgumentNullException("output"); - - if (!_omitEnclosingObject) - output.Write("{"); - - var delim = ""; - WriteTimestamp(logEvent.Timestamp, ref delim, output); - WriteLevel(logEvent.Level, ref delim, output); - WriteMessageTemplate(logEvent.MessageTemplate.Text, ref delim, output); - if (_renderMessage) - { - var message = logEvent.RenderMessage(_formatProvider); - WriteRenderedMessage(message, ref delim, output); - } - - if (logEvent.Exception != null) - WriteException(logEvent.Exception, ref delim, output); - - if (logEvent.Properties.Count != 0) - WriteProperties(logEvent.Properties, output); - - var tokensWithFormat = logEvent.MessageTemplate.Tokens - .OfType() - .Where(pt => pt.Format != null) - .GroupBy(pt => pt.PropertyName) - .ToArray(); - - if (tokensWithFormat.Length != 0) - { - WriteRenderings(tokensWithFormat, logEvent.Properties, output); - - - } - - if (!_omitEnclosingObject) - { - output.Write("}"); - output.Write(_closingDelimiter); - } - } - - /// - /// Adds a writer function for a given type. - /// - /// The type of values, which handles. - /// The function, which writes the values. - protected void AddLiteralWriter(Type type, Action writer) - { - if (type == null) throw new ArgumentNullException("type"); - if (writer == null) throw new ArgumentNullException("writer"); - - _literalWriters[type] = (v, _, w) => writer(v, w); - } - - /// - /// Writes out individual renderings of attached properties - /// - protected virtual void WriteRenderings(IGrouping[] tokensWithFormat, IDictionary properties, TextWriter output) - { - output.Write(",\"{0}\":{{", "Renderings"); - WriteRenderingsValues(tokensWithFormat, properties, output); - output.Write("}"); - } - - /// - /// Writes out the values of individual renderings of attached properties - /// - protected virtual void WriteRenderingsValues(IGrouping[] tokensWithFormat, IDictionary properties, TextWriter output) - { - var rdelim = ""; - foreach (var ptoken in tokensWithFormat) - { - output.Write(rdelim); - rdelim = ","; - output.Write("\""); - output.Write(ptoken.Key); - output.Write("\":["); - - var fdelim = ""; - foreach (var format in ptoken) - { - output.Write(fdelim); - fdelim = ","; - - output.Write("{"); - var eldelim = ""; - - WriteJsonProperty("Format", format.Format, ref eldelim, output); - - var sw = new StringWriter(); - format.Render(properties, sw); - WriteJsonProperty("Rendering", sw.ToString(), ref eldelim, output); - - output.Write("}"); - } - - output.Write("]"); - } - } - - /// - /// Writes out the attached properties - /// - protected virtual void WriteProperties(IDictionary properties, TextWriter output) - { - output.Write(",\"{0}\":{{", "Properties"); - WritePropertiesValues(properties, output); - output.Write("}"); - } - - /// - /// Writes out the attached properties values - /// - protected virtual void WritePropertiesValues(IDictionary properties, TextWriter output) - { - var precedingDelimiter = ""; - foreach (var property in properties) - { - WriteJsonProperty(property.Key, property.Value, ref precedingDelimiter, output); - } - } - - /// - /// Writes out the attached exception - /// - protected virtual void WriteException(Exception exception, ref string delim, TextWriter output) - { - WriteJsonProperty("Exception", exception, ref delim, output); - } - - /// - /// (Optionally) writes out the rendered message - /// - protected virtual void WriteRenderedMessage(string message, ref string delim, TextWriter output) - { - WriteJsonProperty("RenderedMessage", message, ref delim, output); - } - - /// - /// Writes out the message template for the logevent. - /// - protected virtual void WriteMessageTemplate(string template, ref string delim, TextWriter output) - { - WriteJsonProperty("MessageTemplate", template, ref delim, output); - } - - /// - /// Writes out the log level - /// - protected virtual void WriteLevel(LogEventLevel level, ref string delim, TextWriter output) - { - WriteJsonProperty("Level", level, ref delim, output); - } - - /// - /// Writes out the log timestamp - /// - protected virtual void WriteTimestamp(DateTimeOffset timestamp, ref string delim, TextWriter output) - { - WriteJsonProperty("Timestamp", timestamp, ref delim, output); - } - - /// - /// Writes out a structure property - /// - protected virtual void WriteStructure(string typeTag, IEnumerable properties, TextWriter output) - { - output.Write("{"); - - var delim = ""; - if (typeTag != null) - WriteJsonProperty("_typeTag", typeTag, ref delim, output); - - foreach (var property in properties) - WriteJsonProperty(property.Name, property.Value, ref delim, output); - - output.Write("}"); - } - - /// - /// Writes out a sequence property - /// - protected virtual void WriteSequence(IEnumerable elements, TextWriter output) - { - output.Write("["); - var delim = ""; - foreach (var value in elements) - { - output.Write(delim); - delim = ","; - WriteLiteral(value, output); - } - output.Write("]"); - } - - /// - /// Writes out a dictionary - /// - protected virtual void WriteDictionary(IDictionary elements, TextWriter output) - { - output.Write("{"); - var delim = ""; - foreach (var e in elements) - { - output.Write(delim); - delim = ","; - WriteLiteral(e.Key, output, true); - output.Write(":"); - WriteLiteral(e.Value, output); - } - output.Write("}"); - } - - /// - /// Writes out a json property with the specified value on output writer - /// - protected virtual void WriteJsonProperty(string name, object value, ref string precedingDelimiter, TextWriter output) - { - output.Write(precedingDelimiter); - output.Write("\""); - output.Write(name); - output.Write("\":"); - WriteLiteral(value, output); - precedingDelimiter = ","; - } - - /// - /// Allows a subclass to write out objects that have no configured literal writer. - /// - /// The value to be written as a json construct - /// The writer to write on - protected virtual void WriteLiteralValue(object value, TextWriter output) - { - WriteString(value.ToString(), output); - } - - void WriteLiteral(object value, TextWriter output, bool forceQuotation = false) - { - if (value == null) - { - output.Write("null"); - return; - } - - Action writer; - if (_literalWriters.TryGetValue(value.GetType(), out writer)) - { - writer(value, forceQuotation, output); - return; - } - WriteLiteralValue(value, output); - - } - - static void WriteToString(object number, bool quote, TextWriter output) - { - if (quote) output.Write('"'); - - var fmt = number as IFormattable; - if (fmt != null) - output.Write(fmt.ToString(null, CultureInfo.InvariantCulture)); - else - output.Write(number.ToString()); - - if (quote) output.Write('"'); - } - - static void WriteBoolean(bool value, TextWriter output) - { - output.Write(value ? "true" : "false"); - } - - static void WriteOffset(DateTimeOffset value, TextWriter output) - { - output.Write("\""); - output.Write(value.ToString("o")); - output.Write("\""); - } - - static void WriteDateTime(DateTime value, TextWriter output) - { - output.Write("\""); - output.Write(value.ToString("o")); - output.Write("\""); - } - - static void WriteString(string value, TextWriter output) - { - var content = Escape(value); - output.Write("\""); - output.Write(content); - output.Write("\""); - } - - /// - /// Perform simple JSON string escaping on . - /// - /// A raw string. - /// A JSON-escaped version of . - public static string Escape(string s) - { - if (s == null) return null; - - StringBuilder escapedResult = null; - var cleanSegmentStart = 0; - for (var i = 0; i < s.Length; ++i) - { - var c = s[i]; - if (c < (char)32 || c == '\\' || c == '"') - { - - if (escapedResult == null) - escapedResult = new StringBuilder(); - - escapedResult.Append(s.Substring(cleanSegmentStart, i - cleanSegmentStart)); - cleanSegmentStart = i + 1; - - switch (c) - { - case '"': - { - escapedResult.Append("\\\""); - break; - } - case '\\': - { - escapedResult.Append("\\\\"); - break; - } - case '\n': - { - escapedResult.Append("\\n"); - break; - } - case '\r': - { - escapedResult.Append("\\r"); - break; - } - case '\f': - { - escapedResult.Append("\\f"); - break; - } - case '\t': - { - escapedResult.Append("\\t"); - break; - } - default: - { - escapedResult.Append("\\u"); - escapedResult.Append(((int)c).ToString("X4")); - break; - } - } - } - } - - if (escapedResult != null) - { - if (cleanSegmentStart != s.Length) - escapedResult.Append(s.Substring(cleanSegmentStart)); - - return escapedResult.ToString(); - } - - return s; - } - } -} diff --git a/src/Serilog/Formatting/Json/JsonFormatter.cs b/src/Serilog/Formatting/Json/JsonFormatter.cs index ba387ad0b..1a45dbbff 100644 --- a/src/Serilog/Formatting/Json/JsonFormatter.cs +++ b/src/Serilog/Formatting/Json/JsonFormatter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,15 @@ using Serilog.Events; using Serilog.Parsing; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +using IScalarDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +using IScalarDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + + namespace Serilog.Formatting.Json { /// @@ -102,8 +111,8 @@ public JsonFormatter( /// The output. public void Format(LogEvent logEvent, TextWriter output) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - if (output == null) throw new ArgumentNullException("output"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); + if (output == null) throw new ArgumentNullException(nameof(output)); if (!_omitEnclosingObject) output.Write("{"); @@ -158,7 +167,7 @@ protected void AddLiteralWriter(Type type, Action writer) /// /// Writes out individual renderings of attached properties /// - protected virtual void WriteRenderings(IGrouping[] tokensWithFormat, IReadOnlyDictionary properties, TextWriter output) + protected virtual void WriteRenderings(IGrouping[] tokensWithFormat, IPropertyDictionary properties, TextWriter output) { output.Write(",\"{0}\":{{", "Renderings"); WriteRenderingsValues(tokensWithFormat, properties, output); @@ -168,7 +177,7 @@ protected virtual void WriteRenderings(IGrouping[] tokens /// /// Writes out the values of individual renderings of attached properties /// - protected virtual void WriteRenderingsValues(IGrouping[] tokensWithFormat, IReadOnlyDictionary properties, TextWriter output) + protected virtual void WriteRenderingsValues(IGrouping[] tokensWithFormat, IPropertyDictionary properties, TextWriter output) { var rdelim = ""; foreach (var ptoken in tokensWithFormat) @@ -204,7 +213,7 @@ protected virtual void WriteRenderingsValues(IGrouping[] /// /// Writes out the attached properties /// - protected virtual void WriteProperties(IReadOnlyDictionary properties, TextWriter output) + protected virtual void WriteProperties(IPropertyDictionary properties, TextWriter output) { output.Write(",\"{0}\":{{", "Properties"); WritePropertiesValues(properties, output); @@ -214,7 +223,7 @@ protected virtual void WriteProperties(IReadOnlyDictionary /// Writes out the attached properties values /// - protected virtual void WritePropertiesValues(IReadOnlyDictionary properties, TextWriter output) + protected virtual void WritePropertiesValues(IPropertyDictionary properties, TextWriter output) { var precedingDelimiter = ""; foreach (var property in properties) @@ -299,7 +308,7 @@ protected virtual void WriteSequence(IEnumerable elements, TextWriter output) /// /// Writes out a dictionary /// - protected virtual void WriteDictionary(IReadOnlyDictionary elements, TextWriter output) + protected virtual void WriteDictionary(IScalarDictionary elements, TextWriter output) { output.Write("{"); var delim = ""; diff --git a/src/Serilog/Formatting/Raw/RawFormatter.cs b/src/Serilog/Formatting/Raw/RawFormatter.cs index 760edbc40..a6173672b 100644 --- a/src/Serilog/Formatting/Raw/RawFormatter.cs +++ b/src/Serilog/Formatting/Raw/RawFormatter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/ILogger.cs b/src/Serilog/ILogger.cs index 5acabb5ef..4e03b765d 100644 --- a/src/Serilog/ILogger.cs +++ b/src/Serilog/ILogger.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Log.cs b/src/Serilog/Log.cs index 5e82c6872..3f4dff787 100644 --- a/src/Serilog/Log.cs +++ b/src/Serilog/Log.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,6 +13,7 @@ // limitations under the License. using System; +using System.Threading; using Serilog.Core; using Serilog.Core.Pipeline; using Serilog.Events; @@ -49,11 +50,21 @@ public static ILogger Logger get { return _logger; } set { - if (value == null) throw new ArgumentNullException("value"); + if (value == null) throw new ArgumentNullException(nameof(value)); _logger = value; } } + /// + /// Resets to the default and disposes the original if possible + /// + public static void CloseAndFlush() + { + ILogger logger = Interlocked.Exchange(ref _logger, new SilentLogger()); + + (logger as IDisposable)?.Dispose(); + } + /// /// Create a logger that enriches log events via the provided enrichers. /// diff --git a/src/Serilog/LoggerConfiguration.cs b/src/Serilog/LoggerConfiguration.cs index 0f662e80a..5b89e2782 100644 --- a/src/Serilog/LoggerConfiguration.cs +++ b/src/Serilog/LoggerConfiguration.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -127,6 +127,7 @@ public ILogger CreateLogger() if (!_logEventSinks.Any()) return new SilentLogger(); + Action dispose = () => { foreach (var disposable in _logEventSinks.OfType()) diff --git a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions.cs b/src/Serilog/LoggerConfigurationFullNetFxExtensions.cs similarity index 83% rename from src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions.cs rename to src/Serilog/LoggerConfigurationFullNetFxExtensions.cs index a469954f4..f8fa50d8e 100644 --- a/src/Serilog.FullNetFx/LoggerConfigurationFullNetFxExtensions.cs +++ b/src/Serilog/LoggerConfigurationFullNetFxExtensions.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,24 +12,27 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !PROFILE259 using System; -using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Threading; using Serilog.Configuration; +using Serilog.Core; using Serilog.Debugging; using Serilog.Enrichers; using Serilog.Events; using Serilog.Formatting.Display; using Serilog.Formatting.Raw; -using Serilog.Settings.AppSettings; -using Serilog.Settings.KeyValuePairs; using Serilog.Sinks.DiagnosticTrace; using Serilog.Sinks.IOFile; using Serilog.Sinks.RollingFile; using Serilog.Sinks.SystemConsole; +#if !DNXCORE50 +using Serilog.Settings.AppSettings; +#endif + namespace Serilog { /// @@ -48,7 +51,9 @@ public static class LoggerConfigurationFullNetFxExtensions /// /// Logger sink configuration. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// A message template describing the format used to write to the sink. /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". /// Supplies culture-specific formatting information, or null. @@ -57,12 +62,13 @@ public static LoggerConfiguration Console( this LoggerSinkConfiguration sinkConfiguration, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, string outputTemplate = DefaultConsoleOutputTemplate, - IFormatProvider formatProvider = null) + IFormatProvider formatProvider = null, + LoggingLevelSwitch levelSwitch = null) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - return sinkConfiguration.Sink(new ConsoleSink(formatter), restrictedToMinimumLevel); + return sinkConfiguration.Sink(new ConsoleSink(formatter), restrictedToMinimumLevel, levelSwitch); } /// @@ -71,7 +77,9 @@ public static LoggerConfiguration Console( /// /// Logger sink configuration. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// A message template describing the format used to write to the sink. /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". /// Supplies culture-specific formatting information, or null. @@ -80,11 +88,12 @@ public static LoggerConfiguration ColoredConsole( this LoggerSinkConfiguration sinkConfiguration, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, string outputTemplate = DefaultConsoleOutputTemplate, - IFormatProvider formatProvider = null) + IFormatProvider formatProvider = null, + LoggingLevelSwitch levelSwitch = null) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); - return sinkConfiguration.Sink(new ColoredConsoleSink(outputTemplate, formatProvider), restrictedToMinimumLevel); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); + return sinkConfiguration.Sink(new ColoredConsoleSink(outputTemplate, formatProvider), restrictedToMinimumLevel, levelSwitch); } /// @@ -101,8 +110,8 @@ public static LoggerConfiguration DumpFile( string path, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (path == null) throw new ArgumentNullException("path"); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (path == null) throw new ArgumentNullException(nameof(path)); return sinkConfiguration.Sink(new FileSink(path, new RawFormatter(), null), restrictedToMinimumLevel); } @@ -112,7 +121,9 @@ public static LoggerConfiguration DumpFile( /// Logger sink configuration. /// Path to the file. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// Supplies culture-specific formatting information, or null. /// A message template describing the format used to write to the sink. /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". @@ -126,10 +137,11 @@ public static LoggerConfiguration File( LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, string outputTemplate = DefaultOutputTemplate, IFormatProvider formatProvider = null, - long? fileSizeLimitBytes = DefaultFileSizeLimitBytes) + long? fileSizeLimitBytes = DefaultFileSizeLimitBytes, + LoggingLevelSwitch levelSwitch = null) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); FileSink sink; @@ -147,7 +159,7 @@ public static LoggerConfiguration File( return sinkConfiguration.Sink(new NullSink()); } - return sinkConfiguration.Sink(sink, restrictedToMinimumLevel); + return sinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch); } /// @@ -160,7 +172,9 @@ public static LoggerConfiguration File( /// with {Date} in the place of the file date. E.g. "Logs\myapp-{Date}.log" will result in log /// files such as "Logs\myapp-2013-10-20.log", "Logs\myapp-2013-10-21.log" and so on. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// A message template describing the format used to write to the sink. /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". /// Supplies culture-specific formatting information, or null. @@ -177,13 +191,14 @@ public static LoggerConfiguration RollingFile( string outputTemplate = DefaultOutputTemplate, IFormatProvider formatProvider = null, long? fileSizeLimitBytes = DefaultFileSizeLimitBytes, - int? retainedFileCountLimit = DefaultRetainedFileCountLimit) + int? retainedFileCountLimit = DefaultRetainedFileCountLimit, + LoggingLevelSwitch levelSwitch = null) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); var sink = new RollingFileSink(pathFormat, formatter, fileSizeLimitBytes, retainedFileCountLimit); - return sinkConfiguration.Sink(sink, restrictedToMinimumLevel); + return sinkConfiguration.Sink(sink, restrictedToMinimumLevel, levelSwitch); } /// @@ -191,7 +206,9 @@ public static LoggerConfiguration RollingFile( /// /// Logger sink configuration. /// The minimum level for - /// events passed through the sink. + /// events passed through the sink. Ignored when is specified. + /// A switch allowing the pass-through minimum level + /// to be changed at runtime. /// A message template describing the format used to write to the sink. /// the default is "{Timestamp} [{Level}] {Message}{NewLine}{Exception}". /// Supplies culture-specific formatting information, or null. @@ -200,14 +217,16 @@ public static LoggerConfiguration Trace( this LoggerSinkConfiguration sinkConfiguration, LogEventLevel restrictedToMinimumLevel = LevelAlias.Minimum, string outputTemplate = DefaultOutputTemplate, - IFormatProvider formatProvider = null) + IFormatProvider formatProvider = null, + LoggingLevelSwitch levelSwitch = null) { - if (sinkConfiguration == null) throw new ArgumentNullException("sinkConfiguration"); - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (sinkConfiguration == null) throw new ArgumentNullException(nameof(sinkConfiguration)); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); var formatter = new MessageTemplateTextFormatter(outputTemplate, formatProvider); - return sinkConfiguration.Sink(new DiagnosticTraceSink(formatter), restrictedToMinimumLevel); + return sinkConfiguration.Sink(new DiagnosticTraceSink(formatter), restrictedToMinimumLevel, levelSwitch); } +#if !DNXCORE50 /// /// Enrich log events with properties from . /// @@ -217,9 +236,10 @@ public static LoggerConfiguration Trace( public static LoggerConfiguration FromLogContext( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } +#endif /// /// Enrich log events with a ThreadId property containing the current . @@ -230,7 +250,7 @@ public static LoggerConfiguration FromLogContext( public static LoggerConfiguration WithThreadId( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } @@ -242,7 +262,7 @@ public static LoggerConfiguration WithThreadId( public static LoggerConfiguration WithProcessId( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } @@ -254,7 +274,7 @@ public static LoggerConfiguration WithProcessId( public static LoggerConfiguration WithMachineName( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } @@ -266,10 +286,11 @@ public static LoggerConfiguration WithMachineName( public static LoggerConfiguration WithEnvironmentUserName( this LoggerEnrichmentConfiguration enrichmentConfiguration) { - if (enrichmentConfiguration == null) throw new ArgumentNullException("enrichmentConfiguration"); + if (enrichmentConfiguration == null) throw new ArgumentNullException(nameof(enrichmentConfiguration)); return enrichmentConfiguration.With(); } +#if !DNXCORE50 /// /// Reads the <appSettings> element of App.config or Web.config, searching for for keys /// that look like: serilog:*, which are used to configure @@ -278,37 +299,25 @@ public static LoggerConfiguration WithEnvironmentUserName( /// containing sinks, use serilog:using. To set the level use /// serilog:minimum-level. /// - /// Logger setting configuration + /// Logger setting configuration. + /// Prefix to use when reading keys in appSettings. If specified the value + /// will be prepended to the setting keys and followed by :, for example "myapp" will use "myapp:serilog:minumum-level. If null + /// no prefix is applied. /// An object allowing configuration to continue. public static LoggerConfiguration AppSettings( - this LoggerSettingsConfiguration settingConfiguration) + this LoggerSettingsConfiguration settingConfiguration, string settingPrefix = null) { - if (settingConfiguration == null) throw new ArgumentNullException("settingConfiguration"); - return settingConfiguration.Settings(new AppSettingsSettings()); - } - - /// - /// Reads the <appSettings> element of App.config or Web.config, searching for for keys - /// that look like: serilog:*, which are used to configure - /// the logger. To add a sink, use a key like serilog:write-to:File.path for - /// each parameter to the sink's configuration method. To add an additional assembly - /// containing sinks, use serilog:using. To set the level use \ - /// serilog:minimum-level. - /// - /// Logger setting configuration - /// Optional prefix to use when reading keys in appSettings - /// An object allowing configuration to continue. - public static LoggerConfiguration AppSettings( - this LoggerSettingsConfiguration settingConfiguration, string settingPrefix) - { - if (settingConfiguration == null) throw new ArgumentNullException("settingConfiguration"); + if (settingConfiguration == null) throw new ArgumentNullException(nameof(settingConfiguration)); if (settingPrefix != null) { if (settingPrefix.Contains(":")) throw new ArgumentException("Custom setting prefixes cannot contain the colon (:) character."); if (settingPrefix == "serilog") throw new ArgumentException("The value \"serilog\" is not a permitted setting prefix. To use the default, do not specify a custom prefix at all."); if (string.IsNullOrWhiteSpace(settingPrefix)) throw new ArgumentException("To use the default setting prefix, do not supply the settingPrefix parameter, instead pass the default null."); } + return settingConfiguration.Settings(new AppSettingsSettings(settingPrefix)); } +#endif } } +#endif diff --git a/src/Serilog/Parameters/DepthLimiter.cs b/src/Serilog/Parameters/DepthLimiter.cs index 8f04e80b8..30e9122ee 100644 --- a/src/Serilog/Parameters/DepthLimiter.cs +++ b/src/Serilog/Parameters/DepthLimiter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parameters/GetablePropertyFinder.cs b/src/Serilog/Parameters/GetablePropertyFinder.cs index 17e92b7e3..ee983bc45 100644 --- a/src/Serilog/Parameters/GetablePropertyFinder.cs +++ b/src/Serilog/Parameters/GetablePropertyFinder.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,10 @@ using System.Linq; using System.Reflection; +#if NET40 +using Serilog.Platform; +#endif + namespace Serilog.Parameters { static class GetablePropertyFinder @@ -30,8 +34,11 @@ internal static IEnumerable GetPropertiesRecursive(this Type type) while (currentTypeInfo.AsType() != typeof(object)) { var unseenProperties = currentTypeInfo.DeclaredProperties.Where(p => p.CanRead && - p.GetMethod.IsPublic && - !p.GetMethod.IsStatic && +#if NET40 + p.GetGetMethod().IsPublic && !p.GetGetMethod().IsStatic && +#else + p.GetMethod.IsPublic && !p.GetMethod.IsStatic && +#endif (p.Name != "Item" || p.GetIndexParameters().Length == 0) && !seenNames.Contains(p.Name)); diff --git a/src/Serilog/Parameters/MessageTemplateProcessor.cs b/src/Serilog/Parameters/MessageTemplateProcessor.cs index 0c9ba6322..cf04f6c2d 100644 --- a/src/Serilog/Parameters/MessageTemplateProcessor.cs +++ b/src/Serilog/Parameters/MessageTemplateProcessor.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parameters/PropertyBinder.cs b/src/Serilog/Parameters/PropertyBinder.cs index cdf7219be..32a24492a 100644 --- a/src/Serilog/Parameters/PropertyBinder.cs +++ b/src/Serilog/Parameters/PropertyBinder.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parameters/PropertyValueConverter-net40.cs b/src/Serilog/Parameters/PropertyValueConverter-net40.cs deleted file mode 100644 index ce848bfcc..000000000 --- a/src/Serilog/Parameters/PropertyValueConverter-net40.cs +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2014 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using Serilog.Core; -using Serilog.Debugging; -using Serilog.Events; -using Serilog.Parsing; -using Serilog.Policies; - -namespace Serilog.Parameters -{ - // Values in Serilog are simplified down into a lowest-common-denominator internal - // type system so that there is a better chance of code written with one sink in - // mind working correctly with any other. This technique also makes the programmer - // writing a log event (roughly) in control of the cost of recording that event. - partial class PropertyValueConverter : ILogEventPropertyFactory, ILogEventPropertyValueFactory - { - static readonly HashSet BuiltInScalarTypes = new HashSet - { - typeof(bool), - typeof(byte), typeof(short), typeof(ushort), typeof(int), typeof(uint), - typeof(long), typeof(ulong), typeof(float), typeof(double), typeof(decimal), - typeof(string), - typeof(DateTime), typeof(DateTimeOffset), typeof(TimeSpan), - typeof(Guid), typeof(Uri) - }; - - readonly IDestructuringPolicy[] _destructuringPolicies; - readonly IScalarConversionPolicy[] _scalarConversionPolicies; - readonly int _maximumDestructuringDepth; - - public PropertyValueConverter(int maximumDestructuringDepth, IEnumerable additionalScalarTypes, IEnumerable additionalDestructuringPolicies) - { - if (additionalScalarTypes == null) throw new ArgumentNullException("additionalScalarTypes"); - if (additionalDestructuringPolicies == null) throw new ArgumentNullException("additionalDestructuringPolicies"); - if (maximumDestructuringDepth < 0) throw new ArgumentOutOfRangeException("maximumDestructuringDepth"); - - _maximumDestructuringDepth = maximumDestructuringDepth; - - _scalarConversionPolicies = new IScalarConversionPolicy[] - { - new SimpleScalarConversionPolicy(BuiltInScalarTypes.Concat(additionalScalarTypes)), - new NullableScalarConversionPolicy(), - new EnumScalarConversionPolicy(), - new ByteArrayScalarConversionPolicy(), - new ReflectionTypesScalarConversionPolicy() - }; - - _destructuringPolicies = additionalDestructuringPolicies - .Concat(new [] - { - new DelegateDestructuringPolicy() - }) - .ToArray(); - } - - public LogEventProperty CreateProperty(string name, object value, bool destructureObjects = false) - { - return new LogEventProperty(name, CreatePropertyValue(value, destructureObjects)); - } - - public LogEventPropertyValue CreatePropertyValue(object value, bool destructureObjects = false) - { - return CreatePropertyValue(value, destructureObjects, 1); - } - - public LogEventPropertyValue CreatePropertyValue(object value, Destructuring destructuring) - { - return CreatePropertyValue(value, destructuring, 1); - } - - LogEventPropertyValue CreatePropertyValue(object value, bool destructureObjects, int depth) - { - return CreatePropertyValue( - value, - destructureObjects ? - Destructuring.Destructure : - Destructuring.Default, - depth); - } - - LogEventPropertyValue CreatePropertyValue(object value, Destructuring destructuring, int depth) - { - if (value == null) - return new ScalarValue(null); - - if (destructuring == Destructuring.Stringify) - return new ScalarValue(value.ToString()); - - var valueType = value.GetType(); - var limiter = new DepthLimiter(depth, _maximumDestructuringDepth, this); - - foreach (var scalarConversionPolicy in _scalarConversionPolicies) - { - ScalarValue converted; - if (scalarConversionPolicy.TryConvertToScalar(value, limiter, out converted)) - return converted; - } - - if (destructuring == Destructuring.Destructure) - { - foreach (var destructuringPolicy in _destructuringPolicies) - { - LogEventPropertyValue result; - if (destructuringPolicy.TryDestructure(value, limiter, out result)) - return result; - } - } - - var enumerable = value as IEnumerable; - if (enumerable != null) - { - // Only dictionaries with 'scalar' keys are permitted, as - // more complex keys may not serialize to unique values for - // representation in sinks. This check strengthens the expectation - // that resulting dictionary is representable in JSON as well - // as richer formats (e.g. XML, .NET type-aware...). - // Only actual dictionaries are supported, as arbitrary types - // can implement multiple IDictionary interfaces and thus introduce - // multiple different interpretations. - if (IsValueTypeDictionary(valueType)) - { - return new DictionaryValue(enumerable.Cast() - .Select(kvp => new KeyValuePair( - (ScalarValue)limiter.CreatePropertyValue(kvp.Key, destructuring), - limiter.CreatePropertyValue(kvp.Value, destructuring))) - .Where(kvp => kvp.Key.Value != null)); - } - - return - new SequenceValue( - enumerable.Cast().Select(o => limiter.CreatePropertyValue(o, destructuring))); - } - - if (destructuring == Destructuring.Destructure) - { - var typeTag = value.GetType().Name; - if (typeTag.Length <= 0 || !char.IsLetter(typeTag[0])) - typeTag = null; - - return new StructureValue(GetProperties(value, limiter), typeTag); - } - - return new ScalarValue(value.ToString()); - } - - bool IsValueTypeDictionary(Type valueType) - { - return valueType.IsGenericType && - valueType.GetGenericTypeDefinition() == typeof(Dictionary<,>) && - IsValidDictionaryKeyType(valueType.GetGenericArguments()[0]); - } - - bool IsValidDictionaryKeyType(Type valueType) - { - return BuiltInScalarTypes.Contains(valueType) || valueType.IsEnum; - } - - static IEnumerable GetProperties(object value, ILogEventPropertyValueFactory recursive) - { - var valueType = value.GetType(); - var props = valueType.GetProperties().Where(p => p.CanRead && - p.GetGetMethod().IsPublic && - !p.GetGetMethod().IsStatic && - (p.Name != "Item" || p.GetIndexParameters().Length == 0)); - - foreach (var prop in props) - { - object propValue; - try - { - propValue = prop.GetValue(value, null); - } - catch (TargetParameterCountException) - { - SelfLog.WriteLine("The property accessor {0} is a non-default indexer", prop); - continue; - } - catch (TargetInvocationException ex) - { - SelfLog.WriteLine("The property accessor {0} threw exception {1}", prop, ex); - propValue = "The property accessor threw an exception: " + ex.InnerException.GetType().Name; - } - yield return new LogEventProperty(prop.Name, recursive.CreatePropertyValue(propValue, true)); - } - } - } -} diff --git a/src/Serilog/Parameters/PropertyValueConverter.cs b/src/Serilog/Parameters/PropertyValueConverter.cs index 335ef65a6..4619c384d 100644 --- a/src/Serilog/Parameters/PropertyValueConverter.cs +++ b/src/Serilog/Parameters/PropertyValueConverter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,10 @@ using Serilog.Parsing; using Serilog.Policies; +#if NET40 +using Serilog.Platform; +#endif + namespace Serilog.Parameters { // Values in Serilog are simplified down into a lowest-common-denominator internal @@ -48,9 +52,9 @@ partial class PropertyValueConverter : ILogEventPropertyFactory, ILogEventProper public PropertyValueConverter(int maximumDestructuringDepth, IEnumerable additionalScalarTypes, IEnumerable additionalDestructuringPolicies) { - if (additionalScalarTypes == null) throw new ArgumentNullException("additionalScalarTypes"); - if (additionalDestructuringPolicies == null) throw new ArgumentNullException("additionalDestructuringPolicies"); - if (maximumDestructuringDepth < 0) throw new ArgumentOutOfRangeException("maximumDestructuringDepth"); + if (additionalScalarTypes == null) throw new ArgumentNullException(nameof(additionalScalarTypes)); + if (additionalDestructuringPolicies == null) throw new ArgumentNullException(nameof(additionalDestructuringPolicies)); + if (maximumDestructuringDepth < 0) throw new ArgumentOutOfRangeException(nameof(maximumDestructuringDepth)); _maximumDestructuringDepth = maximumDestructuringDepth; @@ -162,9 +166,20 @@ LogEventPropertyValue CreatePropertyValue(object value, Destructuring destructur bool IsValueTypeDictionary(Type valueType) { - return valueType.IsConstructedGenericType && + return +#if NET40 + valueType.IsGenericType && +#else + valueType.IsConstructedGenericType && +#endif valueType.GetGenericTypeDefinition() == typeof (Dictionary<,>) && - IsValidDictionaryKeyType(valueType.GenericTypeArguments[0]); + IsValidDictionaryKeyType( +#if NET40 + valueType.GetGenericArguments() +#else + valueType.GenericTypeArguments +#endif + [0]); } bool IsValidDictionaryKeyType(Type valueType) @@ -180,7 +195,11 @@ static IEnumerable GetProperties(object value, ILogEventProper object propValue; try { +#if NET40 + propValue = prop.GetValue(value, null); +#else propValue = prop.GetValue(value); +#endif } catch (TargetParameterCountException) { diff --git a/src/Serilog/Parsing/Alignment.cs b/src/Serilog/Parsing/Alignment.cs index f8a6b8917..ce8b7a707 100644 --- a/src/Serilog/Parsing/Alignment.cs +++ b/src/Serilog/Parsing/Alignment.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parsing/AlignmentDirection.cs b/src/Serilog/Parsing/AlignmentDirection.cs index 2b04e7018..628a8d6dc 100644 --- a/src/Serilog/Parsing/AlignmentDirection.cs +++ b/src/Serilog/Parsing/AlignmentDirection.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parsing/Destructuring.cs b/src/Serilog/Parsing/Destructuring.cs index f3de913bf..4ad38124b 100644 --- a/src/Serilog/Parsing/Destructuring.cs +++ b/src/Serilog/Parsing/Destructuring.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Parsing/MessageTemplateParser.cs b/src/Serilog/Parsing/MessageTemplateParser.cs index 4189c2360..3a1d7f332 100644 --- a/src/Serilog/Parsing/MessageTemplateParser.cs +++ b/src/Serilog/Parsing/MessageTemplateParser.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -37,7 +37,7 @@ public class MessageTemplateParser : IMessageTemplateParser public MessageTemplate Parse(string messageTemplate) { if (messageTemplate == null) - throw new ArgumentNullException("messageTemplate"); + throw new ArgumentNullException(nameof(messageTemplate)); return new MessageTemplate(messageTemplate, Tokenize(messageTemplate)); } diff --git a/src/Serilog/Parsing/MessageTemplateToken-net40.cs b/src/Serilog/Parsing/MessageTemplateToken-net40.cs deleted file mode 100644 index 09dcf0071..000000000 --- a/src/Serilog/Parsing/MessageTemplateToken-net40.cs +++ /dev/null @@ -1,59 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using Serilog.Events; - -namespace Serilog.Parsing -{ - /// - /// An element parsed from a message template string. - /// - public abstract class MessageTemplateToken - { - readonly int _startIndex; - - /// - /// Construct a . - /// - /// The token's start index in the template. - protected MessageTemplateToken(int startIndex) - { - _startIndex = startIndex; - } - - /// - /// The token's start index in the template. - /// - public int StartIndex - { - get { return _startIndex; } - } - - /// - /// The token's length. - /// - public abstract int Length { get; } - - /// - /// Render the token to the output. - /// - /// Properties that may be represented by the token. - /// Output for the rendered string. - /// Supplies culture-specific formatting information, or null. - public abstract void Render(IDictionary properties, TextWriter output, IFormatProvider formatProvider = null); - } -} \ No newline at end of file diff --git a/src/Serilog/Parsing/MessageTemplateToken.cs b/src/Serilog/Parsing/MessageTemplateToken.cs index cc630fc2c..9acf568d2 100644 --- a/src/Serilog/Parsing/MessageTemplateToken.cs +++ b/src/Serilog/Parsing/MessageTemplateToken.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,9 +13,13 @@ // limitations under the License. using System; -using System.Collections.Generic; using System.IO; -using Serilog.Events; + +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif namespace Serilog.Parsing { @@ -54,6 +58,6 @@ public int StartIndex /// Properties that may be represented by the token. /// Output for the rendered string. /// Supplies culture-specific formatting information, or null. - public abstract void Render(IReadOnlyDictionary properties, TextWriter output, IFormatProvider formatProvider = null); + public abstract void Render(IPropertyDictionary properties, TextWriter output, IFormatProvider formatProvider = null); } } \ No newline at end of file diff --git a/src/Serilog/Parsing/PropertyToken-net40.cs b/src/Serilog/Parsing/PropertyToken-net40.cs deleted file mode 100644 index 6ec52b867..000000000 --- a/src/Serilog/Parsing/PropertyToken-net40.cs +++ /dev/null @@ -1,216 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using Serilog.Events; -using System.ComponentModel; - -namespace Serilog.Parsing -{ - /// - /// A message template token representing a log event property. - /// - public class PropertyToken : MessageTemplateToken - { - readonly string _propertyName; - readonly string _format; - readonly Alignment? _alignment; - readonly Destructuring _destructuring; - readonly string _rawText; - readonly int? _position; - - /// - /// Construct a . - /// - /// The name of the property. - /// The token as it appears in the message template. - /// The format applied to the property, if any. - /// The destructuring strategy applied to the property, if any. - /// - [Obsolete("Use named arguments with this method to guarantee forwards-compatibility."), EditorBrowsable(EditorBrowsableState.Never)] - public PropertyToken(string propertyName, string rawText, string formatObsolete, Destructuring destructuringObsolete) - : this(propertyName, rawText, formatObsolete, null, destructuringObsolete) - { - } - - /// - /// Construct a . - /// - /// The name of the property. - /// The token as it appears in the message template. - /// The format applied to the property, if any. - /// The alignment applied to the property, if any. - /// The destructuring strategy applied to the property, if any. - /// The token's start index in the template. - /// - public PropertyToken(string propertyName, string rawText, string format = null, Alignment? alignment = null, Destructuring destructuring = Destructuring.Default, int startIndex = -1) - : base(startIndex) - { - if (propertyName == null) - throw new ArgumentNullException("propertyName"); - if (rawText == null) - throw new ArgumentNullException("rawText"); - _propertyName = propertyName; - _format = format; - _destructuring = destructuring; - _rawText = rawText; - _alignment = alignment; - - int position; - if (int.TryParse(_propertyName, NumberStyles.None, CultureInfo.InvariantCulture, out position) && - position >= 0) - { - _position = position; - } - } - - /// - /// The token's length. - /// - public override int Length - { - get { return _rawText.Length; } - } - - /// - /// Render the token to the output. - /// - /// Properties that may be represented by the token. - /// Output for the rendered string. - /// Supplies culture-specific formatting information, or null. - public override void Render(IDictionary properties, TextWriter output, IFormatProvider formatProvider = null) - { - if (properties == null) throw new ArgumentNullException("properties"); - if (output == null) throw new ArgumentNullException("output"); - LogEventPropertyValue propertyValue; - if (properties.TryGetValue(_propertyName, out propertyValue)) - { - if (_alignment.HasValue) - { - var valueOutput = new StringWriter(); - propertyValue.Render(valueOutput, _format, formatProvider); - var value = valueOutput.ToString(); - - if (value.Length < _alignment.Value.Width) - { - var pad = _alignment.Value.Width - value.Length; - - if (_alignment.Value.Direction == AlignmentDirection.Right) - output.Write(new string(' ', pad)); - - output.Write(value); - - if (_alignment.Value.Direction == AlignmentDirection.Left) - output.Write(new string(' ', pad)); - } - else - output.Write(value); - } - else - propertyValue.Render(output, _format, formatProvider); - } - else - output.Write(_rawText); - } - - /// - /// The property name. - /// - public string PropertyName { get { return _propertyName; } } - - /// - /// Destructuring strategy applied to the property. - /// - public Destructuring Destructuring { get { return _destructuring; } } - - /// - /// Format applied to the property. - /// - public string Format { get { return _format; } } - - /// - /// Alignment applied to the property. - /// - public Alignment? Alignment { get { return _alignment; } } - - /// - /// True if the property name is a positional index; otherwise, false. - /// - public bool IsPositional - { - get { return _position != null; } - } - - /// - /// Try to get the integer value represented by the property name. - /// - /// The integer value, if present. - /// True if the property is positional, otherwise false. - public bool TryGetPositionalValue(out int position) - { - if (_position == null) - { - position = 0; - return false; - } - - position = _position.Value; - return true; - } - - /// - /// Determines whether the specified is equal to the current . - /// - /// - /// true if the specified object is equal to the current object; otherwise, false. - /// - /// The object to compare with the current object. 2 - public override bool Equals(object obj) - { - var pt = obj as PropertyToken; - return pt != null && - pt._destructuring == _destructuring && - pt._format == _format && - pt._propertyName == _propertyName && - pt._rawText == _rawText; - } - - /// - /// Serves as a hash function for a particular type. - /// - /// - /// A hash code for the current . - /// - /// 2 - public override int GetHashCode() - { - return _propertyName.GetHashCode(); - } - - /// - /// Returns a string that represents the current object. - /// - /// - /// A string that represents the current object. - /// - /// 2 - public override string ToString() - { - return _rawText; - } - } -} \ No newline at end of file diff --git a/src/Serilog/Parsing/PropertyToken.cs b/src/Serilog/Parsing/PropertyToken.cs index 5091c20fc..3841ee02b 100644 --- a/src/Serilog/Parsing/PropertyToken.cs +++ b/src/Serilog/Parsing/PropertyToken.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,12 +13,17 @@ // limitations under the License. using System; -using System.Collections.Generic; using System.ComponentModel; using System.Globalization; using System.IO; using Serilog.Events; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + namespace Serilog.Parsing { /// @@ -60,8 +65,8 @@ public PropertyToken(string propertyName, string rawText, string formatObsolete, public PropertyToken(string propertyName, string rawText, string format = null, Alignment? alignment = null, Destructuring destructuring = Destructuring.Default, int startIndex = -1) : base(startIndex) { - if (propertyName == null) throw new ArgumentNullException("propertyName"); - if (rawText == null) throw new ArgumentNullException("rawText"); + if (propertyName == null) throw new ArgumentNullException(nameof(propertyName)); + if (rawText == null) throw new ArgumentNullException(nameof(rawText)); _propertyName = propertyName; _format = format; _destructuring = destructuring; @@ -90,10 +95,10 @@ public override int Length /// Properties that may be represented by the token. /// Output for the rendered string. /// Supplies culture-specific formatting information, or null. - public override void Render(IReadOnlyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) + public override void Render(IPropertyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) { - if (properties == null) throw new ArgumentNullException("properties"); - if (output == null) throw new ArgumentNullException("output"); + if (properties == null) throw new ArgumentNullException(nameof(properties)); + if (output == null) throw new ArgumentNullException(nameof(output)); LogEventPropertyValue propertyValue; if (!properties.TryGetValue(_propertyName, out propertyValue)) diff --git a/src/Serilog/Parsing/TextToken-net40.cs b/src/Serilog/Parsing/TextToken-net40.cs deleted file mode 100644 index b41324689..000000000 --- a/src/Serilog/Parsing/TextToken-net40.cs +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.IO; -using Serilog.Events; - -namespace Serilog.Parsing -{ - /// - /// A message template token representing literal text. - /// - public class TextToken : MessageTemplateToken - { - readonly string _text; - - /// - /// Construct a . - /// - /// The text of the token. - /// The token's start index in the template. - /// - public TextToken(string text, int startIndex = -1) : base(startIndex) - { - if (text == null) throw new ArgumentNullException("text"); - _text = text; - } - - /// - /// The token's length. - /// - public override int Length - { - get { return _text.Length; } - } - - /// - /// Render the token to the output. - /// - /// Properties that may be represented by the token. - /// Output for the rendered string. - /// Supplies culture-specific formatting information, or null. - public override void Render(IDictionary properties, TextWriter output, IFormatProvider formatProvider = null) - { - if (output == null) throw new ArgumentNullException("output"); - output.Write(Text); - } - - /// - /// Determines whether the specified is equal to the current . - /// - /// - /// true if the specified object is equal to the current object; otherwise, false. - /// - /// The object to compare with the current object. 2 - public override bool Equals(object obj) - { - var tt = obj as TextToken; - return tt != null && tt._text == _text; - } - - /// - /// Serves as a hash function for a particular type. - /// - /// - /// A hash code for the current . - /// - /// 2 - public override int GetHashCode() - { - return _text.GetHashCode(); - } - - /// - /// Returns a string that represents the current object. - /// - /// - /// A string that represents the current object. - /// - /// 2 - public override string ToString() - { - return Text; - } - - /// - /// The text of the token. - /// - public string Text - { - get { return _text; } - } - } -} \ No newline at end of file diff --git a/src/Serilog/Parsing/TextToken.cs b/src/Serilog/Parsing/TextToken.cs index 604fe25cb..e256db1aa 100644 --- a/src/Serilog/Parsing/TextToken.cs +++ b/src/Serilog/Parsing/TextToken.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -13,9 +13,13 @@ // limitations under the License. using System; -using System.Collections.Generic; using System.IO; -using Serilog.Events; + +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif namespace Serilog.Parsing { @@ -34,7 +38,7 @@ public class TextToken : MessageTemplateToken /// public TextToken(string text, int startIndex = -1) : base(startIndex) { - if (text == null) throw new ArgumentNullException("text"); + if (text == null) throw new ArgumentNullException(nameof(text)); _text = text; } @@ -52,9 +56,9 @@ public override int Length /// Properties that may be represented by the token. /// Output for the rendered string. /// Supplies culture-specific formatting information, or null. - public override void Render(IReadOnlyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) + public override void Render(IPropertyDictionary properties, TextWriter output, IFormatProvider formatProvider = null) { - if (output == null) throw new ArgumentNullException("output"); + if (output == null) throw new ArgumentNullException(nameof(output)); output.Write(Text); } diff --git a/src/Serilog/Policies/EnumScalarConversionPolicy-net40.cs b/src/Serilog/Platform/TypeExtensions-net40.cs similarity index 53% rename from src/Serilog/Policies/EnumScalarConversionPolicy-net40.cs rename to src/Serilog/Platform/TypeExtensions-net40.cs index de317aa10..a9019d895 100644 --- a/src/Serilog/Policies/EnumScalarConversionPolicy-net40.cs +++ b/src/Serilog/Platform/TypeExtensions-net40.cs @@ -1,34 +1,31 @@ -// Copyright 2013 Serilog Contributors -// +// Copyright 2015 Serilog Contributors +// // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at -// +// // http://www.apache.org/licenses/LICENSE-2.0 -// +// // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -using Serilog.Core; -using Serilog.Events; +using System; -namespace Serilog.Policies +#if NET40 +namespace Serilog.Platform { - class EnumScalarConversionPolicy : IScalarConversionPolicy + /// + /// Backport of .NET 4.5 TypeInfo concept + /// + static class TypeExtensions { - public bool TryConvertToScalar(object value, ILogEventPropertyValueFactory propertyValueFactory, out ScalarValue result) + public static TypeInfo GetTypeInfo(this Type type) { - if (value.GetType().IsEnum) - { - result = new ScalarValue(value); - return true; - } - - result = null; - return false; + return new TypeInfo(type); } } } +#endif diff --git a/src/Serilog/Platform/TypeInfo-net40.cs b/src/Serilog/Platform/TypeInfo-net40.cs new file mode 100644 index 000000000..c52d76800 --- /dev/null +++ b/src/Serilog/Platform/TypeInfo-net40.cs @@ -0,0 +1,98 @@ +// Copyright 2015 Serilog Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +using System; +using System.Collections.Generic; +using System.Reflection; + +#if NET40 +namespace Serilog.Platform +{ + /// + /// Backport of .NET 4.5 TypeInfo concept + /// + internal class TypeInfo + { + readonly Type _type; + + public TypeInfo(Type type) + { + _type = type; + } + + public Type AsType() + { + return _type; + } + + public Type BaseType + { + get + { + return _type.BaseType; + } + } + + public bool IsGenericType + { + get { return _type.IsGenericType; } + } + + public Type[] GenericTypeArguments + { + get { return _type.GetGenericArguments(); } + } + + public bool IsEnum + { + get { return _type.IsEnum; } + } + + public Assembly Assembly + { + get { return _type.Assembly; } + } + + public bool IsSealed + { + get { return _type.IsSealed; } + } + + public bool IsAbstract + { + get { return _type.IsAbstract; } + } + + public bool IsNested + { + get { return _type.IsNested; } + } + + public IEnumerable DeclaredMethods + { + get { return _type.GetMethods(); } + } + + public IEnumerable DeclaredProperties + { + get { return _type.GetProperties(); } + } + + public bool IsAssignableFrom(TypeInfo targetType) + { + return _type.IsAssignableFrom(targetType._type); + } + } +} +#endif diff --git a/src/Serilog/Policies/ByteArrayScalarConversionPolicy.cs b/src/Serilog/Policies/ByteArrayScalarConversionPolicy.cs index 621c074d2..e8e2f316a 100644 --- a/src/Serilog/Policies/ByteArrayScalarConversionPolicy.cs +++ b/src/Serilog/Policies/ByteArrayScalarConversionPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Policies/DelegateDestructuringPolicy.cs b/src/Serilog/Policies/DelegateDestructuringPolicy.cs index efa272220..7d87279e3 100644 --- a/src/Serilog/Policies/DelegateDestructuringPolicy.cs +++ b/src/Serilog/Policies/DelegateDestructuringPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Policies/EnumScalarConversionPolicy.cs b/src/Serilog/Policies/EnumScalarConversionPolicy.cs index ee6beafb4..c4bf50051 100644 --- a/src/Serilog/Policies/EnumScalarConversionPolicy.cs +++ b/src/Serilog/Policies/EnumScalarConversionPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -16,6 +16,10 @@ using Serilog.Core; using Serilog.Events; +#if NET40 +using Serilog.Platform; +#endif + namespace Serilog.Policies { class EnumScalarConversionPolicy : IScalarConversionPolicy diff --git a/src/Serilog/Policies/NullableScalarConversionPolicy-net40.cs b/src/Serilog/Policies/NullableScalarConversionPolicy-net40.cs deleted file mode 100644 index 5c1096cf1..000000000 --- a/src/Serilog/Policies/NullableScalarConversionPolicy-net40.cs +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using Serilog.Core; -using Serilog.Events; - -namespace Serilog.Policies -{ - class NullableScalarConversionPolicy : IScalarConversionPolicy - { - public bool TryConvertToScalar(object value, ILogEventPropertyValueFactory propertyValueFactory, out ScalarValue result) - { - var type = value.GetType(); - if (!type.IsGenericType || type.GetGenericTypeDefinition() != typeof(Nullable<>)) - { - result = null; - return false; - } - - var dynamicValue = (dynamic)value; - var innerValue = dynamicValue.HasValue ? (object)dynamicValue.Value : null; - result = propertyValueFactory.CreatePropertyValue(innerValue) as ScalarValue; - - return result != null; - } - } -} diff --git a/src/Serilog/Policies/NullableScalarConversionPolicy.cs b/src/Serilog/Policies/NullableScalarConversionPolicy.cs index 0677b7f26..144dce41b 100644 --- a/src/Serilog/Policies/NullableScalarConversionPolicy.cs +++ b/src/Serilog/Policies/NullableScalarConversionPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,13 +23,26 @@ class NullableScalarConversionPolicy : IScalarConversionPolicy public bool TryConvertToScalar(object value, ILogEventPropertyValueFactory propertyValueFactory, out ScalarValue result) { var type = value.GetType(); - if (!type.IsConstructedGenericType || type.GetGenericTypeDefinition() != typeof(Nullable<>)) + if (! +#if NET40 + type.IsGenericType +#else + type.IsConstructedGenericType +#endif + || type.GetGenericTypeDefinition() != typeof(Nullable<>)) { result = null; return false; } - var targetType = type.GenericTypeArguments[0]; + var targetType = +#if NET40 + type.GetGenericArguments() +#else + type.GenericTypeArguments +#endif + [0]; + var innerValue = Convert.ChangeType(value, targetType); result = propertyValueFactory.CreatePropertyValue(innerValue) as ScalarValue; return result != null; diff --git a/src/Serilog/Policies/ProjectedDestructuringPolicy.cs b/src/Serilog/Policies/ProjectedDestructuringPolicy.cs index 0b62ba4d6..10f098cf7 100644 --- a/src/Serilog/Policies/ProjectedDestructuringPolicy.cs +++ b/src/Serilog/Policies/ProjectedDestructuringPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -25,15 +25,15 @@ class ProjectedDestructuringPolicy : IDestructuringPolicy public ProjectedDestructuringPolicy(Func canApply, Func projection) { - if (canApply == null) throw new ArgumentNullException("canApply"); - if (projection == null) throw new ArgumentNullException("projection"); + if (canApply == null) throw new ArgumentNullException(nameof(canApply)); + if (projection == null) throw new ArgumentNullException(nameof(projection)); _canApply = canApply; _projection = projection; } public bool TryDestructure(object value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventPropertyValue result) { - if (value == null) throw new ArgumentNullException("value"); + if (value == null) throw new ArgumentNullException(nameof(value)); if (!_canApply(value.GetType())) { diff --git a/src/Serilog/Policies/ReflectionTypesScalarConversionPolicy.cs b/src/Serilog/Policies/ReflectionTypesScalarConversionPolicy.cs index 0135a256d..7aa5c1c9f 100644 --- a/src/Serilog/Policies/ReflectionTypesScalarConversionPolicy.cs +++ b/src/Serilog/Policies/ReflectionTypesScalarConversionPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Policies/SimpleScalarConversionPolicy.cs b/src/Serilog/Policies/SimpleScalarConversionPolicy.cs index 8c770f3a7..40f079824 100644 --- a/src/Serilog/Policies/SimpleScalarConversionPolicy.cs +++ b/src/Serilog/Policies/SimpleScalarConversionPolicy.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Properties/AssemblyInfo.cs b/src/Serilog/Properties/AssemblyInfo.cs deleted file mode 100644 index 603b63da6..000000000 --- a/src/Serilog/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; - -[assembly: AssemblyTitle("Serilog")] -[assembly: AssemblyDescription("Serilog Logging Library")] -[assembly: AssemblyCopyright("Copyright © Serilog Contributors 2014")] - -#if !ASPNETCORE50 -[assembly: InternalsVisibleTo("Serilog.FullNetFx, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" + - "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" + - "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" + - "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" + - "b19485ec")] - -[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" + - "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" + - "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" + - "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" + - "b19485ec")] -#else -[assembly: InternalsVisibleTo("Serilog.FullNetFx")] -[assembly: InternalsVisibleTo("Serilog.Tests")] -#endif diff --git a/src/Serilog/Properties/InternalsVisibleTo.cs b/src/Serilog/Properties/InternalsVisibleTo.cs new file mode 100644 index 000000000..c870b0bea --- /dev/null +++ b/src/Serilog/Properties/InternalsVisibleTo.cs @@ -0,0 +1,12 @@ +using System.Runtime.CompilerServices; + +#if DNXCORE50 +[assembly: InternalsVisibleTo("Serilog.Tests")] +#else +[assembly: InternalsVisibleTo("Serilog.Tests, PublicKey=" + + "0024000004800000940000000602000000240000525341310004000001000100fb8d13fd344a1c" + + "6fe0fe83ef33c1080bf30690765bc6eb0df26ebfdf8f21670c64265b30db09f73a0dea5b3db4c9" + + "d18dbf6d5a25af5ce9016f281014d79dc3b4201ac646c451830fc7e61a2dfd633d34c39f87b818" + + "94191652df5ac63cc40c77f3542f702bda692e6e8a9158353df189007a49da0f3cfd55eb250066" + + "b19485ec")] +#endif \ No newline at end of file diff --git a/src/Serilog/Serilog-net40.csproj b/src/Serilog/Serilog-net40.csproj deleted file mode 100644 index c15576efc..000000000 --- a/src/Serilog/Serilog-net40.csproj +++ /dev/null @@ -1,136 +0,0 @@ - - - - - Debug - AnyCPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} - Library - Properties - Serilog - Serilog - v4.0 - 512 - - - true - full - false - bin40\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin40\Debug\Serilog.XML - - - pdbonly - true - bin40\Release\ - TRACE - prompt - 4 - true - bin40\Release\Serilog.XML - - - true - - - ..\..\assets\Serilog.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - - - Serilog.snk - - - Designer - - - - - - - - - - \ No newline at end of file diff --git a/src/Serilog/Serilog.csproj b/src/Serilog/Serilog.csproj deleted file mode 100644 index 4c15e5fa8..000000000 --- a/src/Serilog/Serilog.csproj +++ /dev/null @@ -1,137 +0,0 @@ - - - - - Debug - AnyCPU - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} - Library - Properties - Serilog - Serilog - v4.5 - Profile259 - 512 - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - true - bin\Debug\Serilog.XML - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - bin\Release\Serilog.XML - - - true - - - ..\..\assets\Serilog.snk - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Properties\CommonAssemblyInfo.cs - - - - - - - - Serilog.snk - - - Designer - - - - - \ No newline at end of file diff --git a/src/Serilog/Serilog.nuspec b/src/Serilog/Serilog.nuspec deleted file mode 100644 index 7e211670e..000000000 --- a/src/Serilog/Serilog.nuspec +++ /dev/null @@ -1,31 +0,0 @@ - - - - Serilog - $version$ - Serilog Contributors - Simple .NET logging with fully-structured events - en-US - http://serilog.net - http://www.apache.org/licenses/LICENSE-2.0 - http://serilog.net/images/serilog-nuget.png - serilog logging events semantic structured - - - - - - - - - - - - - - - - - - - diff --git a/src/Serilog/Serilog.xproj b/src/Serilog/Serilog.xproj new file mode 100644 index 000000000..d21570f80 --- /dev/null +++ b/src/Serilog/Serilog.xproj @@ -0,0 +1,24 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 803cd13a-d54b-4cec-a55f-e22ae3d93b3c + Serilog + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + + + True + + + True + + + \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Settings/AppSettings/AppSettingsSettings.cs b/src/Serilog/Settings/AppSettings/AppSettingsSettings.cs similarity index 81% rename from src/Serilog.FullNetFx/Settings/AppSettings/AppSettingsSettings.cs rename to src/Serilog/Settings/AppSettings/AppSettingsSettings.cs index a611928bd..e8d02f019 100644 --- a/src/Serilog.FullNetFx/Settings/AppSettings/AppSettingsSettings.cs +++ b/src/Serilog/Settings/AppSettings/AppSettingsSettings.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. +#if !PROFILE259 && !DNXCORE50 using System; using System.Configuration; @@ -27,12 +28,13 @@ class AppSettingsSettings : ILoggerSettings public AppSettingsSettings(string settingPrefix = null) { - _settingPrefix = settingPrefix == null ? "serilog:" : string.Format("{0}:serilog:", settingPrefix); + _settingPrefix = settingPrefix == null ? "serilog:" : $"{settingPrefix}:serilog:"; + System.Console.WriteLine(_settingPrefix); } public void Configure(LoggerConfiguration loggerConfiguration) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); var settings = ConfigurationManager.AppSettings; @@ -40,11 +42,9 @@ public void Configure(LoggerConfiguration loggerConfiguration) .Where(k => k.StartsWith(_settingPrefix)) .ToDictionary(k => k.Substring(_settingPrefix.Length), k => Environment.ExpandEnvironmentVariables(settings[k])); - // Add the FullNetFx assembly by default so that all built-in Serilog sinks are available without "using" - pairs.Add("using:_ImpliedSerilogFullNetFx", typeof(AppSettingsSettings).Assembly.FullName); - var keyValuePairSettings = new KeyValuePairSettings(pairs); keyValuePairSettings.Configure(loggerConfiguration); } } } +#endif diff --git a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings-net40.cs b/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings-net40.cs deleted file mode 100644 index cc1fc292e..000000000 --- a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings-net40.cs +++ /dev/null @@ -1,171 +0,0 @@ -// Copyright 2014 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Text.RegularExpressions; -using Serilog.Configuration; -using Serilog.Events; - -namespace Serilog.Settings.KeyValuePairs -{ - class KeyValuePairSettings : ILoggerSettings - { - const string UsingDirective = "using"; - const string WriteToDirective = "write-to"; - const string MinimumLevelDirective = "minimum-level"; - const string EnrichWithPropertyDirective = "enrich:with-property"; - - const string UsingDirectiveFullFormPrefix = "using:"; - const string EnrichWithPropertyDirectivePrefix = "enrich:with-property:"; - - const string WriteToDirectiveRegex = @"^write-to:(?[A-Za-z0-9]*)(\.(?[A-Za-z0-9]*)){0,1}$"; - - readonly string[] _supportedDirectives = - { - UsingDirective, - WriteToDirective, - MinimumLevelDirective, - EnrichWithPropertyDirective - }; - - readonly Dictionary _settings; - - public KeyValuePairSettings(IEnumerable> settings) - { - if (settings == null) throw new ArgumentNullException("settings"); - _settings = settings.ToDictionary(s => s.Key, s => s.Value); - } - - public void Configure(LoggerConfiguration loggerConfiguration) - { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); - - var directives = _settings.Keys - .Where(k => _supportedDirectives.Any(k.StartsWith)) - .ToDictionary(k => k, k => _settings[k]); - - string minimumLevelDirective; - LogEventLevel minimumLevel; - if (directives.TryGetValue(MinimumLevelDirective, out minimumLevelDirective) && - Enum.TryParse(minimumLevelDirective, out minimumLevel)) - { - loggerConfiguration.MinimumLevel.Is(minimumLevel); - } - - foreach (var enrichDirective in directives.Where(dir => - dir.Key.StartsWith(EnrichWithPropertyDirectivePrefix) && dir.Key.Length > EnrichWithPropertyDirectivePrefix.Length)) - { - var name = enrichDirective.Key.Substring(EnrichWithPropertyDirectivePrefix.Length); - loggerConfiguration.Enrich.WithProperty(name, enrichDirective.Value); - } - - var splitWriteTo = new Regex(WriteToDirectiveRegex); - - var sinkDirectives = (from wt in directives - where splitWriteTo.IsMatch(wt.Key) - let match = splitWriteTo.Match(wt.Key) - let call = new - { - Method = match.Groups["method"].Value, - Argument = match.Groups["argument"].Value, - wt.Value - } - group call by call.Method).ToList(); - - if (sinkDirectives.Any()) - { - var configurationAssemblies = LoadConfigurationAssemblies(directives); - var sinkConfigurationMethods = FindSinkConfigurationMethods(configurationAssemblies); - - foreach (var sinkDirective in sinkDirectives) - { - var target = sinkConfigurationMethods - .Where(m => m.Name == sinkDirective.Key && - m.GetParameters().Skip(1).All(p => p.HasDefaultValue() || sinkDirective.Any(s => s.Argument == p.Name))) - .OrderByDescending(m => m.GetParameters().Length) - .FirstOrDefault(); - - if (target != null) - { - var config = loggerConfiguration.WriteTo; - - var call = (from p in target.GetParameters().Skip(1) - let directive = sinkDirective.FirstOrDefault(s => s.Argument == p.Name) - select directive == null ? p.DefaultValue : ConvertToType(directive.Value, p.ParameterType)).ToList(); - - call.Insert(0, config); - - target.Invoke(null, call.ToArray()); - } - } - } - } - - internal static IEnumerable LoadConfigurationAssemblies(Dictionary directives) - { - var configurationAssemblies = new List { typeof(ILogger).GetTypeInfo().Assembly }; - - foreach (var usingDirective in directives.Where(d => d.Key.Equals(UsingDirective) || - d.Key.StartsWith(UsingDirectiveFullFormPrefix))) - { - configurationAssemblies.Add(Assembly.Load(new AssemblyName(usingDirective.Value))); - } - - return configurationAssemblies.Distinct(); - } - - internal static object ConvertToType(string value, Type toType) - { - var toTypeInfo = toType.GetTypeInfo(); - if (toTypeInfo.IsGenericType && toType.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - if (string.IsNullOrEmpty(value)) - return null; - - // unwrap Nullable<> type since we're not handling null situations - toType = toTypeInfo.GenericTypeArguments[0]; - toTypeInfo = toType.GetTypeInfo(); - } - - if (toTypeInfo.IsEnum) - return Enum.Parse(toType, value); - - var extendedTypeConversions = new Dictionary> - { - { typeof(Uri), s => new Uri(s) }, - { typeof(TimeSpan), s => TimeSpan.Parse(s) } - }; - - var convertor = extendedTypeConversions - .Where(t => t.Key.GetTypeInfo().IsAssignableFrom(toTypeInfo)) - .Select(t => t.Value) - .FirstOrDefault(); - - return convertor == null ? Convert.ChangeType(value, toType) : convertor(value); - } - - internal static IEnumerable FindSinkConfigurationMethods(IEnumerable configurationAssemblies) - { - return configurationAssemblies - .SelectMany(a => a.GetExportedTypes().Select(t => t.GetTypeInfo()).Where(t => t.IsSealed && t.IsAbstract && !t.IsNested)) - .SelectMany(t => t.DeclaredMethods) - .Where(m => m.IsStatic && m.IsPublic && m.IsDefined(typeof(ExtensionAttribute), false)) - .Where(m => m.GetParameters()[0].ParameterType == typeof(LoggerSinkConfiguration)); - } - } -} diff --git a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs b/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs index dc4e008d8..1d2b35d8c 100644 --- a/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs +++ b/src/Serilog/Settings/KeyValuePairs/KeyValuePairSettings.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +21,10 @@ using Serilog.Configuration; using Serilog.Events; +#if NET40 +using Serilog.Platform; +#endif + namespace Serilog.Settings.KeyValuePairs { class KeyValuePairSettings : ILoggerSettings @@ -47,13 +51,13 @@ class KeyValuePairSettings : ILoggerSettings public KeyValuePairSettings(IEnumerable> settings) { - if (settings == null) throw new ArgumentNullException("settings"); + if (settings == null) throw new ArgumentNullException(nameof(settings)); _settings = settings.ToDictionary(s => s.Key, s => s.Value); } public void Configure(LoggerConfiguration loggerConfiguration) { - if (loggerConfiguration == null) throw new ArgumentNullException("loggerConfiguration"); + if (loggerConfiguration == null) throw new ArgumentNullException(nameof(loggerConfiguration)); var directives = _settings.Keys .Where(k => _supportedDirectives.Any(k.StartsWith)) @@ -96,7 +100,13 @@ where splitWriteTo.IsMatch(wt.Key) { var target = sinkConfigurationMethods .Where(m => m.Name == sinkDirective.Key && - m.GetParameters().Skip(1).All(p => p.HasDefaultValue || sinkDirective.Any(s => s.Argument == p.Name))) + m.GetParameters().Skip(1).All(p => +#if NET40 + (p.Attributes & ParameterAttributes.HasDefault) != ParameterAttributes.None +#else + p.HasDefaultValue +#endif + || sinkDirective.Any(s => s.Argument == p.Name))) .OrderByDescending(m => m.GetParameters().Length) .FirstOrDefault(); @@ -156,13 +166,23 @@ internal static object ConvertToType(string value, Type toType) .Select(t => t.Value) .FirstOrDefault(); +#if !PROFILE259 + return convertor == null ? Convert.ChangeType(value, toType) : convertor(value); +#else return convertor == null ? Convert.ChangeType(value, toType) : convertor(value); +#endif } internal static IEnumerable FindSinkConfigurationMethods(IEnumerable configurationAssemblies) { return configurationAssemblies - .SelectMany(a => a.ExportedTypes.Select(t => t.GetTypeInfo()).Where(t => t.IsSealed && t.IsAbstract && !t.IsNested)) + .SelectMany(a => a. +#if NET40 + GetExportedTypes() +#else + ExportedTypes +#endif + .Select(t => t.GetTypeInfo()).Where(t => t.IsSealed && t.IsAbstract && !t.IsNested)) .SelectMany(t => t.DeclaredMethods) .Where(m => m.IsStatic && m.IsPublic && m.IsDefined(typeof(ExtensionAttribute), false)) .Where(m => m.GetParameters()[0].ParameterType == typeof(LoggerSinkConfiguration)); diff --git a/src/Serilog/Settings/KeyValuePairs/ParameterInfoExtensions-40.cs b/src/Serilog/Settings/KeyValuePairs/ParameterInfoExtensions-40.cs deleted file mode 100644 index d39a31fd0..000000000 --- a/src/Serilog/Settings/KeyValuePairs/ParameterInfoExtensions-40.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Reflection; - -namespace Serilog.Settings.KeyValuePairs -{ - /// - /// Backport of .Net 4.5 features - /// - static class ParameterInfoExtensions - { - public static bool HasDefaultValue(this ParameterInfo parameterInfo) - { - return (parameterInfo.Attributes & ParameterAttributes.HasDefault) != ParameterAttributes.None; - } - } -} \ No newline at end of file diff --git a/src/Serilog/Settings/KeyValuePairs/TypeExtensions-40.cs b/src/Serilog/Settings/KeyValuePairs/TypeExtensions-40.cs deleted file mode 100644 index 43004ff56..000000000 --- a/src/Serilog/Settings/KeyValuePairs/TypeExtensions-40.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace Serilog.Settings.KeyValuePairs -{ - /// - /// Backport of .Net 4.5 TypeInfo concept - /// - static class TypeExtensions - { - internal static TypeInfo GetTypeInfo(this Type type) - { - return new TypeInfo(type); - } - - internal class TypeInfo - { - readonly Type type; - - public TypeInfo(Type type) - { - this.type = type; - } - - public Type Type - { - get { return type; } - } - - public bool IsGenericType - { - get { return type.IsGenericType; } - } - - public Type[] GenericTypeArguments - { - get { return type.GetGenericArguments(); } - } - - public bool IsEnum - { - get { return type.IsEnum; } - } - - public Assembly Assembly - { - get { return type.Assembly; } - } - - public bool IsSealed - { - get { return type.IsSealed; } - } - - public bool IsAbstract - { - get { return type.IsAbstract; } - } - - public bool IsNested - { - get { return type.IsNested; } - } - - public IEnumerable DeclaredMethods - { - get { return type.GetMethods(); } - } - - public bool IsAssignableFrom(TypeInfo targetType) - { - return type.IsAssignableFrom(targetType.Type); - } - } - } -} \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs b/src/Serilog/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs similarity index 93% rename from src/Serilog.FullNetFx/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs rename to src/Serilog/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs index 6f8e91d81..ccdceab73 100644 --- a/src/Serilog.FullNetFx/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs +++ b/src/Serilog/Sinks/DiagnosticTrace/DiagnosticTraceSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -19,6 +19,7 @@ using Serilog.Events; using Serilog.Formatting; +#if !PROFILE259 namespace Serilog.Sinks.DiagnosticTrace { class DiagnosticTraceSink : ILogEventSink @@ -27,13 +28,13 @@ class DiagnosticTraceSink : ILogEventSink public DiagnosticTraceSink(ITextFormatter textFormatter) { - if (textFormatter == null) throw new ArgumentNullException("textFormatter"); + if (textFormatter == null) throw new ArgumentNullException(nameof(textFormatter)); _textFormatter = textFormatter; } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); var sr = new StringWriter(); _textFormatter.Format(logEvent, sr); @@ -50,3 +51,4 @@ public void Emit(LogEvent logEvent) } } } +#endif diff --git a/src/Serilog.FullNetFx/Sinks/IOFile/CharacterCountLimitedTextWriter.cs b/src/Serilog/Sinks/IOFile/CharacterCountLimitedTextWriter.cs similarity index 96% rename from src/Serilog.FullNetFx/Sinks/IOFile/CharacterCountLimitedTextWriter.cs rename to src/Serilog/Sinks/IOFile/CharacterCountLimitedTextWriter.cs index 1f58ae9d9..eaf4d03da 100644 --- a/src/Serilog.FullNetFx/Sinks/IOFile/CharacterCountLimitedTextWriter.cs +++ b/src/Serilog/Sinks/IOFile/CharacterCountLimitedTextWriter.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -17,6 +17,7 @@ using System.Text; using System.Threading; +#if !PROFILE259 namespace Serilog.Sinks.IOFile { sealed class CharacterCountLimitedTextWriter : TextWriter @@ -26,7 +27,7 @@ sealed class CharacterCountLimitedTextWriter : TextWriter public CharacterCountLimitedTextWriter(TextWriter outputWriter, long remainingCharacters) { - if (outputWriter == null) throw new ArgumentNullException("outputWriter"); + if (outputWriter == null) throw new ArgumentNullException(nameof(outputWriter)); _outputWriter = outputWriter; _remainingCharacters = remainingCharacters; } @@ -80,4 +81,5 @@ public override void Flush() _outputWriter.Flush(); } } -} \ No newline at end of file +} +#endif diff --git a/src/Serilog.FullNetFx/Sinks/IOFile/FileSink.cs b/src/Serilog/Sinks/IOFile/FileSink.cs similarity index 95% rename from src/Serilog.FullNetFx/Sinks/IOFile/FileSink.cs rename to src/Serilog/Sinks/IOFile/FileSink.cs index 91a2c63a2..2d7d7dd56 100644 --- a/src/Serilog.FullNetFx/Sinks/IOFile/FileSink.cs +++ b/src/Serilog/Sinks/IOFile/FileSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,7 @@ using Serilog.Events; using Serilog.Formatting; +#if !PROFILE259 namespace Serilog.Sinks.IOFile { /// @@ -43,8 +44,8 @@ public sealed class FileSink : ILogEventSink, IDisposable /// public FileSink(string path, ITextFormatter textFormatter, long? fileSizeLimitBytes, Encoding encoding = null) { - if (path == null) throw new ArgumentNullException("path"); - if (textFormatter == null) throw new ArgumentNullException("textFormatter"); + if (path == null) throw new ArgumentNullException(nameof(path)); + if (textFormatter == null) throw new ArgumentNullException(nameof(textFormatter)); if (fileSizeLimitBytes.HasValue && fileSizeLimitBytes < 0) throw new ArgumentException("Negative value provided; file size limit must be non-negative"); _textFormatter = textFormatter; @@ -87,7 +88,7 @@ static void TryCreateDirectory(string path) /// The log event to write. public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); lock (_syncRoot) { _textFormatter.Format(logEvent, _output); @@ -105,3 +106,4 @@ public void Dispose() } } } +#endif diff --git a/src/Serilog.FullNetFx/Sinks/IOFile/NullSink.cs b/src/Serilog/Sinks/IOFile/NullSink.cs similarity index 95% rename from src/Serilog.FullNetFx/Sinks/IOFile/NullSink.cs rename to src/Serilog/Sinks/IOFile/NullSink.cs index 811a84e94..20e174adc 100644 --- a/src/Serilog.FullNetFx/Sinks/IOFile/NullSink.cs +++ b/src/Serilog/Sinks/IOFile/NullSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog/Sinks/IOTextWriter/TextWriterSink.cs b/src/Serilog/Sinks/IOTextWriter/TextWriterSink.cs index ed0a78bd2..ce2da366c 100644 --- a/src/Serilog/Sinks/IOTextWriter/TextWriterSink.cs +++ b/src/Serilog/Sinks/IOTextWriter/TextWriterSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -28,14 +28,14 @@ class TextWriterSink : ILogEventSink public TextWriterSink(TextWriter textWriter, ITextFormatter textFormatter) { - if (textFormatter == null) throw new ArgumentNullException("textFormatter"); + if (textFormatter == null) throw new ArgumentNullException(nameof(textFormatter)); _textWriter = textWriter; _textFormatter = textFormatter; } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); lock (_syncRoot) { _textFormatter.Format(logEvent, _textWriter); diff --git a/src/Serilog/Sinks/Observable/ObservableSink-net40.cs b/src/Serilog/Sinks/Observable/ObservableSink-net40.cs deleted file mode 100644 index acd5e2005..000000000 --- a/src/Serilog/Sinks/Observable/ObservableSink-net40.cs +++ /dev/null @@ -1,113 +0,0 @@ -// Copyright 2013 Serilog Contributors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading; -using Serilog.Core; -using Serilog.Events; - -namespace Serilog.Sinks.Observable -{ - sealed class ObservableSink : IObservable, ILogEventSink, IDisposable - { - readonly object _syncRoot = new object(); - IList> _observers = new List>(); - bool _disposed; - - sealed class Unsubscriber : IDisposable - { - readonly ObservableSink _sink; - readonly IObserver _observer; - - public Unsubscriber(ObservableSink sink, IObserver observer) - { - if (sink == null) throw new ArgumentNullException("sink"); - if (observer == null) throw new ArgumentNullException("observer"); - _sink = sink; - _observer = observer; - } - - public void Dispose() - { - _sink.Unsubscribe(_observer); - } - } - - public IDisposable Subscribe(IObserver observer) - { - if (observer == null) throw new ArgumentNullException("observer"); - - lock (_syncRoot) - { - // Makes the assumption that list iteration is not - // mutating - correct but not guaranteed by the BCL. - var newObservers = _observers.ToList(); - newObservers.Add(observer); - Interlocked.Exchange(ref _observers, newObservers); - } - - return new Unsubscriber(this, observer); - } - - void Unsubscribe(IObserver observer) - { - if (observer == null) throw new ArgumentNullException("observer"); - - lock (_syncRoot) - _observers.Remove(observer); - } - - public void Emit(LogEvent logEvent) - { - if (logEvent == null) throw new ArgumentNullException("logEvent"); - - Thread.MemoryBarrier(); - - IList exceptions = null; - - foreach (var observer in _observers) - { - try - { - observer.OnNext(logEvent); - } - catch (Exception ex) - { - if (exceptions == null) - exceptions = new List(); - exceptions.Add(ex); - } - } - - if (exceptions != null) - throw new AggregateException("At least one observer failed to accept the event", exceptions); - } - - public void Dispose() - { - lock (_syncRoot) - { - if (_disposed) return; - - _disposed = true; - foreach (var observer in _observers) - { - observer.OnCompleted(); - } - } - } - } -} diff --git a/src/Serilog/Sinks/Observable/ObservableSink.cs b/src/Serilog/Sinks/Observable/ObservableSink.cs index cfc34ddad..0edf199fd 100644 --- a/src/Serilog/Sinks/Observable/ObservableSink.cs +++ b/src/Serilog/Sinks/Observable/ObservableSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,10 @@ namespace Serilog.Sinks.Observable { sealed class ObservableSink : IObservable, ILogEventSink, IDisposable { + // Uses memory barriers for non-blocking reads during Emit, and replaces the + // list of observers completely upon subscribe/unsubscribe. + // Makes the assumption that list iteration is not + // mutating - correct but not guaranteed by the BCL. readonly object _syncRoot = new object(); IList> _observers = new List>(); bool _disposed; @@ -34,8 +38,8 @@ sealed class Unsubscriber : IDisposable public Unsubscriber(ObservableSink sink, IObserver observer) { - if (sink == null) throw new ArgumentNullException("sink"); - if (observer == null) throw new ArgumentNullException("observer"); + if (sink == null) throw new ArgumentNullException(nameof(sink)); + if (observer == null) throw new ArgumentNullException(nameof(observer)); _sink = sink; _observer = observer; } @@ -48,15 +52,20 @@ public void Dispose() public IDisposable Subscribe(IObserver observer) { - if (observer == null) throw new ArgumentNullException("observer"); + if (observer == null) throw new ArgumentNullException(nameof(observer)); lock (_syncRoot) { - // Makes the assumption that list iteration is not - // mutating - correct but not guaranteed by the BCL. - var newObservers = _observers.ToList(); - newObservers.Add(observer); - Interlocked.Exchange(ref _observers, newObservers); + if (_disposed) + throw new ObjectDisposedException(message: "The Serilog Observable sink is disposed.", innerException: null); + + var old = _observers; + var newObservers = _observers.Concat(new [] { observer}).ToList(); + while (old != Interlocked.Exchange(ref _observers, newObservers)) + { + old = _observers; + newObservers = _observers.Concat(new[] { observer }).ToList(); + } } return new Unsubscriber(this, observer); @@ -64,20 +73,37 @@ public IDisposable Subscribe(IObserver observer) void Unsubscribe(IObserver observer) { - if (observer == null) throw new ArgumentNullException("observer"); + if (observer == null) throw new ArgumentNullException(nameof(observer)); lock (_syncRoot) - _observers.Remove(observer); + { + if (_disposed) + throw new ObjectDisposedException(message: "The Serilog Observable sink is disposed.", innerException: null); + + var old = _observers; + var newObservers = _observers.Except(new[] { observer }).ToList(); + while (old != Interlocked.Exchange(ref _observers, newObservers)) + { + old = _observers; + newObservers = _observers.Except(new[] { observer }).ToList(); + } + } } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); +#if NET40 + Thread.MemoryBarrier(); +#else Interlocked.MemoryBarrier(); +#endif IList exceptions = null; + // Mutations are made by replacing _observers wholesale. + // ReSharper disable once InconsistentlySynchronizedField foreach (var observer in _observers) { try diff --git a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/BatchedConnectionStatus.cs b/src/Serilog/Sinks/PeriodicBatching/BatchedConnectionStatus.cs similarity index 96% rename from src/Serilog.FullNetFx/Sinks/PeriodicBatching/BatchedConnectionStatus.cs rename to src/Serilog/Sinks/PeriodicBatching/BatchedConnectionStatus.cs index 19301a410..336ccbd29 100644 --- a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/BatchedConnectionStatus.cs +++ b/src/Serilog/Sinks/PeriodicBatching/BatchedConnectionStatus.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -14,6 +14,7 @@ using System; +#if !PROFILE259 namespace Serilog.Sinks.PeriodicBatching { /// @@ -46,7 +47,7 @@ class BatchedConnectionStatus public BatchedConnectionStatus(TimeSpan period) { - if (period < TimeSpan.Zero) throw new ArgumentOutOfRangeException("period", "The batching period must be a positive timespan"); + if (period < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(period), "The batching period must be a positive timespan"); _period = period; } @@ -104,4 +105,5 @@ public bool ShouldDropQueue } } } -} \ No newline at end of file +} +#endif diff --git a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink.cs b/src/Serilog/Sinks/PeriodicBatching/PeriodicBatchingSink.cs similarity index 91% rename from src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink.cs rename to src/Serilog/Sinks/PeriodicBatching/PeriodicBatchingSink.cs index ac896323a..0d27e6947 100644 --- a/src/Serilog.FullNetFx/Sinks/PeriodicBatching/PeriodicBatchingSink.cs +++ b/src/Serilog/Sinks/PeriodicBatching/PeriodicBatchingSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -#if !ASPNETCORE50 +#if !PROFILE259 using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -42,7 +42,11 @@ public abstract class PeriodicBatchingSink : ILogEventSink, IDisposable readonly Queue _waitingBatch = new Queue(); readonly object _stateLock = new object(); +#if !DNXCORE50 readonly Timer _timer; +#else + readonly PortableTimer _timer; +#endif bool _unloading; bool _started; @@ -55,14 +59,19 @@ protected PeriodicBatchingSink(int batchSizeLimit, TimeSpan period) { _batchSizeLimit = batchSizeLimit; _queue = new ConcurrentQueue(); - _timer = new Timer(s => OnTick()); _status = new BatchedConnectionStatus(period); +#if !DNXCORE50 + _timer = new Timer(s => OnTick(), null, -1, -1); AppDomain.CurrentDomain.DomainUnload += OnAppDomainUnloading; AppDomain.CurrentDomain.ProcessExit += OnAppDomainUnloading; AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnloading; +#else + _timer = new PortableTimer(cancel => OnTick()); +#endif } +#if !DNXCORE50 void OnAppDomainUnloading(object sender, EventArgs args) { var eventArgs = args as UnhandledExceptionEventArgs; @@ -71,6 +80,7 @@ void OnAppDomainUnloading(object sender, EventArgs args) CloseAndFlush(); } +#endif void CloseAndFlush() { @@ -82,6 +92,7 @@ void CloseAndFlush() _unloading = true; } +#if !DNXCORE50 AppDomain.CurrentDomain.DomainUnload -= OnAppDomainUnloading; AppDomain.CurrentDomain.ProcessExit -= OnAppDomainUnloading; AppDomain.CurrentDomain.UnhandledException -= OnAppDomainUnloading; @@ -89,6 +100,9 @@ void CloseAndFlush() var wh = new ManualResetEvent(false); if (_timer.Dispose(wh)) wh.WaitOne(); +#else + _timer.Dispose(); +#endif OnTick(); } @@ -186,11 +200,25 @@ void OnTick() lock (_stateLock) { if (!_unloading) - _timer.Change(_status.NextInterval, Timeout.InfiniteTimeSpan); + SetTimer(_status.NextInterval); } } } + void SetTimer(TimeSpan interval) + { +#if DNXCORE50 + _timer.Start(interval); +#else + _timer.Change(interval, +#if NET40 + TimeSpan.FromMilliseconds(-1)); +#else + Timeout.InfiniteTimeSpan); +#endif +#endif + } + /// /// Emit the provided log event to the sink. If the sink is being disposed or /// the app domain unloaded, then the event is ignored. @@ -204,7 +232,7 @@ void OnTick() /// public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); lock (_stateLock) { @@ -214,7 +242,7 @@ public void Emit(LogEvent logEvent) // Special handling to try to get the first event across as quickly // as possible to show we're alive! _started = true; - _timer.Change(TimeSpan.Zero, Timeout.InfiniteTimeSpan); + SetTimer(TimeSpan.Zero); } } @@ -241,4 +269,4 @@ protected virtual void OnEmptyBatch() } } } -#endif \ No newline at end of file +#endif diff --git a/src/Serilog/Sinks/PeriodicBatching/PortableTimer.cs b/src/Serilog/Sinks/PeriodicBatching/PortableTimer.cs new file mode 100644 index 000000000..d661a70c1 --- /dev/null +++ b/src/Serilog/Sinks/PeriodicBatching/PortableTimer.cs @@ -0,0 +1,108 @@ +// Copyright 2013-2015 Serilog Contributors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#if DNXCORE50 +using Serilog.Debugging; +using System; +using System.Threading; +using System.Threading.Tasks; + +namespace Serilog.Sinks.PeriodicBatching +{ + class PortableTimer : IDisposable + { + enum PortableTimerState + { + NotWaiting, + Waiting, + Active, + Disposed + } + + readonly object _stateLock = new object(); + PortableTimerState _state = PortableTimerState.NotWaiting; + + readonly Action _onTick; + readonly CancellationTokenSource _cancel = new CancellationTokenSource(); + + public PortableTimer(Action onTick) + { + if (onTick == null) throw new ArgumentNullException(nameof(onTick)); + _onTick = onTick; + } + + public async void Start(TimeSpan interval) + { + if (interval < TimeSpan.Zero) throw new ArgumentOutOfRangeException(nameof(interval)); + + lock (_stateLock) + { + if (_state == PortableTimerState.Disposed) + throw new ObjectDisposedException("PortableTimer"); + + // There's a little bit of raciness here, but it's needed to support the + // current API, which allows the tick handler to reenter and set the next interval. + + if (_state == PortableTimerState.Waiting) + throw new InvalidOperationException("The timer is already set."); + + if (_cancel.IsCancellationRequested) return; + + _state = PortableTimerState.Waiting; + } + + try + { + await Task.Delay(interval, _cancel.Token).ConfigureAwait(false); + + _state = PortableTimerState.Active; + + if (!_cancel.Token.IsCancellationRequested) + { + _onTick(_cancel.Token); + } + } + catch (TaskCanceledException tcx) + { + SelfLog.WriteLine("The timer was canceled during invocation: {0}", tcx); + } + finally + { + lock (_stateLock) + _state = PortableTimerState.NotWaiting; + } + } + + public void Dispose() + { + _cancel.Cancel(); + + while (true) + { + lock (_stateLock) + { + if (_state == PortableTimerState.Disposed || + _state == PortableTimerState.NotWaiting) + { + _state = PortableTimerState.Disposed; + return; + } + } + + Thread.Sleep(10); + } + } + } +} +#endif diff --git a/src/Serilog.FullNetFx/Sinks/RollingFile/Clock.cs b/src/Serilog/Sinks/RollingFile/Clock.cs similarity index 96% rename from src/Serilog.FullNetFx/Sinks/RollingFile/Clock.cs rename to src/Serilog/Sinks/RollingFile/Clock.cs index 5020aaa3e..fd11187b3 100644 --- a/src/Serilog.FullNetFx/Sinks/RollingFile/Clock.cs +++ b/src/Serilog/Sinks/RollingFile/Clock.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog.FullNetFx/Sinks/RollingFile/RollingFileSink.cs b/src/Serilog/Sinks/RollingFile/RollingFileSink.cs similarity index 98% rename from src/Serilog.FullNetFx/Sinks/RollingFile/RollingFileSink.cs rename to src/Serilog/Sinks/RollingFile/RollingFileSink.cs index 239341a25..afce3e64d 100644 --- a/src/Serilog.FullNetFx/Sinks/RollingFile/RollingFileSink.cs +++ b/src/Serilog/Sinks/RollingFile/RollingFileSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -23,6 +23,7 @@ using Serilog.Formatting; using Serilog.Sinks.IOFile; +#if !PROFILE259 namespace Serilog.Sinks.RollingFile { /// @@ -61,7 +62,7 @@ public RollingFileSink(string pathFormat, int? retainedFileCountLimit, Encoding encoding = null) { - if (pathFormat == null) throw new ArgumentNullException("pathFormat"); + if (pathFormat == null) throw new ArgumentNullException(nameof(pathFormat)); if (fileSizeLimitBytes.HasValue && fileSizeLimitBytes < 0) throw new ArgumentException("Negative value provided; file size limit must be non-negative"); if (retainedFileCountLimit.HasValue && retainedFileCountLimit < 1) throw new ArgumentException("Zero or negative value provided; retained file count limit must be at least 1"); @@ -81,7 +82,7 @@ public RollingFileSink(string pathFormat, /// would indicate. public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); lock (_syncRoot) { @@ -225,3 +226,4 @@ void CloseFile() } } } +#endif \ No newline at end of file diff --git a/src/Serilog.FullNetFx/Sinks/RollingFile/RollingLogFile.cs b/src/Serilog/Sinks/RollingFile/RollingLogFile.cs similarity index 96% rename from src/Serilog.FullNetFx/Sinks/RollingFile/RollingLogFile.cs rename to src/Serilog/Sinks/RollingFile/RollingLogFile.cs index 9edae7a7f..bc6e52828 100644 --- a/src/Serilog.FullNetFx/Sinks/RollingFile/RollingLogFile.cs +++ b/src/Serilog/Sinks/RollingFile/RollingLogFile.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/Serilog.FullNetFx/Sinks/RollingFile/TemplatedPathRoller.cs b/src/Serilog/Sinks/RollingFile/TemplatedPathRoller.cs similarity index 97% rename from src/Serilog.FullNetFx/Sinks/RollingFile/TemplatedPathRoller.cs rename to src/Serilog/Sinks/RollingFile/TemplatedPathRoller.cs index 2af9296f1..93fe3077d 100644 --- a/src/Serilog.FullNetFx/Sinks/RollingFile/TemplatedPathRoller.cs +++ b/src/Serilog/Sinks/RollingFile/TemplatedPathRoller.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ using System.IO; using System.Text.RegularExpressions; +#if !PROFILE259 namespace Serilog.Sinks.RollingFile { // Rolls files based on the current date, using a path @@ -38,7 +39,7 @@ class TemplatedPathRoller public TemplatedPathRoller(string pathTemplate) { - if (pathTemplate == null) throw new ArgumentNullException("pathTemplate"); + if (pathTemplate == null) throw new ArgumentNullException(nameof(pathTemplate)); if (pathTemplate.Contains(OldStyleDateSpecifier)) throw new ArgumentException("The old-style date specifier " + OldStyleDateSpecifier + " is no longer supported, instead please use " + DateSpecifier); @@ -46,10 +47,10 @@ public TemplatedPathRoller(string pathTemplate) var directory = Path.GetDirectoryName(pathTemplate); if (string.IsNullOrEmpty(directory)) { -#if ASPNETCORE50 - directory = Directory.GetCurrentDirectory(); -#else +#if !DNXCORE50 directory = Environment.CurrentDirectory; +#else + directory = Directory.GetCurrentDirectory(); #endif } @@ -126,3 +127,4 @@ public IEnumerable SelectMatches(IEnumerable filenames) } } } +#endif diff --git a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink.cs b/src/Serilog/Sinks/SystemConsole/ColoredConsoleSink.cs similarity index 93% rename from src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink.cs rename to src/Serilog/Sinks/SystemConsole/ColoredConsoleSink.cs index d81a428fc..e7bea15a8 100644 --- a/src/Serilog.FullNetFx/Sinks/SystemConsole/ColoredConsoleSink.cs +++ b/src/Serilog/Sinks/SystemConsole/ColoredConsoleSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -20,6 +20,13 @@ using Serilog.Formatting.Display; using Serilog.Parsing; +#if NET40 +using IPropertyDictionary = System.Collections.Generic.IDictionary; +#else +using IPropertyDictionary = System.Collections.Generic.IReadOnlyDictionary; +#endif + +#if !PROFILE259 namespace Serilog.Sinks.SystemConsole { class ColoredConsoleSink : ILogEventSink @@ -58,7 +65,7 @@ class Palette public ColoredConsoleSink(string outputTemplate, IFormatProvider formatProvider) { - if (outputTemplate == null) throw new ArgumentNullException("outputTemplate"); + if (outputTemplate == null) throw new ArgumentNullException(nameof(outputTemplate)); _outputTemplate = new MessageTemplateParser().Parse(outputTemplate); _formatProvider = formatProvider; } @@ -67,7 +74,7 @@ public ColoredConsoleSink(string outputTemplate, IFormatProvider formatProvider) public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); var outputProperties = OutputProperties.GetOutputProperties(logEvent); var palette = GetPalette(logEvent.Level); @@ -102,7 +109,7 @@ public void Emit(LogEvent logEvent) } } - void RenderExceptionToken(Palette palette, MessageTemplateToken outputToken, IReadOnlyDictionary outputProperties, TextWriter output) + void RenderExceptionToken(Palette palette, MessageTemplateToken outputToken, IPropertyDictionary outputProperties, TextWriter output) { var sw = new StringWriter(); outputToken.Render(outputProperties, sw, _formatProvider); @@ -136,7 +143,7 @@ void RenderMessageToken(LogEvent logEvent, Palette palette, TextWriter output) } } - void RenderOutputToken(Palette palette, MessageTemplateToken outputToken, IReadOnlyDictionary outputProperties, TextWriter output) + void RenderOutputToken(Palette palette, MessageTemplateToken outputToken, IPropertyDictionary outputProperties, TextWriter output) { SetBaseColors(palette); outputToken.Render(outputProperties, output, _formatProvider); @@ -168,3 +175,4 @@ static void SetColors(ConsoleColor background, ConsoleColor foreground) } } } +#endif diff --git a/src/Serilog.FullNetFx/Sinks/SystemConsole/ConsoleSink.cs b/src/Serilog/Sinks/SystemConsole/ConsoleSink.cs similarity index 91% rename from src/Serilog.FullNetFx/Sinks/SystemConsole/ConsoleSink.cs rename to src/Serilog/Sinks/SystemConsole/ConsoleSink.cs index 7b93b7f37..c3fff623f 100644 --- a/src/Serilog.FullNetFx/Sinks/SystemConsole/ConsoleSink.cs +++ b/src/Serilog/Sinks/SystemConsole/ConsoleSink.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ using Serilog.Events; using Serilog.Formatting; +#if !PROFILE259 namespace Serilog.Sinks.SystemConsole { class ConsoleSink : ILogEventSink @@ -26,16 +27,17 @@ class ConsoleSink : ILogEventSink public ConsoleSink(ITextFormatter textFormatter) { - if (textFormatter == null) throw new ArgumentNullException("textFormatter"); + if (textFormatter == null) throw new ArgumentNullException(nameof(textFormatter)); _textFormatter = textFormatter; } public void Emit(LogEvent logEvent) { - if (logEvent == null) throw new ArgumentNullException("logEvent"); + if (logEvent == null) throw new ArgumentNullException(nameof(logEvent)); var renderSpace = new StringWriter(); _textFormatter.Format(logEvent, renderSpace); Console.Out.Write(renderSpace.ToString()); } } } +#endif diff --git a/src/Serilog/project.json b/src/Serilog/project.json new file mode 100644 index 000000000..eacbeb020 --- /dev/null +++ b/src/Serilog/project.json @@ -0,0 +1,74 @@ +{ + "version": "2.0.0-beta-*", + "description": "Simple .NET logging with fully-structured events", + "authors": [ "Serilog Contributors" ], + "tags": [ "serilog", "logging", "semantic", "structured" ], + "projectUrl": "http://serilog.net", + "licenseUrl": "http://www.apache.org/licenses/LICENSE-2.0", + "iconUrl": "http://serilog.net/images/serilog-nuget.png", + "frameworks": { + "net40": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk" + }, + "frameworkAssemblies": { + "System.Configuration": "" + }, + "dependencies": { + "Microsoft.Bcl.Async": "1.0.168" + } + }, + "net45": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk" + }, + "frameworkAssemblies": { + "System.Configuration": "" + } + }, + "dnx451": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk" + }, + "frameworkAssemblies": { + "System.Configuration": "" + } + }, + ".NETPortable,Version=v4.5,Profile=Profile259": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk", + "define": [ "PROFILE259" ] + }, + "frameworkAssemblies": { + "Microsoft.CSharp": "", + "System.Collections": "", + "System.Diagnostics.Debug": "", + "System.Dynamic.Runtime": "", + "System.Globalization": "", + "System.IO": "", + "System.Linq": "", + "System.Reflection": "", + "System.Reflection.Extensions": "", + "System.Runtime": "", + "System.Runtime.Extensions": "", + "System.Text.RegularExpressions": "", + "System.Threading": "", + "System.Threading.Tasks": "" + } + }, + "dotnet": { + "compilationOptions": { + "define": [ "DNXCORE50" ] + }, + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.0", + "Microsoft.NETCore": "5.0.0", + "System.Collections.Concurrent": "4.0.11-beta-23225", + "System.Console": "4.0.0-beta-23225", + "System.Diagnostics.Process": "4.0.0-beta-23225", + "System.Diagnostics.TraceSource": "4.0.0-beta-23109", + "System.Threading.Thread": "4.0.0-beta-23225" + } + } + } +} diff --git a/src/Serilog/project.lock.json b/src/Serilog/project.lock.json new file mode 100644 index 000000000..1d1e18027 --- /dev/null +++ b/src/Serilog/project.lock.json @@ -0,0 +1,5045 @@ +{ + "locked": false, + "version": 2, + "targets": { + ".NETFramework,Version=v4.0": { + "Microsoft.Bcl/1.1.8": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.Build": "1.0.14" + }, + "compile": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + }, + "runtime": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + } + }, + "Microsoft.Bcl.Async/1.0.168": { + "type": "package", + "dependencies": { + "Microsoft.Bcl": "1.1.8" + }, + "frameworkAssemblies": [ + "System.Net" + ], + "compile": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + }, + "runtime": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + } + }, + "Microsoft.Bcl.Build/1.0.14": { + "type": "package" + } + }, + ".NETFramework,Version=v4.5": {}, + "DNX,Version=v4.5.1": {}, + ".NETPortable,Version=v4.5,Profile=Profile259": {}, + ".NETPlatform,Version=v5.0": { + "Microsoft.CSharp/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.CSharp.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.CSharp.dll": {} + } + }, + "Microsoft.NETCore/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.0.0", + "Microsoft.NETCore.Targets": "1.0.0", + "Microsoft.VisualBasic": "10.0.0", + "System.AppContext": "4.0.0", + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Collections.Immutable": "1.1.37", + "System.ComponentModel": "4.0.0", + "System.ComponentModel.Annotations": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tools": "4.0.0", + "System.Diagnostics.Tracing": "4.0.20", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Globalization.Calendars": "4.0.0", + "System.Globalization.Extensions": "4.0.0", + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.Compression.ZipFile": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.IO.UnmanagedMemoryStream": "4.0.0", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Linq.Parallel": "4.0.0", + "System.Linq.Queryable": "4.0.0", + "System.Net.Http": "4.0.0", + "System.Net.NetworkInformation": "4.0.0", + "System.Net.Primitives": "4.0.10", + "System.Numerics.Vectors": "4.1.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.DispatchProxy": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Metadata": "1.0.22", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.Handles": "4.0.0", + "System.Runtime.InteropServices": "4.0.20", + "System.Runtime.Numerics": "4.0.0", + "System.Security.Claims": "4.0.0", + "System.Security.Principal": "4.0.0", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10", + "System.Threading.Tasks.Dataflow": "4.5.25", + "System.Threading.Tasks.Parallel": "4.0.0", + "System.Threading.Timer": "4.0.0", + "System.Xml.ReaderWriter": "4.0.10", + "System.Xml.XDocument": "4.0.10" + } + }, + "Microsoft.NETCore.Platforms/1.0.0": { + "type": "package" + }, + "Microsoft.NETCore.Targets/1.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.0" + } + }, + "Microsoft.VisualBasic/10.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.VisualBasic.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.VisualBasic.dll": {} + } + }, + "System.AppContext/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.AppContext.dll": {} + } + }, + "System.Collections/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Collections.dll": {} + } + }, + "System.Collections.Concurrent/4.0.11-beta-23225": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Collections.Concurrent.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Concurrent.dll": {} + } + }, + "System.Collections.Immutable/1.1.37": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Collections.Immutable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Immutable.dll": {} + } + }, + "System.ComponentModel/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.ComponentModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.dll": {} + } + }, + "System.ComponentModel.Annotations/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.ComponentModel": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ComponentModel.Annotations.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.Annotations.dll": {} + } + }, + "System.Console/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Console.dll": {} + } + }, + "System.Diagnostics.Debug/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Debug.dll": {} + } + }, + "System.Diagnostics.Process/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Security.SecureString": "4.0.0-beta-23225", + "System.Text.Encoding": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Process.dll": {} + } + }, + "System.Diagnostics.Tools/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tools.dll": {} + } + }, + "System.Diagnostics.TraceSource/4.0.0-beta-23109": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0-beta-23109" + }, + "compile": { + "ref/dotnet/System.Diagnostics.TraceSource.dll": {} + } + }, + "System.Diagnostics.Tracing/4.0.20": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tracing.dll": {} + } + }, + "System.Dynamic.Runtime/4.0.10": { + "type": "package", + "dependencies": { + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Dynamic.Runtime.dll": {} + } + }, + "System.Globalization/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.dll": {} + } + }, + "System.Globalization.Calendars/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.Calendars.dll": {} + } + }, + "System.Globalization.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Globalization.Extensions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Globalization.Extensions.dll": {} + } + }, + "System.IO/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.dll": {} + } + }, + "System.IO.Compression/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.Compression.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.dll": {} + } + }, + "System.IO.Compression.ZipFile/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.Compression.ZipFile.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.ZipFile.dll": {} + } + }, + "System.IO.FileSystem/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.dll": {} + } + }, + "System.IO.FileSystem.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.Primitives.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.FileSystem.Primitives.dll": {} + } + }, + "System.IO.UnmanagedMemoryStream/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + } + }, + "System.Linq/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.dll": {} + } + }, + "System.Linq.Expressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Linq.Expressions.dll": {} + } + }, + "System.Linq.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Parallel.dll": {} + } + }, + "System.Linq.Queryable/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Linq.Queryable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Queryable.dll": {} + } + }, + "System.Net.Http/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Net.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Http.dll": {} + } + }, + "System.Net.NetworkInformation/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.NetworkInformation.dll": {} + } + }, + "System.Net.Primitives/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Primitives.dll": {} + } + }, + "System.Numerics.Vectors/4.1.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Numerics.Vectors.dll": {} + }, + "runtime": { + "lib/dotnet/System.Numerics.Vectors.dll": {} + } + }, + "System.ObjectModel/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ObjectModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ObjectModel.dll": {} + } + }, + "System.Reflection/4.0.10": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Reflection.dll": {} + } + }, + "System.Reflection.DispatchProxy/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.DispatchProxy.dll": {} + } + }, + "System.Reflection.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Extensions.dll": {} + } + }, + "System.Reflection.Metadata/1.0.22": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Immutable": "1.1.37", + "System.Diagnostics.Debug": "4.0.0", + "System.IO": "4.0.0", + "System.Reflection": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Text.Encoding.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + }, + "runtime": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + } + }, + "System.Reflection.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Primitives.dll": {} + } + }, + "System.Reflection.TypeExtensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.TypeExtensions.dll": {} + } + }, + "System.Resources.ResourceManager/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Resources.ResourceManager.dll": {} + } + }, + "System.Runtime/4.0.20": { + "type": "package", + "compile": { + "ref/dotnet/System.Runtime.dll": {} + } + }, + "System.Runtime.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Runtime.Extensions.dll": {} + } + }, + "System.Runtime.Handles/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.Handles.dll": {} + } + }, + "System.Runtime.InteropServices/4.0.20": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.InteropServices.dll": {} + } + }, + "System.Runtime.Numerics/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Runtime.Numerics.dll": {} + }, + "runtime": { + "lib/dotnet/System.Runtime.Numerics.dll": {} + } + }, + "System.Security.Claims/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.0", + "System.Security.Principal": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Claims.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Claims.dll": {} + } + }, + "System.Security.Principal/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Principal.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Principal.dll": {} + } + }, + "System.Security.SecureString/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.SecureString.dll": {} + } + }, + "System.Text.Encoding/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.dll": {} + } + }, + "System.Text.Encoding.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.Extensions.dll": {} + } + }, + "System.Text.RegularExpressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.RegularExpressions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Text.RegularExpressions.dll": {} + } + }, + "System.Threading/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.dll": {} + } + }, + "System.Threading.Tasks/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.dll": {} + } + }, + "System.Threading.Tasks.Dataflow/4.5.25": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Concurrent": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Diagnostics.Tracing": "4.0.0", + "System.Dynamic.Runtime": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + } + }, + "System.Threading.Tasks.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Parallel.dll": {} + } + }, + "System.Threading.Thread/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Thread.dll": {} + } + }, + "System.Threading.Timer/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Timer.dll": {} + } + }, + "System.Xml.ReaderWriter/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.ReaderWriter.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.ReaderWriter.dll": {} + } + }, + "System.Xml.XDocument/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.Reflection": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10", + "System.Threading": "4.0.10", + "System.Xml.ReaderWriter": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.XDocument.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.XDocument.dll": {} + } + } + }, + ".NETFramework,Version=v4.0/win7-x86": { + "Microsoft.Bcl/1.1.8": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.Build": "1.0.14" + }, + "compile": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + }, + "runtime": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + } + }, + "Microsoft.Bcl.Async/1.0.168": { + "type": "package", + "dependencies": { + "Microsoft.Bcl": "1.1.8" + }, + "frameworkAssemblies": [ + "System.Net" + ], + "compile": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + }, + "runtime": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + } + }, + "Microsoft.Bcl.Build/1.0.14": { + "type": "package" + } + }, + ".NETFramework,Version=v4.0/win7-x64": { + "Microsoft.Bcl/1.1.8": { + "type": "package", + "dependencies": { + "Microsoft.Bcl.Build": "1.0.14" + }, + "compile": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + }, + "runtime": { + "lib/net40/System.IO.dll": {}, + "lib/net40/System.Runtime.dll": {}, + "lib/net40/System.Threading.Tasks.dll": {} + } + }, + "Microsoft.Bcl.Async/1.0.168": { + "type": "package", + "dependencies": { + "Microsoft.Bcl": "1.1.8" + }, + "frameworkAssemblies": [ + "System.Net" + ], + "compile": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + }, + "runtime": { + "lib/net40/Microsoft.Threading.Tasks.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll": {}, + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll": {} + } + }, + "Microsoft.Bcl.Build/1.0.14": { + "type": "package" + } + }, + ".NETFramework,Version=v4.5/win7-x86": {}, + ".NETFramework,Version=v4.5/win7-x64": {}, + "DNX,Version=v4.5.1/win7-x86": {}, + "DNX,Version=v4.5.1/win7-x64": {}, + ".NETPortable,Version=v4.5,Profile=Profile259/win7-x86": {}, + ".NETPortable,Version=v4.5,Profile=Profile259/win7-x64": {}, + ".NETPlatform,Version=v5.0/win7-x86": { + "Microsoft.CSharp/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.CSharp.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.CSharp.dll": {} + } + }, + "Microsoft.NETCore/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.0.0", + "Microsoft.NETCore.Targets": "1.0.0", + "Microsoft.VisualBasic": "10.0.0", + "System.AppContext": "4.0.0", + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Collections.Immutable": "1.1.37", + "System.ComponentModel": "4.0.0", + "System.ComponentModel.Annotations": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tools": "4.0.0", + "System.Diagnostics.Tracing": "4.0.20", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Globalization.Calendars": "4.0.0", + "System.Globalization.Extensions": "4.0.0", + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.Compression.ZipFile": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.IO.UnmanagedMemoryStream": "4.0.0", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Linq.Parallel": "4.0.0", + "System.Linq.Queryable": "4.0.0", + "System.Net.Http": "4.0.0", + "System.Net.NetworkInformation": "4.0.0", + "System.Net.Primitives": "4.0.10", + "System.Numerics.Vectors": "4.1.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.DispatchProxy": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Metadata": "1.0.22", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.Handles": "4.0.0", + "System.Runtime.InteropServices": "4.0.20", + "System.Runtime.Numerics": "4.0.0", + "System.Security.Claims": "4.0.0", + "System.Security.Principal": "4.0.0", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10", + "System.Threading.Tasks.Dataflow": "4.5.25", + "System.Threading.Tasks.Parallel": "4.0.0", + "System.Threading.Timer": "4.0.0", + "System.Xml.ReaderWriter": "4.0.10", + "System.Xml.XDocument": "4.0.10" + } + }, + "Microsoft.NETCore.Platforms/1.0.0": { + "type": "package" + }, + "Microsoft.NETCore.Targets/1.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.0" + } + }, + "Microsoft.VisualBasic/10.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.VisualBasic.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.VisualBasic.dll": {} + } + }, + "System.AppContext/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.AppContext.dll": {} + } + }, + "System.Collections/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Collections.dll": {} + } + }, + "System.Collections.Concurrent/4.0.11-beta-23225": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Collections.Concurrent.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Concurrent.dll": {} + } + }, + "System.Collections.Immutable/1.1.37": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Collections.Immutable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Immutable.dll": {} + } + }, + "System.ComponentModel/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.ComponentModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.dll": {} + } + }, + "System.ComponentModel.Annotations/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.ComponentModel": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ComponentModel.Annotations.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.Annotations.dll": {} + } + }, + "System.Console/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Console.dll": {} + } + }, + "System.Diagnostics.Debug/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Debug.dll": {} + } + }, + "System.Diagnostics.Process/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Security.SecureString": "4.0.0-beta-23225", + "System.Text.Encoding": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Process.dll": {} + } + }, + "System.Diagnostics.Tools/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tools.dll": {} + } + }, + "System.Diagnostics.TraceSource/4.0.0-beta-23109": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0-beta-23109" + }, + "compile": { + "ref/dotnet/System.Diagnostics.TraceSource.dll": {} + } + }, + "System.Diagnostics.Tracing/4.0.20": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tracing.dll": {} + } + }, + "System.Dynamic.Runtime/4.0.10": { + "type": "package", + "dependencies": { + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Dynamic.Runtime.dll": {} + } + }, + "System.Globalization/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.dll": {} + } + }, + "System.Globalization.Calendars/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.Calendars.dll": {} + } + }, + "System.Globalization.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Globalization.Extensions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Globalization.Extensions.dll": {} + } + }, + "System.IO/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.dll": {} + } + }, + "System.IO.Compression/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.Compression.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.dll": {} + } + }, + "System.IO.Compression.clrcompression-x86/4.0.0": { + "type": "package", + "native": { + "runtimes/win7-x86/native/clrcompression.dll": {} + } + }, + "System.IO.Compression.ZipFile/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.Compression.ZipFile.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.ZipFile.dll": {} + } + }, + "System.IO.FileSystem/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.dll": {} + } + }, + "System.IO.FileSystem.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.Primitives.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.FileSystem.Primitives.dll": {} + } + }, + "System.IO.UnmanagedMemoryStream/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + } + }, + "System.Linq/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.dll": {} + } + }, + "System.Linq.Expressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Linq.Expressions.dll": {} + } + }, + "System.Linq.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Parallel.dll": {} + } + }, + "System.Linq.Queryable/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Linq.Queryable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Queryable.dll": {} + } + }, + "System.Net.Http/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Net.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Http.dll": {} + } + }, + "System.Net.NetworkInformation/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.NetworkInformation.dll": {} + } + }, + "System.Net.Primitives/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Primitives.dll": {} + } + }, + "System.Numerics.Vectors/4.1.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Numerics.Vectors.dll": {} + }, + "runtime": { + "lib/dotnet/System.Numerics.Vectors.dll": {} + } + }, + "System.ObjectModel/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ObjectModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ObjectModel.dll": {} + } + }, + "System.Reflection/4.0.10": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Reflection.dll": {} + } + }, + "System.Reflection.DispatchProxy/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.DispatchProxy.dll": {} + } + }, + "System.Reflection.Emit/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Reflection": "4.0.0", + "System.Reflection.Emit.ILGeneration": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.dll": {} + } + }, + "System.Reflection.Emit.ILGeneration/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {} + } + }, + "System.Reflection.Emit.Lightweight/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Emit.ILGeneration": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.Lightweight.dll": {} + } + }, + "System.Reflection.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Extensions.dll": {} + } + }, + "System.Reflection.Metadata/1.0.22": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Immutable": "1.1.37", + "System.Diagnostics.Debug": "4.0.0", + "System.IO": "4.0.0", + "System.Reflection": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Text.Encoding.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + }, + "runtime": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + } + }, + "System.Reflection.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Primitives.dll": {} + } + }, + "System.Reflection.TypeExtensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.TypeExtensions.dll": {} + } + }, + "System.Resources.ResourceManager/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Resources.ResourceManager.dll": {} + } + }, + "System.Runtime/4.0.20": { + "type": "package", + "compile": { + "ref/dotnet/System.Runtime.dll": {} + } + }, + "System.Runtime.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Runtime.Extensions.dll": {} + } + }, + "System.Runtime.Handles/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.Handles.dll": {} + } + }, + "System.Runtime.InteropServices/4.0.20": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.InteropServices.dll": {} + } + }, + "System.Runtime.Numerics/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Runtime.Numerics.dll": {} + }, + "runtime": { + "lib/dotnet/System.Runtime.Numerics.dll": {} + } + }, + "System.Security.Claims/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.0", + "System.Security.Principal": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Claims.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Claims.dll": {} + } + }, + "System.Security.Principal/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Principal.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Principal.dll": {} + } + }, + "System.Security.SecureString/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.SecureString.dll": {} + } + }, + "System.Text.Encoding/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.dll": {} + } + }, + "System.Text.Encoding.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.Extensions.dll": {} + } + }, + "System.Text.RegularExpressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.RegularExpressions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Text.RegularExpressions.dll": {} + } + }, + "System.Threading/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.dll": {} + } + }, + "System.Threading.Tasks/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.dll": {} + } + }, + "System.Threading.Tasks.Dataflow/4.5.25": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Concurrent": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Diagnostics.Tracing": "4.0.0", + "System.Dynamic.Runtime": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + } + }, + "System.Threading.Tasks.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Parallel.dll": {} + } + }, + "System.Threading.Thread/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Thread.dll": {} + } + }, + "System.Threading.Timer/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Timer.dll": {} + } + }, + "System.Xml.ReaderWriter/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.ReaderWriter.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.ReaderWriter.dll": {} + } + }, + "System.Xml.XDocument/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.Reflection": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10", + "System.Threading": "4.0.10", + "System.Xml.ReaderWriter": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.XDocument.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.XDocument.dll": {} + } + } + }, + ".NETPlatform,Version=v5.0/win7-x64": { + "Microsoft.CSharp/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.CSharp.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.CSharp.dll": {} + } + }, + "Microsoft.NETCore/5.0.0": { + "type": "package", + "dependencies": { + "Microsoft.CSharp": "4.0.0", + "Microsoft.NETCore.Targets": "1.0.0", + "Microsoft.VisualBasic": "10.0.0", + "System.AppContext": "4.0.0", + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Collections.Immutable": "1.1.37", + "System.ComponentModel": "4.0.0", + "System.ComponentModel.Annotations": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tools": "4.0.0", + "System.Diagnostics.Tracing": "4.0.20", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Globalization.Calendars": "4.0.0", + "System.Globalization.Extensions": "4.0.0", + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.Compression.ZipFile": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.IO.UnmanagedMemoryStream": "4.0.0", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Linq.Parallel": "4.0.0", + "System.Linq.Queryable": "4.0.0", + "System.Net.Http": "4.0.0", + "System.Net.NetworkInformation": "4.0.0", + "System.Net.Primitives": "4.0.10", + "System.Numerics.Vectors": "4.1.0", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.DispatchProxy": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Metadata": "1.0.22", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.Handles": "4.0.0", + "System.Runtime.InteropServices": "4.0.20", + "System.Runtime.Numerics": "4.0.0", + "System.Security.Claims": "4.0.0", + "System.Security.Principal": "4.0.0", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10", + "System.Threading.Tasks.Dataflow": "4.5.25", + "System.Threading.Tasks.Parallel": "4.0.0", + "System.Threading.Timer": "4.0.0", + "System.Xml.ReaderWriter": "4.0.10", + "System.Xml.XDocument": "4.0.10" + } + }, + "Microsoft.NETCore.Platforms/1.0.0": { + "type": "package" + }, + "Microsoft.NETCore.Targets/1.0.0": { + "type": "package", + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.0" + } + }, + "Microsoft.VisualBasic/10.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Dynamic.Runtime": "4.0.10", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Reflection.TypeExtensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/Microsoft.VisualBasic.dll": {} + }, + "runtime": { + "lib/dotnet/Microsoft.VisualBasic.dll": {} + } + }, + "System.AppContext/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.AppContext.dll": {} + } + }, + "System.Collections/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Collections.dll": {} + } + }, + "System.Collections.Concurrent/4.0.11-beta-23225": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Collections.Concurrent.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Concurrent.dll": {} + } + }, + "System.Collections.Immutable/1.1.37": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Collections.Immutable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Collections.Immutable.dll": {} + } + }, + "System.ComponentModel/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.ComponentModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.dll": {} + } + }, + "System.ComponentModel.Annotations/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.ComponentModel": "4.0.0", + "System.Globalization": "4.0.10", + "System.Linq": "4.0.0", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ComponentModel.Annotations.dll": {} + }, + "runtime": { + "lib/dotnet/System.ComponentModel.Annotations.dll": {} + } + }, + "System.Console/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Console.dll": {} + } + }, + "System.Diagnostics.Debug/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Debug.dll": {} + } + }, + "System.Diagnostics.Process/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Security.SecureString": "4.0.0-beta-23225", + "System.Text.Encoding": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Process.dll": {} + } + }, + "System.Diagnostics.Tools/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tools.dll": {} + } + }, + "System.Diagnostics.TraceSource/4.0.0-beta-23109": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0-beta-23109" + }, + "compile": { + "ref/dotnet/System.Diagnostics.TraceSource.dll": {} + } + }, + "System.Diagnostics.Tracing/4.0.20": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Diagnostics.Tracing.dll": {} + } + }, + "System.Dynamic.Runtime/4.0.10": { + "type": "package", + "dependencies": { + "System.Linq.Expressions": "4.0.10", + "System.ObjectModel": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Dynamic.Runtime.dll": {} + } + }, + "System.Globalization/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.dll": {} + } + }, + "System.Globalization.Calendars/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Globalization.Calendars.dll": {} + } + }, + "System.Globalization.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Globalization.Extensions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Globalization.Extensions.dll": {} + } + }, + "System.IO/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.dll": {} + } + }, + "System.IO.Compression/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.Compression.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.dll": {} + } + }, + "System.IO.Compression.clrcompression-x64/4.0.0": { + "type": "package", + "native": { + "runtimes/win7-x64/native/clrcompression.dll": {} + } + }, + "System.IO.Compression.ZipFile/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.Compression": "4.0.0", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.Compression.ZipFile.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.Compression.ZipFile.dll": {} + } + }, + "System.IO.FileSystem/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.dll": {} + } + }, + "System.IO.FileSystem.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.IO.FileSystem.Primitives.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.FileSystem.Primitives.dll": {} + } + }, + "System.IO.UnmanagedMemoryStream/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.10", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.InteropServices": "4.0.20", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + }, + "runtime": { + "lib/dotnet/System.IO.UnmanagedMemoryStream.dll": {} + } + }, + "System.Linq/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.dll": {} + } + }, + "System.Linq.Expressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Linq.Expressions.dll": {} + } + }, + "System.Linq.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Linq.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Parallel.dll": {} + } + }, + "System.Linq.Queryable/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Linq": "4.0.0", + "System.Linq.Expressions": "4.0.10", + "System.Reflection": "4.0.10", + "System.Reflection.Extensions": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Linq.Queryable.dll": {} + }, + "runtime": { + "lib/dotnet/System.Linq.Queryable.dll": {} + } + }, + "System.Net.Http/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Net.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Http.dll": {} + } + }, + "System.Net.NetworkInformation/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.NetworkInformation.dll": {} + } + }, + "System.Net.Primitives/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Net.Primitives.dll": {} + } + }, + "System.Numerics.Vectors/4.1.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Numerics.Vectors.dll": {} + }, + "runtime": { + "lib/dotnet/System.Numerics.Vectors.dll": {} + } + }, + "System.ObjectModel/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.ObjectModel.dll": {} + }, + "runtime": { + "lib/dotnet/System.ObjectModel.dll": {} + } + }, + "System.Reflection/4.0.10": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Reflection.dll": {} + } + }, + "System.Reflection.DispatchProxy/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.DispatchProxy.dll": {} + } + }, + "System.Reflection.Emit/4.0.0": { + "type": "package", + "dependencies": { + "System.IO": "4.0.0", + "System.Reflection": "4.0.0", + "System.Reflection.Emit.ILGeneration": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.dll": {} + } + }, + "System.Reflection.Emit.ILGeneration/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.ILGeneration.dll": {} + } + }, + "System.Reflection.Emit.Lightweight/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Emit.ILGeneration": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Emit.Lightweight.dll": {} + } + }, + "System.Reflection.Extensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Extensions.dll": {} + } + }, + "System.Reflection.Metadata/1.0.22": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Immutable": "1.1.37", + "System.Diagnostics.Debug": "4.0.0", + "System.IO": "4.0.0", + "System.Reflection": "4.0.0", + "System.Reflection.Extensions": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Runtime.InteropServices": "4.0.0", + "System.Text.Encoding": "4.0.0", + "System.Text.Encoding.Extensions": "4.0.0", + "System.Threading": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + }, + "runtime": { + "lib/dotnet/System.Reflection.Metadata.dll": {} + } + }, + "System.Reflection.Primitives/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.Primitives.dll": {} + } + }, + "System.Reflection.TypeExtensions/4.0.0": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Reflection.TypeExtensions.dll": {} + } + }, + "System.Resources.ResourceManager/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.0", + "System.Reflection": "4.0.0", + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Resources.ResourceManager.dll": {} + } + }, + "System.Runtime/4.0.20": { + "type": "package", + "compile": { + "ref/dotnet/System.Runtime.dll": {} + } + }, + "System.Runtime.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.20" + }, + "compile": { + "ref/dotnet/System.Runtime.Extensions.dll": {} + } + }, + "System.Runtime.Handles/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.Handles.dll": {} + } + }, + "System.Runtime.InteropServices/4.0.20": { + "type": "package", + "dependencies": { + "System.Reflection": "4.0.0", + "System.Reflection.Primitives": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Handles": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Runtime.InteropServices.dll": {} + } + }, + "System.Runtime.Numerics/4.0.0": { + "type": "package", + "dependencies": { + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Runtime.Numerics.dll": {} + }, + "runtime": { + "lib/dotnet/System.Runtime.Numerics.dll": {} + } + }, + "System.Security.Claims/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Globalization": "4.0.0", + "System.IO": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.0", + "System.Security.Principal": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Claims.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Claims.dll": {} + } + }, + "System.Security.Principal/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.Principal.dll": {} + }, + "runtime": { + "lib/dotnet/System.Security.Principal.dll": {} + } + }, + "System.Security.SecureString/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Security.SecureString.dll": {} + } + }, + "System.Text.Encoding/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.dll": {} + } + }, + "System.Text.Encoding.Extensions/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Text.Encoding": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.Encoding.Extensions.dll": {} + } + }, + "System.Text.RegularExpressions/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Globalization": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Text.RegularExpressions.dll": {} + }, + "runtime": { + "lib/dotnet/System.Text.RegularExpressions.dll": {} + } + }, + "System.Threading/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.dll": {} + } + }, + "System.Threading.Tasks/4.0.10": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.dll": {} + } + }, + "System.Threading.Tasks.Dataflow/4.5.25": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.0", + "System.Collections.Concurrent": "4.0.0", + "System.Diagnostics.Debug": "4.0.0", + "System.Diagnostics.Tracing": "4.0.0", + "System.Dynamic.Runtime": "4.0.0", + "System.Linq": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.0", + "System.Runtime.Extensions": "4.0.0", + "System.Threading": "4.0.0", + "System.Threading.Tasks": "4.0.0" + }, + "compile": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Dataflow.dll": {} + } + }, + "System.Threading.Tasks.Parallel/4.0.0": { + "type": "package", + "dependencies": { + "System.Collections.Concurrent": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Diagnostics.Tracing": "4.0.20", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Threading": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Threading.Tasks.Parallel.dll": {} + }, + "runtime": { + "lib/dotnet/System.Threading.Tasks.Parallel.dll": {} + } + }, + "System.Threading.Thread/4.0.0-beta-23225": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Thread.dll": {} + } + }, + "System.Threading.Timer/4.0.0": { + "type": "package", + "dependencies": { + "System.Runtime": "4.0.0" + }, + "compile": { + "ref/dotnet/System.Threading.Timer.dll": {} + } + }, + "System.Xml.ReaderWriter/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.IO.FileSystem": "4.0.0", + "System.IO.FileSystem.Primitives": "4.0.0", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Runtime.InteropServices": "4.0.20", + "System.Text.Encoding": "4.0.10", + "System.Text.Encoding.Extensions": "4.0.10", + "System.Text.RegularExpressions": "4.0.10", + "System.Threading.Tasks": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.ReaderWriter.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.ReaderWriter.dll": {} + } + }, + "System.Xml.XDocument/4.0.10": { + "type": "package", + "dependencies": { + "System.Collections": "4.0.10", + "System.Diagnostics.Debug": "4.0.10", + "System.Globalization": "4.0.10", + "System.IO": "4.0.10", + "System.Reflection": "4.0.10", + "System.Resources.ResourceManager": "4.0.0", + "System.Runtime": "4.0.20", + "System.Runtime.Extensions": "4.0.10", + "System.Text.Encoding": "4.0.10", + "System.Threading": "4.0.10", + "System.Xml.ReaderWriter": "4.0.10" + }, + "compile": { + "ref/dotnet/System.Xml.XDocument.dll": {} + }, + "runtime": { + "lib/dotnet/System.Xml.XDocument.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Bcl/1.1.8": { + "type": "package", + "sha512": "gM+PUzd8ONxJpcPJeNppCJPklDhDuPUMVQkxvK4fe0rd9WyqBNPh4+UFx3Uv8zuG4C1Gapu1c25sfotE7TQtig==", + "files": [ + "content/net45/_._", + "content/portable-net45+win8+wp8+wpa81/_._", + "content/portable-net45+win8+wpa81/_._", + "content/portable-net451+win81/_._", + "content/portable-net451+win81+wpa81/_._", + "content/portable-win81+wp81+wpa81/_._", + "content/sl4/_._", + "content/sl5/_._", + "content/win8/_._", + "content/wp8/_._", + "content/wpa81/_._", + "lib/net40/ensureRedirect.xml", + "lib/net40/System.IO.dll", + "lib/net40/System.IO.xml", + "lib/net40/System.Runtime.dll", + "lib/net40/System.Runtime.xml", + "lib/net40/System.Threading.Tasks.dll", + "lib/net40/System.Threading.Tasks.xml", + "lib/net45/_._", + "lib/portable-net40+sl4+win8/ensureRedirect.xml", + "lib/portable-net40+sl4+win8/System.IO.dll", + "lib/portable-net40+sl4+win8/System.IO.xml", + "lib/portable-net40+sl4+win8/System.Runtime.dll", + "lib/portable-net40+sl4+win8/System.Runtime.xml", + "lib/portable-net40+sl4+win8/System.Threading.Tasks.dll", + "lib/portable-net40+sl4+win8/System.Threading.Tasks.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/ensureRedirect.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.IO.dll", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.IO.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.Runtime.dll", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.Runtime.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.Threading.Tasks.dll", + "lib/portable-net40+sl4+win8+wp71+wpa81/System.Threading.Tasks.xml", + "lib/portable-net40+sl4+win8+wp8+wpa81/ensureRedirect.xml", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.IO.dll", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.IO.xml", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.Runtime.dll", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.Runtime.xml", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.Threading.Tasks.dll", + "lib/portable-net40+sl4+win8+wp8+wpa81/System.Threading.Tasks.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/ensureRedirect.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.IO.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.IO.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.Runtime.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.Runtime.xml", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.Threading.Tasks.dll", + "lib/portable-net40+sl5+win8+wp8+wpa81/System.Threading.Tasks.xml", + "lib/portable-net40+win8/ensureRedirect.xml", + "lib/portable-net40+win8/System.IO.dll", + "lib/portable-net40+win8/System.IO.xml", + "lib/portable-net40+win8/System.Runtime.dll", + "lib/portable-net40+win8/System.Runtime.xml", + "lib/portable-net40+win8/System.Threading.Tasks.dll", + "lib/portable-net40+win8/System.Threading.Tasks.xml", + "lib/portable-net40+win8+wp8+wpa81/ensureRedirect.xml", + "lib/portable-net40+win8+wp8+wpa81/System.IO.dll", + "lib/portable-net40+win8+wp8+wpa81/System.IO.xml", + "lib/portable-net40+win8+wp8+wpa81/System.Runtime.dll", + "lib/portable-net40+win8+wp8+wpa81/System.Runtime.xml", + "lib/portable-net40+win8+wp8+wpa81/System.Threading.Tasks.dll", + "lib/portable-net40+win8+wp8+wpa81/System.Threading.Tasks.xml", + "lib/portable-net45+win8+wp8+wpa81/_._", + "lib/portable-net45+win8+wpa81/_._", + "lib/portable-net451+win81/_._", + "lib/portable-net451+win81+wpa81/_._", + "lib/portable-win81+wp81+wpa81/_._", + "lib/sl4/System.IO.dll", + "lib/sl4/System.IO.xml", + "lib/sl4/System.Runtime.dll", + "lib/sl4/System.Runtime.xml", + "lib/sl4/System.Threading.Tasks.dll", + "lib/sl4/System.Threading.Tasks.xml", + "lib/sl4-windowsphone71/ensureRedirect.xml", + "lib/sl4-windowsphone71/System.IO.dll", + "lib/sl4-windowsphone71/System.IO.xml", + "lib/sl4-windowsphone71/System.Runtime.dll", + "lib/sl4-windowsphone71/System.Runtime.xml", + "lib/sl4-windowsphone71/System.Threading.Tasks.dll", + "lib/sl4-windowsphone71/System.Threading.Tasks.xml", + "lib/sl5/System.IO.dll", + "lib/sl5/System.IO.xml", + "lib/sl5/System.Runtime.dll", + "lib/sl5/System.Runtime.xml", + "lib/sl5/System.Threading.Tasks.dll", + "lib/sl5/System.Threading.Tasks.xml", + "lib/win8/_._", + "lib/wp8/_._", + "lib/wpa81/_._", + "License-Stable.rtf", + "Microsoft.Bcl.1.1.8.nupkg", + "Microsoft.Bcl.1.1.8.nupkg.sha512", + "Microsoft.Bcl.nuspec" + ] + }, + "Microsoft.Bcl.Async/1.0.168": { + "type": "package", + "sha512": "tUNC02eBwDKpGre0BcNIvblLv1q0Q3DnS/vtkRHj2FE1sXwt386HAudztyl5C0U88hllrqHDvtlz8bK0Y8cHDA==", + "files": [ + "lib/net40/Microsoft.Threading.Tasks.dll", + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.dll", + "lib/net40/Microsoft.Threading.Tasks.Extensions.Desktop.xml", + "lib/net40/Microsoft.Threading.Tasks.Extensions.dll", + "lib/net40/Microsoft.Threading.Tasks.Extensions.xml", + "lib/net40/Microsoft.Threading.Tasks.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/Microsoft.Threading.Tasks.dll", + "lib/portable-net40+sl4+win8+wp71+wpa81/Microsoft.Threading.Tasks.Extensions.dll", + "lib/portable-net40+sl4+win8+wp71+wpa81/Microsoft.Threading.Tasks.Extensions.xml", + "lib/portable-net40+sl4+win8+wp71+wpa81/Microsoft.Threading.Tasks.xml", + "lib/portable-net45+win8+wp8+wpa81/Microsoft.Threading.Tasks.dll", + "lib/portable-net45+win8+wp8+wpa81/Microsoft.Threading.Tasks.Extensions.dll", + "lib/portable-net45+win8+wp8+wpa81/Microsoft.Threading.Tasks.Extensions.xml", + "lib/portable-net45+win8+wp8+wpa81/Microsoft.Threading.Tasks.xml", + "lib/portable-net45+win8+wpa81/Microsoft.Threading.Tasks.dll", + "lib/portable-net45+win8+wpa81/Microsoft.Threading.Tasks.Extensions.dll", + "lib/portable-net45+win8+wpa81/Microsoft.Threading.Tasks.Extensions.xml", + "lib/portable-net45+win8+wpa81/Microsoft.Threading.Tasks.xml", + "lib/sl4/Microsoft.Threading.Tasks.dll", + "lib/sl4/Microsoft.Threading.Tasks.Extensions.dll", + "lib/sl4/Microsoft.Threading.Tasks.Extensions.Silverlight.dll", + "lib/sl4/Microsoft.Threading.Tasks.Extensions.Silverlight.xml", + "lib/sl4/Microsoft.Threading.Tasks.Extensions.xml", + "lib/sl4/Microsoft.Threading.Tasks.xml", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.dll", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.Extensions.dll", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.Extensions.Phone.dll", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.Extensions.Phone.xml", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.Extensions.xml", + "lib/sl4-windowsphone71/Microsoft.Threading.Tasks.xml", + "lib/win8/Microsoft.Threading.Tasks.dll", + "lib/win8/Microsoft.Threading.Tasks.Extensions.dll", + "lib/win8/Microsoft.Threading.Tasks.Extensions.xml", + "lib/win8/Microsoft.Threading.Tasks.xml", + "lib/wp8/Microsoft.Threading.Tasks.dll", + "lib/wp8/Microsoft.Threading.Tasks.Extensions.dll", + "lib/wp8/Microsoft.Threading.Tasks.Extensions.Phone.dll", + "lib/wp8/Microsoft.Threading.Tasks.Extensions.Phone.xml", + "lib/wp8/Microsoft.Threading.Tasks.Extensions.xml", + "lib/wp8/Microsoft.Threading.Tasks.xml", + "lib/wpa81/Microsoft.Threading.Tasks.dll", + "lib/wpa81/Microsoft.Threading.Tasks.Extensions.dll", + "lib/wpa81/Microsoft.Threading.Tasks.Extensions.xml", + "lib/wpa81/Microsoft.Threading.Tasks.xml", + "License-Stable.rtf", + "Microsoft.Bcl.Async.1.0.168.nupkg", + "Microsoft.Bcl.Async.1.0.168.nupkg.sha512", + "Microsoft.Bcl.Async.nuspec" + ] + }, + "Microsoft.Bcl.Build/1.0.14": { + "type": "package", + "sha512": "cDLKSvNvRa519hplsbSoYqO69TjdDIhfjtKUM0g20/nVROoWsGav9KCI9HtnGjLmdV1+TcUUDhbotcllibjPEA==", + "files": [ + "content/net40/_._", + "content/netcore45/_._", + "content/portable-net40+win8+sl4+wp71+wpa81/_._", + "content/sl4/_._", + "content/sl4-windowsphone71/_._", + "License-Stable.rtf", + "Microsoft.Bcl.Build.1.0.14.nupkg", + "Microsoft.Bcl.Build.1.0.14.nupkg.sha512", + "Microsoft.Bcl.Build.nuspec", + "tools/Install.ps1", + "tools/Microsoft.Bcl.Build.targets", + "tools/Microsoft.Bcl.Build.Tasks.dll", + "tools/Uninstall.ps1" + ] + }, + "Microsoft.CSharp/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "oWqeKUxHXdK6dL2CFjgMcaBISbkk+AqEg+yvJHE4DElNzS4QaTsCflgkkqZwVlWby1Dg9zo9n+iCAMFefFdJ/A==", + "files": [ + "lib/dotnet/Microsoft.CSharp.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/Microsoft.CSharp.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "Microsoft.CSharp.4.0.0.nupkg", + "Microsoft.CSharp.4.0.0.nupkg.sha512", + "Microsoft.CSharp.nuspec", + "ref/dotnet/de/Microsoft.CSharp.xml", + "ref/dotnet/es/Microsoft.CSharp.xml", + "ref/dotnet/fr/Microsoft.CSharp.xml", + "ref/dotnet/it/Microsoft.CSharp.xml", + "ref/dotnet/ja/Microsoft.CSharp.xml", + "ref/dotnet/ko/Microsoft.CSharp.xml", + "ref/dotnet/Microsoft.CSharp.dll", + "ref/dotnet/Microsoft.CSharp.xml", + "ref/dotnet/ru/Microsoft.CSharp.xml", + "ref/dotnet/zh-hans/Microsoft.CSharp.xml", + "ref/dotnet/zh-hant/Microsoft.CSharp.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcore50/Microsoft.CSharp.dll", + "ref/netcore50/Microsoft.CSharp.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._" + ] + }, + "Microsoft.NETCore/5.0.0": { + "type": "package", + "sha512": "QQMp0yYQbIdfkKhdEE6Umh2Xonau7tasG36Trw/YlHoWgYQLp7T9L+ZD8EPvdj5ubRhtOuKEKwM7HMpkagB9ZA==", + "files": [ + "_._", + "Microsoft.NETCore.5.0.0.nupkg", + "Microsoft.NETCore.5.0.0.nupkg.sha512", + "Microsoft.NETCore.nuspec" + ] + }, + "Microsoft.NETCore.Platforms/1.0.0": { + "type": "package", + "sha512": "0N77OwGZpXqUco2C/ynv1os7HqdFYifvNIbveLDKqL5PZaz05Rl9enCwVBjF61aumHKueLWIJ3prnmdAXxww4A==", + "files": [ + "Microsoft.NETCore.Platforms.1.0.0.nupkg", + "Microsoft.NETCore.Platforms.1.0.0.nupkg.sha512", + "Microsoft.NETCore.Platforms.nuspec", + "runtime.json" + ] + }, + "Microsoft.NETCore.Targets/1.0.0": { + "type": "package", + "sha512": "XfITpPjYLYRmAeZtb9diw6P7ylLQsSC1U2a/xj10iQpnHxkiLEBXop/psw15qMPuNca7lqgxWvzZGpQxphuXaw==", + "files": [ + "Microsoft.NETCore.Targets.1.0.0.nupkg", + "Microsoft.NETCore.Targets.1.0.0.nupkg.sha512", + "Microsoft.NETCore.Targets.nuspec", + "runtime.json" + ] + }, + "Microsoft.VisualBasic/10.0.0": { + "type": "package", + "serviceable": true, + "sha512": "5BEm2/HAVd97whRlCChU7rmSh/9cwGlZ/NTNe3Jl07zuPWfKQq5TUvVNUmdvmEe8QRecJLZ4/e7WF1i1O8V42g==", + "files": [ + "lib/dotnet/Microsoft.VisualBasic.dll", + "lib/net45/_._", + "lib/netcore50/Microsoft.VisualBasic.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "Microsoft.VisualBasic.10.0.0.nupkg", + "Microsoft.VisualBasic.10.0.0.nupkg.sha512", + "Microsoft.VisualBasic.nuspec", + "ref/dotnet/de/Microsoft.VisualBasic.xml", + "ref/dotnet/es/Microsoft.VisualBasic.xml", + "ref/dotnet/fr/Microsoft.VisualBasic.xml", + "ref/dotnet/it/Microsoft.VisualBasic.xml", + "ref/dotnet/ja/Microsoft.VisualBasic.xml", + "ref/dotnet/ko/Microsoft.VisualBasic.xml", + "ref/dotnet/Microsoft.VisualBasic.dll", + "ref/dotnet/Microsoft.VisualBasic.xml", + "ref/dotnet/ru/Microsoft.VisualBasic.xml", + "ref/dotnet/zh-hans/Microsoft.VisualBasic.xml", + "ref/dotnet/zh-hant/Microsoft.VisualBasic.xml", + "ref/net45/_._", + "ref/netcore50/Microsoft.VisualBasic.dll", + "ref/netcore50/Microsoft.VisualBasic.xml", + "ref/win8/_._", + "ref/wpa81/_._" + ] + }, + "System.AppContext/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "gUoYgAWDC3+xhKeU5KSLbYDhTdBYk9GssrMSCcWUADzOglW+s0AmwVhOUGt2tL5xUl7ZXoYTPdA88zCgKrlG0A==", + "files": [ + "lib/DNXCore50/System.AppContext.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.AppContext.dll", + "lib/netcore50/System.AppContext.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.AppContext.xml", + "ref/dotnet/es/System.AppContext.xml", + "ref/dotnet/fr/System.AppContext.xml", + "ref/dotnet/it/System.AppContext.xml", + "ref/dotnet/ja/System.AppContext.xml", + "ref/dotnet/ko/System.AppContext.xml", + "ref/dotnet/ru/System.AppContext.xml", + "ref/dotnet/System.AppContext.dll", + "ref/dotnet/System.AppContext.xml", + "ref/dotnet/zh-hans/System.AppContext.xml", + "ref/dotnet/zh-hant/System.AppContext.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.AppContext.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.AppContext.4.0.0.nupkg", + "System.AppContext.4.0.0.nupkg.sha512", + "System.AppContext.nuspec" + ] + }, + "System.Collections/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "ux6ilcZZjV/Gp7JEZpe+2V1eTueq6NuoGRM3eZCFuPM25hLVVgCRuea6STW8hvqreIOE59irJk5/ovpA5xQipw==", + "files": [ + "lib/DNXCore50/System.Collections.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Collections.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Collections.xml", + "ref/dotnet/es/System.Collections.xml", + "ref/dotnet/fr/System.Collections.xml", + "ref/dotnet/it/System.Collections.xml", + "ref/dotnet/ja/System.Collections.xml", + "ref/dotnet/ko/System.Collections.xml", + "ref/dotnet/ru/System.Collections.xml", + "ref/dotnet/System.Collections.dll", + "ref/dotnet/System.Collections.xml", + "ref/dotnet/zh-hans/System.Collections.xml", + "ref/dotnet/zh-hant/System.Collections.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Collections.dll", + "System.Collections.4.0.10.nupkg", + "System.Collections.4.0.10.nupkg.sha512", + "System.Collections.nuspec" + ] + }, + "System.Collections.Concurrent/4.0.11-beta-23225": { + "type": "package", + "serviceable": true, + "sha512": "v20w+6uz/rj9kmbly4FDgltPLUtvUhEVxElnpJIcmZ2UEKKM2jNSPGonCdDqdOCWhXiswUPKv0Dxqqe9wwg0Qg==", + "files": [ + "lib/dotnet/System.Collections.Concurrent.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Collections.Concurrent.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Collections.Concurrent.4.0.11-beta-23225.nupkg", + "System.Collections.Concurrent.4.0.11-beta-23225.nupkg.sha512", + "System.Collections.Concurrent.nuspec" + ] + }, + "System.Collections.Immutable/1.1.37": { + "type": "package", + "serviceable": true, + "sha512": "fTpqwZYBzoklTT+XjTRK8KxvmrGkYHzBiylCcKyQcxiOM8k+QvhNBxRvFHDWzy4OEP5f8/9n+xQ9mEgEXY+muA==", + "files": [ + "lib/dotnet/System.Collections.Immutable.dll", + "lib/dotnet/System.Collections.Immutable.xml", + "lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.dll", + "lib/portable-net45+win8+wp8+wpa81/System.Collections.Immutable.xml", + "System.Collections.Immutable.1.1.37.nupkg", + "System.Collections.Immutable.1.1.37.nupkg.sha512", + "System.Collections.Immutable.nuspec" + ] + }, + "System.ComponentModel/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "BzpLdSi++ld7rJLOOt5f/G9GxujP202bBgKORsHcGV36rLB0mfSA2h8chTMoBzFhgN7TE14TmJ2J7Q1RyNCTAw==", + "files": [ + "lib/dotnet/System.ComponentModel.dll", + "lib/net45/_._", + "lib/netcore50/System.ComponentModel.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.ComponentModel.xml", + "ref/dotnet/es/System.ComponentModel.xml", + "ref/dotnet/fr/System.ComponentModel.xml", + "ref/dotnet/it/System.ComponentModel.xml", + "ref/dotnet/ja/System.ComponentModel.xml", + "ref/dotnet/ko/System.ComponentModel.xml", + "ref/dotnet/ru/System.ComponentModel.xml", + "ref/dotnet/System.ComponentModel.dll", + "ref/dotnet/System.ComponentModel.xml", + "ref/dotnet/zh-hans/System.ComponentModel.xml", + "ref/dotnet/zh-hant/System.ComponentModel.xml", + "ref/net45/_._", + "ref/netcore50/System.ComponentModel.dll", + "ref/netcore50/System.ComponentModel.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "System.ComponentModel.4.0.0.nupkg", + "System.ComponentModel.4.0.0.nupkg.sha512", + "System.ComponentModel.nuspec" + ] + }, + "System.ComponentModel.Annotations/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "7+XGyEZx24nP1kpHxCB9e+c6D0fdVDvFwE1xujE9BzlXyNVcy5J5aIO0H/ECupx21QpyRvzZibGAHfL/XLL6dw==", + "files": [ + "lib/dotnet/System.ComponentModel.Annotations.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.ComponentModel.Annotations.xml", + "ref/dotnet/es/System.ComponentModel.Annotations.xml", + "ref/dotnet/fr/System.ComponentModel.Annotations.xml", + "ref/dotnet/it/System.ComponentModel.Annotations.xml", + "ref/dotnet/ja/System.ComponentModel.Annotations.xml", + "ref/dotnet/ko/System.ComponentModel.Annotations.xml", + "ref/dotnet/ru/System.ComponentModel.Annotations.xml", + "ref/dotnet/System.ComponentModel.Annotations.dll", + "ref/dotnet/System.ComponentModel.Annotations.xml", + "ref/dotnet/zh-hans/System.ComponentModel.Annotations.xml", + "ref/dotnet/zh-hant/System.ComponentModel.Annotations.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.ComponentModel.Annotations.4.0.10.nupkg", + "System.ComponentModel.Annotations.4.0.10.nupkg.sha512", + "System.ComponentModel.Annotations.nuspec" + ] + }, + "System.Console/4.0.0-beta-23225": { + "type": "package", + "serviceable": true, + "sha512": "zjjI63CYWqCUAzSCei5oz/A7FASxw4T3noBOMc+N5HaXYX6HoDp8E9Mhk7xLFoV4eflQnezkvmLaIReTR70Ydg==", + "files": [ + "lib/DNXCore50/System.Console.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Console.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Console.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Console.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Console.4.0.0-beta-23225.nupkg", + "System.Console.4.0.0-beta-23225.nupkg.sha512", + "System.Console.nuspec" + ] + }, + "System.Diagnostics.Debug/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "pi2KthuvI2LWV2c2V+fwReDsDiKpNl040h6DcwFOb59SafsPT/V1fCy0z66OKwysurJkBMmp5j5CBe3Um+ub0g==", + "files": [ + "lib/DNXCore50/System.Diagnostics.Debug.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Diagnostics.Debug.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Diagnostics.Debug.xml", + "ref/dotnet/es/System.Diagnostics.Debug.xml", + "ref/dotnet/fr/System.Diagnostics.Debug.xml", + "ref/dotnet/it/System.Diagnostics.Debug.xml", + "ref/dotnet/ja/System.Diagnostics.Debug.xml", + "ref/dotnet/ko/System.Diagnostics.Debug.xml", + "ref/dotnet/ru/System.Diagnostics.Debug.xml", + "ref/dotnet/System.Diagnostics.Debug.dll", + "ref/dotnet/System.Diagnostics.Debug.xml", + "ref/dotnet/zh-hans/System.Diagnostics.Debug.xml", + "ref/dotnet/zh-hant/System.Diagnostics.Debug.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Diagnostics.Debug.dll", + "System.Diagnostics.Debug.4.0.10.nupkg", + "System.Diagnostics.Debug.4.0.10.nupkg.sha512", + "System.Diagnostics.Debug.nuspec" + ] + }, + "System.Diagnostics.Process/4.0.0-beta-23225": { + "type": "package", + "serviceable": true, + "sha512": "yBIP0ts5Msh3QoiaseqPrc6Sh4e3t3iR9Spd7aVrfJZqUtq0cX96txwL+K/1R594IgN53I2hKpmLhHdWVRk1qA==", + "files": [ + "lib/DNXCore50/System.Diagnostics.Process.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Diagnostics.Process.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Diagnostics.Process.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Diagnostics.Process.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Diagnostics.Process.4.0.0-beta-23225.nupkg", + "System.Diagnostics.Process.4.0.0-beta-23225.nupkg.sha512", + "System.Diagnostics.Process.nuspec" + ] + }, + "System.Diagnostics.Tools/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "uw5Qi2u5Cgtv4xv3+8DeB63iaprPcaEHfpeJqlJiLjIVy6v0La4ahJ6VW9oPbJNIjcavd24LKq0ctT9ssuQXsw==", + "files": [ + "lib/DNXCore50/System.Diagnostics.Tools.dll", + "lib/net45/_._", + "lib/netcore50/System.Diagnostics.Tools.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Diagnostics.Tools.xml", + "ref/dotnet/es/System.Diagnostics.Tools.xml", + "ref/dotnet/fr/System.Diagnostics.Tools.xml", + "ref/dotnet/it/System.Diagnostics.Tools.xml", + "ref/dotnet/ja/System.Diagnostics.Tools.xml", + "ref/dotnet/ko/System.Diagnostics.Tools.xml", + "ref/dotnet/ru/System.Diagnostics.Tools.xml", + "ref/dotnet/System.Diagnostics.Tools.dll", + "ref/dotnet/System.Diagnostics.Tools.xml", + "ref/dotnet/zh-hans/System.Diagnostics.Tools.xml", + "ref/dotnet/zh-hant/System.Diagnostics.Tools.xml", + "ref/net45/_._", + "ref/netcore50/System.Diagnostics.Tools.dll", + "ref/netcore50/System.Diagnostics.Tools.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Diagnostics.Tools.dll", + "System.Diagnostics.Tools.4.0.0.nupkg", + "System.Diagnostics.Tools.4.0.0.nupkg.sha512", + "System.Diagnostics.Tools.nuspec" + ] + }, + "System.Diagnostics.TraceSource/4.0.0-beta-23109": { + "type": "package", + "serviceable": true, + "sha512": "UFzG2y1IMRlZ/13WWhkIJUJ0RpcK5XrNoSpZUfy7JxJhlliKeAvP06yXHXk6XECxizvIucE0EfE0MovKo07QiA==", + "files": [ + "lib/DNXCore50/System.Diagnostics.TraceSource.dll", + "lib/net46/System.Diagnostics.TraceSource.dll", + "ref/dotnet/de/System.Diagnostics.TraceSource.xml", + "ref/dotnet/es/System.Diagnostics.TraceSource.xml", + "ref/dotnet/fr/System.Diagnostics.TraceSource.xml", + "ref/dotnet/it/System.Diagnostics.TraceSource.xml", + "ref/dotnet/ja/System.Diagnostics.TraceSource.xml", + "ref/dotnet/ko/System.Diagnostics.TraceSource.xml", + "ref/dotnet/ru/System.Diagnostics.TraceSource.xml", + "ref/dotnet/System.Diagnostics.TraceSource.dll", + "ref/dotnet/System.Diagnostics.TraceSource.xml", + "ref/dotnet/zh-hans/System.Diagnostics.TraceSource.xml", + "ref/dotnet/zh-hant/System.Diagnostics.TraceSource.xml", + "ref/net46/System.Diagnostics.TraceSource.dll", + "System.Diagnostics.TraceSource.4.0.0-beta-23109.nupkg", + "System.Diagnostics.TraceSource.4.0.0-beta-23109.nupkg.sha512", + "System.Diagnostics.TraceSource.nuspec" + ] + }, + "System.Diagnostics.Tracing/4.0.20": { + "type": "package", + "serviceable": true, + "sha512": "gn/wexGHc35Fv++5L1gYHMY5g25COfiZ0PGrL+3PfwzoJd4X2LbTAm/U8d385SI6BKQBI/z4dQfvneS9J27+Tw==", + "files": [ + "lib/DNXCore50/System.Diagnostics.Tracing.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Diagnostics.Tracing.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Diagnostics.Tracing.xml", + "ref/dotnet/es/System.Diagnostics.Tracing.xml", + "ref/dotnet/fr/System.Diagnostics.Tracing.xml", + "ref/dotnet/it/System.Diagnostics.Tracing.xml", + "ref/dotnet/ja/System.Diagnostics.Tracing.xml", + "ref/dotnet/ko/System.Diagnostics.Tracing.xml", + "ref/dotnet/ru/System.Diagnostics.Tracing.xml", + "ref/dotnet/System.Diagnostics.Tracing.dll", + "ref/dotnet/System.Diagnostics.Tracing.xml", + "ref/dotnet/zh-hans/System.Diagnostics.Tracing.xml", + "ref/dotnet/zh-hant/System.Diagnostics.Tracing.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Diagnostics.Tracing.dll", + "System.Diagnostics.Tracing.4.0.20.nupkg", + "System.Diagnostics.Tracing.4.0.20.nupkg.sha512", + "System.Diagnostics.Tracing.nuspec" + ] + }, + "System.Dynamic.Runtime/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "r10VTLdlxtYp46BuxomHnwx7vIoMOr04CFoC/jJJfY22f7HQQ4P+cXY2Nxo6/rIxNNqOxwdbQQwv7Gl88Jsu1w==", + "files": [ + "lib/DNXCore50/System.Dynamic.Runtime.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Dynamic.Runtime.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Dynamic.Runtime.xml", + "ref/dotnet/es/System.Dynamic.Runtime.xml", + "ref/dotnet/fr/System.Dynamic.Runtime.xml", + "ref/dotnet/it/System.Dynamic.Runtime.xml", + "ref/dotnet/ja/System.Dynamic.Runtime.xml", + "ref/dotnet/ko/System.Dynamic.Runtime.xml", + "ref/dotnet/ru/System.Dynamic.Runtime.xml", + "ref/dotnet/System.Dynamic.Runtime.dll", + "ref/dotnet/System.Dynamic.Runtime.xml", + "ref/dotnet/zh-hans/System.Dynamic.Runtime.xml", + "ref/dotnet/zh-hant/System.Dynamic.Runtime.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtime.json", + "runtimes/win8-aot/lib/netcore50/System.Dynamic.Runtime.dll", + "System.Dynamic.Runtime.4.0.10.nupkg", + "System.Dynamic.Runtime.4.0.10.nupkg.sha512", + "System.Dynamic.Runtime.nuspec" + ] + }, + "System.Globalization/4.0.10": { + "type": "package", + "sha512": "kzRtbbCNAxdafFBDogcM36ehA3th8c1PGiz8QRkZn8O5yMBorDHSK8/TGJPYOaCS5zdsGk0u9qXHnW91nqy7fw==", + "files": [ + "lib/DNXCore50/System.Globalization.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Globalization.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Globalization.xml", + "ref/dotnet/es/System.Globalization.xml", + "ref/dotnet/fr/System.Globalization.xml", + "ref/dotnet/it/System.Globalization.xml", + "ref/dotnet/ja/System.Globalization.xml", + "ref/dotnet/ko/System.Globalization.xml", + "ref/dotnet/ru/System.Globalization.xml", + "ref/dotnet/System.Globalization.dll", + "ref/dotnet/System.Globalization.xml", + "ref/dotnet/zh-hans/System.Globalization.xml", + "ref/dotnet/zh-hant/System.Globalization.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Globalization.dll", + "System.Globalization.4.0.10.nupkg", + "System.Globalization.4.0.10.nupkg.sha512", + "System.Globalization.nuspec" + ] + }, + "System.Globalization.Calendars/4.0.0": { + "type": "package", + "sha512": "cL6WrdGKnNBx9W/iTr+jbffsEO4RLjEtOYcpVSzPNDoli6X5Q6bAfWtJYbJNOPi8Q0fXgBEvKK1ncFL/3FTqlA==", + "files": [ + "lib/DNXCore50/System.Globalization.Calendars.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Globalization.Calendars.dll", + "lib/netcore50/System.Globalization.Calendars.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Globalization.Calendars.xml", + "ref/dotnet/es/System.Globalization.Calendars.xml", + "ref/dotnet/fr/System.Globalization.Calendars.xml", + "ref/dotnet/it/System.Globalization.Calendars.xml", + "ref/dotnet/ja/System.Globalization.Calendars.xml", + "ref/dotnet/ko/System.Globalization.Calendars.xml", + "ref/dotnet/ru/System.Globalization.Calendars.xml", + "ref/dotnet/System.Globalization.Calendars.dll", + "ref/dotnet/System.Globalization.Calendars.xml", + "ref/dotnet/zh-hans/System.Globalization.Calendars.xml", + "ref/dotnet/zh-hant/System.Globalization.Calendars.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Globalization.Calendars.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Globalization.Calendars.dll", + "System.Globalization.Calendars.4.0.0.nupkg", + "System.Globalization.Calendars.4.0.0.nupkg.sha512", + "System.Globalization.Calendars.nuspec" + ] + }, + "System.Globalization.Extensions/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "rqbUXiwpBCvJ18ySCsjh20zleazO+6fr3s5GihC2sVwhyS0MUl6+oc5Rzk0z6CKkS4kmxbZQSeZLsK7cFSO0ng==", + "files": [ + "lib/dotnet/System.Globalization.Extensions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Globalization.Extensions.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Globalization.Extensions.xml", + "ref/dotnet/es/System.Globalization.Extensions.xml", + "ref/dotnet/fr/System.Globalization.Extensions.xml", + "ref/dotnet/it/System.Globalization.Extensions.xml", + "ref/dotnet/ja/System.Globalization.Extensions.xml", + "ref/dotnet/ko/System.Globalization.Extensions.xml", + "ref/dotnet/ru/System.Globalization.Extensions.xml", + "ref/dotnet/System.Globalization.Extensions.dll", + "ref/dotnet/System.Globalization.Extensions.xml", + "ref/dotnet/zh-hans/System.Globalization.Extensions.xml", + "ref/dotnet/zh-hant/System.Globalization.Extensions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Globalization.Extensions.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Globalization.Extensions.4.0.0.nupkg", + "System.Globalization.Extensions.4.0.0.nupkg.sha512", + "System.Globalization.Extensions.nuspec" + ] + }, + "System.IO/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "kghf1CeYT+W2lw8a50/GxFz5HR9t6RkL4BvjxtTp1NxtEFWywnMA9W8FH/KYXiDNThcw9u/GOViDON4iJFGXIQ==", + "files": [ + "lib/DNXCore50/System.IO.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.IO.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.xml", + "ref/dotnet/es/System.IO.xml", + "ref/dotnet/fr/System.IO.xml", + "ref/dotnet/it/System.IO.xml", + "ref/dotnet/ja/System.IO.xml", + "ref/dotnet/ko/System.IO.xml", + "ref/dotnet/ru/System.IO.xml", + "ref/dotnet/System.IO.dll", + "ref/dotnet/System.IO.xml", + "ref/dotnet/zh-hans/System.IO.xml", + "ref/dotnet/zh-hant/System.IO.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.IO.dll", + "System.IO.4.0.10.nupkg", + "System.IO.4.0.10.nupkg.sha512", + "System.IO.nuspec" + ] + }, + "System.IO.Compression/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "S+ljBE3py8pujTrsOOYHtDg2cnAifn6kBu/pfh1hMWIXd8DoVh0ADTA6Puv4q+nYj+Msm6JoFLNwuRSmztbsDQ==", + "files": [ + "lib/dotnet/System.IO.Compression.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/System.IO.Compression.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.Compression.xml", + "ref/dotnet/es/System.IO.Compression.xml", + "ref/dotnet/fr/System.IO.Compression.xml", + "ref/dotnet/it/System.IO.Compression.xml", + "ref/dotnet/ja/System.IO.Compression.xml", + "ref/dotnet/ko/System.IO.Compression.xml", + "ref/dotnet/ru/System.IO.Compression.xml", + "ref/dotnet/System.IO.Compression.dll", + "ref/dotnet/System.IO.Compression.xml", + "ref/dotnet/zh-hans/System.IO.Compression.xml", + "ref/dotnet/zh-hant/System.IO.Compression.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcore50/System.IO.Compression.dll", + "ref/netcore50/System.IO.Compression.xml", + "ref/win8/_._", + "ref/wpa81/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtime.json", + "System.IO.Compression.4.0.0.nupkg", + "System.IO.Compression.4.0.0.nupkg.sha512", + "System.IO.Compression.nuspec" + ] + }, + "System.IO.Compression.clrcompression-x64/4.0.0": { + "type": "package", + "sha512": "Lqr+URMwKzf+8HJF6YrqEqzKzDzFJTE4OekaxqdIns71r8Ufbd8SbZa0LKl9q+7nu6Em4SkIEXVMB7plSXekOw==", + "files": [ + "runtimes/win10-x64/native/ClrCompression.dll", + "runtimes/win7-x64/native/clrcompression.dll", + "System.IO.Compression.clrcompression-x64.4.0.0.nupkg", + "System.IO.Compression.clrcompression-x64.4.0.0.nupkg.sha512", + "System.IO.Compression.clrcompression-x64.nuspec" + ] + }, + "System.IO.Compression.clrcompression-x86/4.0.0": { + "type": "package", + "sha512": "GmevpuaMRzYDXHu+xuV10fxTO8DsP7OKweWxYtkaxwVnDSj9X6RBupSiXdiveq9yj/xjZ1NbG+oRRRb99kj+VQ==", + "files": [ + "runtimes/win10-x86/native/ClrCompression.dll", + "runtimes/win7-x86/native/clrcompression.dll", + "System.IO.Compression.clrcompression-x86.4.0.0.nupkg", + "System.IO.Compression.clrcompression-x86.4.0.0.nupkg.sha512", + "System.IO.Compression.clrcompression-x86.nuspec" + ] + }, + "System.IO.Compression.ZipFile/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "pwntmtsJqtt6Lez4Iyv4GVGW6DaXUTo9Rnlsx0MFagRgX+8F/sxG5S/IzDJabBj68sUWViz1QJrRZL4V9ngWDg==", + "files": [ + "lib/dotnet/System.IO.Compression.ZipFile.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.IO.Compression.ZipFile.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.Compression.ZipFile.xml", + "ref/dotnet/es/System.IO.Compression.ZipFile.xml", + "ref/dotnet/fr/System.IO.Compression.ZipFile.xml", + "ref/dotnet/it/System.IO.Compression.ZipFile.xml", + "ref/dotnet/ja/System.IO.Compression.ZipFile.xml", + "ref/dotnet/ko/System.IO.Compression.ZipFile.xml", + "ref/dotnet/ru/System.IO.Compression.ZipFile.xml", + "ref/dotnet/System.IO.Compression.ZipFile.dll", + "ref/dotnet/System.IO.Compression.ZipFile.xml", + "ref/dotnet/zh-hans/System.IO.Compression.ZipFile.xml", + "ref/dotnet/zh-hant/System.IO.Compression.ZipFile.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.IO.Compression.ZipFile.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.IO.Compression.ZipFile.4.0.0.nupkg", + "System.IO.Compression.ZipFile.4.0.0.nupkg.sha512", + "System.IO.Compression.ZipFile.nuspec" + ] + }, + "System.IO.FileSystem/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "eo05SPWfG+54UA0wxgRIYOuOslq+2QrJLXZaJDDsfLXG15OLguaItW39NYZTqUb4DeGOkU4R0wpOLOW4ynMUDQ==", + "files": [ + "lib/DNXCore50/System.IO.FileSystem.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.IO.FileSystem.dll", + "lib/netcore50/System.IO.FileSystem.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.FileSystem.xml", + "ref/dotnet/es/System.IO.FileSystem.xml", + "ref/dotnet/fr/System.IO.FileSystem.xml", + "ref/dotnet/it/System.IO.FileSystem.xml", + "ref/dotnet/ja/System.IO.FileSystem.xml", + "ref/dotnet/ko/System.IO.FileSystem.xml", + "ref/dotnet/ru/System.IO.FileSystem.xml", + "ref/dotnet/System.IO.FileSystem.dll", + "ref/dotnet/System.IO.FileSystem.xml", + "ref/dotnet/zh-hans/System.IO.FileSystem.xml", + "ref/dotnet/zh-hant/System.IO.FileSystem.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.IO.FileSystem.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.IO.FileSystem.4.0.0.nupkg", + "System.IO.FileSystem.4.0.0.nupkg.sha512", + "System.IO.FileSystem.nuspec" + ] + }, + "System.IO.FileSystem.Primitives/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "7pJUvYi/Yq3A5nagqCCiOw3+aJp3xXc/Cjr8dnJDnER3/6kX3LEencfqmXUcPl9+7OvRNyPMNhqsLAcMK6K/KA==", + "files": [ + "lib/dotnet/System.IO.FileSystem.Primitives.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.IO.FileSystem.Primitives.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/es/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/fr/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/it/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/ja/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/ko/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/ru/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/System.IO.FileSystem.Primitives.dll", + "ref/dotnet/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/zh-hans/System.IO.FileSystem.Primitives.xml", + "ref/dotnet/zh-hant/System.IO.FileSystem.Primitives.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.IO.FileSystem.Primitives.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.IO.FileSystem.Primitives.4.0.0.nupkg", + "System.IO.FileSystem.Primitives.4.0.0.nupkg.sha512", + "System.IO.FileSystem.Primitives.nuspec" + ] + }, + "System.IO.UnmanagedMemoryStream/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "i2xczgQfwHmolORBNHxV9b5izP8VOBxgSA2gf+H55xBvwqtR+9r9adtzlc7at0MAwiLcsk6V1TZlv2vfRQr8Sw==", + "files": [ + "lib/dotnet/System.IO.UnmanagedMemoryStream.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.IO.UnmanagedMemoryStream.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/es/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/fr/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/it/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/ja/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/ko/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/ru/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/System.IO.UnmanagedMemoryStream.dll", + "ref/dotnet/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/zh-hans/System.IO.UnmanagedMemoryStream.xml", + "ref/dotnet/zh-hant/System.IO.UnmanagedMemoryStream.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.IO.UnmanagedMemoryStream.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.IO.UnmanagedMemoryStream.4.0.0.nupkg", + "System.IO.UnmanagedMemoryStream.4.0.0.nupkg.sha512", + "System.IO.UnmanagedMemoryStream.nuspec" + ] + }, + "System.Linq/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "r6Hlc+ytE6m/9UBr+nNRRdoJEWjoeQiT3L3lXYFDHoXk3VYsRBCDNXrawcexw7KPLaH0zamQLiAb6avhZ50cGg==", + "files": [ + "lib/dotnet/System.Linq.dll", + "lib/net45/_._", + "lib/netcore50/System.Linq.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Linq.xml", + "ref/dotnet/es/System.Linq.xml", + "ref/dotnet/fr/System.Linq.xml", + "ref/dotnet/it/System.Linq.xml", + "ref/dotnet/ja/System.Linq.xml", + "ref/dotnet/ko/System.Linq.xml", + "ref/dotnet/ru/System.Linq.xml", + "ref/dotnet/System.Linq.dll", + "ref/dotnet/System.Linq.xml", + "ref/dotnet/zh-hans/System.Linq.xml", + "ref/dotnet/zh-hant/System.Linq.xml", + "ref/net45/_._", + "ref/netcore50/System.Linq.dll", + "ref/netcore50/System.Linq.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "System.Linq.4.0.0.nupkg", + "System.Linq.4.0.0.nupkg.sha512", + "System.Linq.nuspec" + ] + }, + "System.Linq.Expressions/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "qhFkPqRsTfXBaacjQhxwwwUoU7TEtwlBIULj7nG7i4qAkvivil31VvOvDKppCSui5yGw0/325ZeNaMYRvTotXw==", + "files": [ + "lib/DNXCore50/System.Linq.Expressions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Linq.Expressions.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Linq.Expressions.xml", + "ref/dotnet/es/System.Linq.Expressions.xml", + "ref/dotnet/fr/System.Linq.Expressions.xml", + "ref/dotnet/it/System.Linq.Expressions.xml", + "ref/dotnet/ja/System.Linq.Expressions.xml", + "ref/dotnet/ko/System.Linq.Expressions.xml", + "ref/dotnet/ru/System.Linq.Expressions.xml", + "ref/dotnet/System.Linq.Expressions.dll", + "ref/dotnet/System.Linq.Expressions.xml", + "ref/dotnet/zh-hans/System.Linq.Expressions.xml", + "ref/dotnet/zh-hant/System.Linq.Expressions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtime.json", + "runtimes/win8-aot/lib/netcore50/System.Linq.Expressions.dll", + "System.Linq.Expressions.4.0.10.nupkg", + "System.Linq.Expressions.4.0.10.nupkg.sha512", + "System.Linq.Expressions.nuspec" + ] + }, + "System.Linq.Parallel/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "PtH7KKh1BbzVow4XY17pnrn7Io63ApMdwzRE2o2HnzsKQD/0o7X5xe6mxrDUqTm9ZCR3/PNhAlP13VY1HnHsbA==", + "files": [ + "lib/dotnet/System.Linq.Parallel.dll", + "lib/net45/_._", + "lib/netcore50/System.Linq.Parallel.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Linq.Parallel.xml", + "ref/dotnet/es/System.Linq.Parallel.xml", + "ref/dotnet/fr/System.Linq.Parallel.xml", + "ref/dotnet/it/System.Linq.Parallel.xml", + "ref/dotnet/ja/System.Linq.Parallel.xml", + "ref/dotnet/ko/System.Linq.Parallel.xml", + "ref/dotnet/ru/System.Linq.Parallel.xml", + "ref/dotnet/System.Linq.Parallel.dll", + "ref/dotnet/System.Linq.Parallel.xml", + "ref/dotnet/zh-hans/System.Linq.Parallel.xml", + "ref/dotnet/zh-hant/System.Linq.Parallel.xml", + "ref/net45/_._", + "ref/netcore50/System.Linq.Parallel.dll", + "ref/netcore50/System.Linq.Parallel.xml", + "ref/win8/_._", + "ref/wpa81/_._", + "System.Linq.Parallel.4.0.0.nupkg", + "System.Linq.Parallel.4.0.0.nupkg.sha512", + "System.Linq.Parallel.nuspec" + ] + }, + "System.Linq.Queryable/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "DIlvCNn3ucFvwMMzXcag4aFnFJ1fdxkQ5NqwJe9Nh7y8ozzhDm07YakQL/yoF3P1dLzY1T2cTpuwbAmVSdXyBA==", + "files": [ + "lib/dotnet/System.Linq.Queryable.dll", + "lib/net45/_._", + "lib/netcore50/System.Linq.Queryable.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Linq.Queryable.xml", + "ref/dotnet/es/System.Linq.Queryable.xml", + "ref/dotnet/fr/System.Linq.Queryable.xml", + "ref/dotnet/it/System.Linq.Queryable.xml", + "ref/dotnet/ja/System.Linq.Queryable.xml", + "ref/dotnet/ko/System.Linq.Queryable.xml", + "ref/dotnet/ru/System.Linq.Queryable.xml", + "ref/dotnet/System.Linq.Queryable.dll", + "ref/dotnet/System.Linq.Queryable.xml", + "ref/dotnet/zh-hans/System.Linq.Queryable.xml", + "ref/dotnet/zh-hant/System.Linq.Queryable.xml", + "ref/net45/_._", + "ref/netcore50/System.Linq.Queryable.dll", + "ref/netcore50/System.Linq.Queryable.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "System.Linq.Queryable.4.0.0.nupkg", + "System.Linq.Queryable.4.0.0.nupkg.sha512", + "System.Linq.Queryable.nuspec" + ] + }, + "System.Net.Http/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "mZuAl7jw/mFY8jUq4ITKECxVBh9a8SJt9BC/+lJbmo7cRKspxE3PsITz+KiaCEsexN5WYPzwBOx0oJH/0HlPyQ==", + "files": [ + "lib/DNXCore50/System.Net.Http.dll", + "lib/net45/_._", + "lib/netcore50/System.Net.Http.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Net.Http.xml", + "ref/dotnet/es/System.Net.Http.xml", + "ref/dotnet/fr/System.Net.Http.xml", + "ref/dotnet/it/System.Net.Http.xml", + "ref/dotnet/ja/System.Net.Http.xml", + "ref/dotnet/ko/System.Net.Http.xml", + "ref/dotnet/ru/System.Net.Http.xml", + "ref/dotnet/System.Net.Http.dll", + "ref/dotnet/System.Net.Http.xml", + "ref/dotnet/zh-hans/System.Net.Http.xml", + "ref/dotnet/zh-hant/System.Net.Http.xml", + "ref/net45/_._", + "ref/netcore50/System.Net.Http.dll", + "ref/netcore50/System.Net.Http.xml", + "ref/win8/_._", + "ref/wpa81/_._", + "System.Net.Http.4.0.0.nupkg", + "System.Net.Http.4.0.0.nupkg.sha512", + "System.Net.Http.nuspec" + ] + }, + "System.Net.NetworkInformation/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "D68KCf5VK1G1GgFUwD901gU6cnMITksOdfdxUCt9ReCZfT1pigaDqjJ7XbiLAM4jm7TfZHB7g5mbOf1mbG3yBA==", + "files": [ + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net45/_._", + "lib/netcore50/System.Net.NetworkInformation.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Net.NetworkInformation.xml", + "ref/dotnet/es/System.Net.NetworkInformation.xml", + "ref/dotnet/fr/System.Net.NetworkInformation.xml", + "ref/dotnet/it/System.Net.NetworkInformation.xml", + "ref/dotnet/ja/System.Net.NetworkInformation.xml", + "ref/dotnet/ko/System.Net.NetworkInformation.xml", + "ref/dotnet/ru/System.Net.NetworkInformation.xml", + "ref/dotnet/System.Net.NetworkInformation.dll", + "ref/dotnet/System.Net.NetworkInformation.xml", + "ref/dotnet/zh-hans/System.Net.NetworkInformation.xml", + "ref/dotnet/zh-hant/System.Net.NetworkInformation.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net45/_._", + "ref/netcore50/System.Net.NetworkInformation.dll", + "ref/netcore50/System.Net.NetworkInformation.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Net.NetworkInformation.4.0.0.nupkg", + "System.Net.NetworkInformation.4.0.0.nupkg.sha512", + "System.Net.NetworkInformation.nuspec" + ] + }, + "System.Net.Primitives/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "YQqIpmMhnKjIbT7rl6dlf7xM5DxaMR+whduZ9wKb9OhMLjoueAJO3HPPJI+Naf3v034kb+xZqdc3zo44o3HWcg==", + "files": [ + "lib/DNXCore50/System.Net.Primitives.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Net.Primitives.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Net.Primitives.xml", + "ref/dotnet/es/System.Net.Primitives.xml", + "ref/dotnet/fr/System.Net.Primitives.xml", + "ref/dotnet/it/System.Net.Primitives.xml", + "ref/dotnet/ja/System.Net.Primitives.xml", + "ref/dotnet/ko/System.Net.Primitives.xml", + "ref/dotnet/ru/System.Net.Primitives.xml", + "ref/dotnet/System.Net.Primitives.dll", + "ref/dotnet/System.Net.Primitives.xml", + "ref/dotnet/zh-hans/System.Net.Primitives.xml", + "ref/dotnet/zh-hant/System.Net.Primitives.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Net.Primitives.4.0.10.nupkg", + "System.Net.Primitives.4.0.10.nupkg.sha512", + "System.Net.Primitives.nuspec" + ] + }, + "System.Numerics.Vectors/4.1.0": { + "type": "package", + "serviceable": true, + "sha512": "jpubR06GWPoZA0oU5xLM7kHeV59/CKPBXZk4Jfhi0T3DafxbrdueHZ8kXlb+Fb5nd3DAyyMh2/eqEzLX0xv6Qg==", + "files": [ + "lib/dotnet/System.Numerics.Vectors.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Numerics.Vectors.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Numerics.Vectors.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Numerics.Vectors.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Numerics.Vectors.4.1.0.nupkg", + "System.Numerics.Vectors.4.1.0.nupkg.sha512", + "System.Numerics.Vectors.nuspec" + ] + }, + "System.ObjectModel/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "Djn1wb0vP662zxbe+c3mOhvC4vkQGicsFs1Wi0/GJJpp3Eqp+oxbJ+p2Sx3O0efYueggAI5SW+BqEoczjfr1cA==", + "files": [ + "lib/dotnet/System.ObjectModel.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.ObjectModel.xml", + "ref/dotnet/es/System.ObjectModel.xml", + "ref/dotnet/fr/System.ObjectModel.xml", + "ref/dotnet/it/System.ObjectModel.xml", + "ref/dotnet/ja/System.ObjectModel.xml", + "ref/dotnet/ko/System.ObjectModel.xml", + "ref/dotnet/ru/System.ObjectModel.xml", + "ref/dotnet/System.ObjectModel.dll", + "ref/dotnet/System.ObjectModel.xml", + "ref/dotnet/zh-hans/System.ObjectModel.xml", + "ref/dotnet/zh-hant/System.ObjectModel.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.ObjectModel.4.0.10.nupkg", + "System.ObjectModel.4.0.10.nupkg.sha512", + "System.ObjectModel.nuspec" + ] + }, + "System.Reflection/4.0.10": { + "type": "package", + "sha512": "WZ+4lEE4gqGx6mrqLhSiW4oi6QLPWwdNjzhhTONmhELOrW8Cw9phlO9tltgvRUuQUqYtBiliFwhO5S5fCJElVw==", + "files": [ + "lib/DNXCore50/System.Reflection.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Reflection.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Reflection.xml", + "ref/dotnet/es/System.Reflection.xml", + "ref/dotnet/fr/System.Reflection.xml", + "ref/dotnet/it/System.Reflection.xml", + "ref/dotnet/ja/System.Reflection.xml", + "ref/dotnet/ko/System.Reflection.xml", + "ref/dotnet/ru/System.Reflection.xml", + "ref/dotnet/System.Reflection.dll", + "ref/dotnet/System.Reflection.xml", + "ref/dotnet/zh-hans/System.Reflection.xml", + "ref/dotnet/zh-hant/System.Reflection.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Reflection.dll", + "System.Reflection.4.0.10.nupkg", + "System.Reflection.4.0.10.nupkg.sha512", + "System.Reflection.nuspec" + ] + }, + "System.Reflection.DispatchProxy/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "Kd/4o6DqBfJA4058X8oGEu1KlT8Ej0A+WGeoQgZU2h+3f2vC8NRbHxeOSZvxj9/MPZ1RYmZMGL1ApO9xG/4IVA==", + "files": [ + "lib/DNXCore50/System.Reflection.DispatchProxy.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Reflection.DispatchProxy.dll", + "lib/netcore50/System.Reflection.DispatchProxy.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Reflection.DispatchProxy.xml", + "ref/dotnet/es/System.Reflection.DispatchProxy.xml", + "ref/dotnet/fr/System.Reflection.DispatchProxy.xml", + "ref/dotnet/it/System.Reflection.DispatchProxy.xml", + "ref/dotnet/ja/System.Reflection.DispatchProxy.xml", + "ref/dotnet/ko/System.Reflection.DispatchProxy.xml", + "ref/dotnet/ru/System.Reflection.DispatchProxy.xml", + "ref/dotnet/System.Reflection.DispatchProxy.dll", + "ref/dotnet/System.Reflection.DispatchProxy.xml", + "ref/dotnet/zh-hans/System.Reflection.DispatchProxy.xml", + "ref/dotnet/zh-hant/System.Reflection.DispatchProxy.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtime.json", + "runtimes/win8-aot/lib/netcore50/System.Reflection.DispatchProxy.dll", + "System.Reflection.DispatchProxy.4.0.0.nupkg", + "System.Reflection.DispatchProxy.4.0.0.nupkg.sha512", + "System.Reflection.DispatchProxy.nuspec" + ] + }, + "System.Reflection.Emit/4.0.0": { + "type": "package", + "sha512": "CqnQz5LbNbiSxN10cv3Ehnw3j1UZOBCxnE0OO0q/keGQ5ENjyFM6rIG4gm/i0dX6EjdpYkAgKcI/mhZZCaBq4A==", + "files": [ + "lib/DNXCore50/System.Reflection.Emit.dll", + "lib/MonoAndroid10/_._", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Emit.dll", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Reflection.Emit.xml", + "ref/dotnet/es/System.Reflection.Emit.xml", + "ref/dotnet/fr/System.Reflection.Emit.xml", + "ref/dotnet/it/System.Reflection.Emit.xml", + "ref/dotnet/ja/System.Reflection.Emit.xml", + "ref/dotnet/ko/System.Reflection.Emit.xml", + "ref/dotnet/ru/System.Reflection.Emit.xml", + "ref/dotnet/System.Reflection.Emit.dll", + "ref/dotnet/System.Reflection.Emit.xml", + "ref/dotnet/zh-hans/System.Reflection.Emit.xml", + "ref/dotnet/zh-hant/System.Reflection.Emit.xml", + "ref/MonoAndroid10/_._", + "ref/net45/_._", + "ref/xamarinmac20/_._", + "System.Reflection.Emit.4.0.0.nupkg", + "System.Reflection.Emit.4.0.0.nupkg.sha512", + "System.Reflection.Emit.nuspec" + ] + }, + "System.Reflection.Emit.ILGeneration/4.0.0": { + "type": "package", + "sha512": "02okuusJ0GZiHZSD2IOLIN41GIn6qOr7i5+86C98BPuhlwWqVABwebiGNvhDiXP1f9a6CxEigC7foQD42klcDg==", + "files": [ + "lib/DNXCore50/System.Reflection.Emit.ILGeneration.dll", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Emit.ILGeneration.dll", + "lib/wp80/_._", + "ref/dotnet/de/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/es/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/fr/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/it/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/ja/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/ko/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/ru/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/System.Reflection.Emit.ILGeneration.dll", + "ref/dotnet/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/zh-hans/System.Reflection.Emit.ILGeneration.xml", + "ref/dotnet/zh-hant/System.Reflection.Emit.ILGeneration.xml", + "ref/net45/_._", + "ref/wp80/_._", + "System.Reflection.Emit.ILGeneration.4.0.0.nupkg", + "System.Reflection.Emit.ILGeneration.4.0.0.nupkg.sha512", + "System.Reflection.Emit.ILGeneration.nuspec" + ] + }, + "System.Reflection.Emit.Lightweight/4.0.0": { + "type": "package", + "sha512": "DJZhHiOdkN08xJgsJfDjkuOreLLmMcU8qkEEqEHqyhkPUZMMQs0lE8R+6+68BAFWgcdzxtNu0YmIOtEug8j00w==", + "files": [ + "lib/DNXCore50/System.Reflection.Emit.Lightweight.dll", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Emit.Lightweight.dll", + "lib/wp80/_._", + "ref/dotnet/de/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/es/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/fr/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/it/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/ja/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/ko/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/ru/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/System.Reflection.Emit.Lightweight.dll", + "ref/dotnet/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/zh-hans/System.Reflection.Emit.Lightweight.xml", + "ref/dotnet/zh-hant/System.Reflection.Emit.Lightweight.xml", + "ref/net45/_._", + "ref/wp80/_._", + "System.Reflection.Emit.Lightweight.4.0.0.nupkg", + "System.Reflection.Emit.Lightweight.4.0.0.nupkg.sha512", + "System.Reflection.Emit.Lightweight.nuspec" + ] + }, + "System.Reflection.Extensions/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "dbYaZWCyFAu1TGYUqR2n+Q+1casSHPR2vVW0WVNkXpZbrd2BXcZ7cpvpu9C98CTHtNmyfMWCLpCclDqly23t6A==", + "files": [ + "lib/DNXCore50/System.Reflection.Extensions.dll", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Extensions.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Reflection.Extensions.xml", + "ref/dotnet/es/System.Reflection.Extensions.xml", + "ref/dotnet/fr/System.Reflection.Extensions.xml", + "ref/dotnet/it/System.Reflection.Extensions.xml", + "ref/dotnet/ja/System.Reflection.Extensions.xml", + "ref/dotnet/ko/System.Reflection.Extensions.xml", + "ref/dotnet/ru/System.Reflection.Extensions.xml", + "ref/dotnet/System.Reflection.Extensions.dll", + "ref/dotnet/System.Reflection.Extensions.xml", + "ref/dotnet/zh-hans/System.Reflection.Extensions.xml", + "ref/dotnet/zh-hant/System.Reflection.Extensions.xml", + "ref/net45/_._", + "ref/netcore50/System.Reflection.Extensions.dll", + "ref/netcore50/System.Reflection.Extensions.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Reflection.Extensions.dll", + "System.Reflection.Extensions.4.0.0.nupkg", + "System.Reflection.Extensions.4.0.0.nupkg.sha512", + "System.Reflection.Extensions.nuspec" + ] + }, + "System.Reflection.Metadata/1.0.22": { + "type": "package", + "serviceable": true, + "sha512": "ltoL/teiEdy5W9fyYdtFr2xJ/4nHyksXLK9dkPWx3ubnj7BVfsSWxvWTg9EaJUXjhWvS/AeTtugZA1/IDQyaPQ==", + "files": [ + "lib/dotnet/System.Reflection.Metadata.dll", + "lib/dotnet/System.Reflection.Metadata.xml", + "lib/portable-net45+win8/System.Reflection.Metadata.dll", + "lib/portable-net45+win8/System.Reflection.Metadata.xml", + "System.Reflection.Metadata.1.0.22.nupkg", + "System.Reflection.Metadata.1.0.22.nupkg.sha512", + "System.Reflection.Metadata.nuspec" + ] + }, + "System.Reflection.Primitives/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "n9S0XpKv2ruc17FSnaiX6nV47VfHTZ1wLjKZlAirUZCvDQCH71mVp+Ohabn0xXLh5pK2PKp45HCxkqu5Fxn/lA==", + "files": [ + "lib/DNXCore50/System.Reflection.Primitives.dll", + "lib/net45/_._", + "lib/netcore50/System.Reflection.Primitives.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Reflection.Primitives.xml", + "ref/dotnet/es/System.Reflection.Primitives.xml", + "ref/dotnet/fr/System.Reflection.Primitives.xml", + "ref/dotnet/it/System.Reflection.Primitives.xml", + "ref/dotnet/ja/System.Reflection.Primitives.xml", + "ref/dotnet/ko/System.Reflection.Primitives.xml", + "ref/dotnet/ru/System.Reflection.Primitives.xml", + "ref/dotnet/System.Reflection.Primitives.dll", + "ref/dotnet/System.Reflection.Primitives.xml", + "ref/dotnet/zh-hans/System.Reflection.Primitives.xml", + "ref/dotnet/zh-hant/System.Reflection.Primitives.xml", + "ref/net45/_._", + "ref/netcore50/System.Reflection.Primitives.dll", + "ref/netcore50/System.Reflection.Primitives.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Reflection.Primitives.dll", + "System.Reflection.Primitives.4.0.0.nupkg", + "System.Reflection.Primitives.4.0.0.nupkg.sha512", + "System.Reflection.Primitives.nuspec" + ] + }, + "System.Reflection.TypeExtensions/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "YRM/msNAM86hdxPyXcuZSzmTO0RQFh7YMEPBLTY8cqXvFPYIx2x99bOyPkuU81wRYQem1c1HTkImQ2DjbOBfew==", + "files": [ + "lib/DNXCore50/System.Reflection.TypeExtensions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Reflection.TypeExtensions.dll", + "lib/netcore50/System.Reflection.TypeExtensions.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Reflection.TypeExtensions.xml", + "ref/dotnet/es/System.Reflection.TypeExtensions.xml", + "ref/dotnet/fr/System.Reflection.TypeExtensions.xml", + "ref/dotnet/it/System.Reflection.TypeExtensions.xml", + "ref/dotnet/ja/System.Reflection.TypeExtensions.xml", + "ref/dotnet/ko/System.Reflection.TypeExtensions.xml", + "ref/dotnet/ru/System.Reflection.TypeExtensions.xml", + "ref/dotnet/System.Reflection.TypeExtensions.dll", + "ref/dotnet/System.Reflection.TypeExtensions.xml", + "ref/dotnet/zh-hans/System.Reflection.TypeExtensions.xml", + "ref/dotnet/zh-hant/System.Reflection.TypeExtensions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Reflection.TypeExtensions.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Reflection.TypeExtensions.dll", + "System.Reflection.TypeExtensions.4.0.0.nupkg", + "System.Reflection.TypeExtensions.4.0.0.nupkg.sha512", + "System.Reflection.TypeExtensions.nuspec" + ] + }, + "System.Resources.ResourceManager/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "qmqeZ4BJgjfU+G2JbrZt4Dk1LsMxO4t+f/9HarNY6w8pBgweO6jT+cknUH7c3qIrGvyUqraBhU45Eo6UtA0fAw==", + "files": [ + "lib/DNXCore50/System.Resources.ResourceManager.dll", + "lib/net45/_._", + "lib/netcore50/System.Resources.ResourceManager.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Resources.ResourceManager.xml", + "ref/dotnet/es/System.Resources.ResourceManager.xml", + "ref/dotnet/fr/System.Resources.ResourceManager.xml", + "ref/dotnet/it/System.Resources.ResourceManager.xml", + "ref/dotnet/ja/System.Resources.ResourceManager.xml", + "ref/dotnet/ko/System.Resources.ResourceManager.xml", + "ref/dotnet/ru/System.Resources.ResourceManager.xml", + "ref/dotnet/System.Resources.ResourceManager.dll", + "ref/dotnet/System.Resources.ResourceManager.xml", + "ref/dotnet/zh-hans/System.Resources.ResourceManager.xml", + "ref/dotnet/zh-hant/System.Resources.ResourceManager.xml", + "ref/net45/_._", + "ref/netcore50/System.Resources.ResourceManager.dll", + "ref/netcore50/System.Resources.ResourceManager.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Resources.ResourceManager.dll", + "System.Resources.ResourceManager.4.0.0.nupkg", + "System.Resources.ResourceManager.4.0.0.nupkg.sha512", + "System.Resources.ResourceManager.nuspec" + ] + }, + "System.Runtime/4.0.20": { + "type": "package", + "serviceable": true, + "sha512": "X7N/9Bz7jVPorqdVFO86ns1sX6MlQM+WTxELtx+Z4VG45x9+LKmWH0GRqjgKprUnVuwmfB9EJ9DQng14Z7/zwg==", + "files": [ + "lib/DNXCore50/System.Runtime.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Runtime.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Runtime.xml", + "ref/dotnet/es/System.Runtime.xml", + "ref/dotnet/fr/System.Runtime.xml", + "ref/dotnet/it/System.Runtime.xml", + "ref/dotnet/ja/System.Runtime.xml", + "ref/dotnet/ko/System.Runtime.xml", + "ref/dotnet/ru/System.Runtime.xml", + "ref/dotnet/System.Runtime.dll", + "ref/dotnet/System.Runtime.xml", + "ref/dotnet/zh-hans/System.Runtime.xml", + "ref/dotnet/zh-hant/System.Runtime.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Runtime.dll", + "System.Runtime.4.0.20.nupkg", + "System.Runtime.4.0.20.nupkg.sha512", + "System.Runtime.nuspec" + ] + }, + "System.Runtime.Extensions/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "5dsEwf3Iml7d5OZeT20iyOjT+r+okWpN7xI2v+R4cgd3WSj4DeRPTvPFjDpacbVW4skCAZ8B9hxXJYgkCFKJ1A==", + "files": [ + "lib/DNXCore50/System.Runtime.Extensions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Runtime.Extensions.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Runtime.Extensions.xml", + "ref/dotnet/es/System.Runtime.Extensions.xml", + "ref/dotnet/fr/System.Runtime.Extensions.xml", + "ref/dotnet/it/System.Runtime.Extensions.xml", + "ref/dotnet/ja/System.Runtime.Extensions.xml", + "ref/dotnet/ko/System.Runtime.Extensions.xml", + "ref/dotnet/ru/System.Runtime.Extensions.xml", + "ref/dotnet/System.Runtime.Extensions.dll", + "ref/dotnet/System.Runtime.Extensions.xml", + "ref/dotnet/zh-hans/System.Runtime.Extensions.xml", + "ref/dotnet/zh-hant/System.Runtime.Extensions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Runtime.Extensions.dll", + "System.Runtime.Extensions.4.0.10.nupkg", + "System.Runtime.Extensions.4.0.10.nupkg.sha512", + "System.Runtime.Extensions.nuspec" + ] + }, + "System.Runtime.Handles/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "638VhpRq63tVcQ6HDb3um3R/J2BtR1Sa96toHo6PcJGPXEPEsleCuqhBgX2gFCz0y0qkutANwW6VPPY5wQu1XQ==", + "files": [ + "lib/DNXCore50/System.Runtime.Handles.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Runtime.Handles.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Runtime.Handles.xml", + "ref/dotnet/es/System.Runtime.Handles.xml", + "ref/dotnet/fr/System.Runtime.Handles.xml", + "ref/dotnet/it/System.Runtime.Handles.xml", + "ref/dotnet/ja/System.Runtime.Handles.xml", + "ref/dotnet/ko/System.Runtime.Handles.xml", + "ref/dotnet/ru/System.Runtime.Handles.xml", + "ref/dotnet/System.Runtime.Handles.dll", + "ref/dotnet/System.Runtime.Handles.xml", + "ref/dotnet/zh-hans/System.Runtime.Handles.xml", + "ref/dotnet/zh-hant/System.Runtime.Handles.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Runtime.Handles.dll", + "System.Runtime.Handles.4.0.0.nupkg", + "System.Runtime.Handles.4.0.0.nupkg.sha512", + "System.Runtime.Handles.nuspec" + ] + }, + "System.Runtime.InteropServices/4.0.20": { + "type": "package", + "serviceable": true, + "sha512": "ZgDyBYfEnjWoz/viS6VOswA6XOkDSH2DzgbpczbW50RywhnCgTl+w3JEvtAiOGyIh8cyx1NJq80jsNBSUr8Pig==", + "files": [ + "lib/DNXCore50/System.Runtime.InteropServices.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Runtime.InteropServices.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Runtime.InteropServices.xml", + "ref/dotnet/es/System.Runtime.InteropServices.xml", + "ref/dotnet/fr/System.Runtime.InteropServices.xml", + "ref/dotnet/it/System.Runtime.InteropServices.xml", + "ref/dotnet/ja/System.Runtime.InteropServices.xml", + "ref/dotnet/ko/System.Runtime.InteropServices.xml", + "ref/dotnet/ru/System.Runtime.InteropServices.xml", + "ref/dotnet/System.Runtime.InteropServices.dll", + "ref/dotnet/System.Runtime.InteropServices.xml", + "ref/dotnet/zh-hans/System.Runtime.InteropServices.xml", + "ref/dotnet/zh-hant/System.Runtime.InteropServices.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Runtime.InteropServices.dll", + "System.Runtime.InteropServices.4.0.20.nupkg", + "System.Runtime.InteropServices.4.0.20.nupkg.sha512", + "System.Runtime.InteropServices.nuspec" + ] + }, + "System.Runtime.Numerics/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "aAYGEOE01nabQLufQ4YO8WuSyZzOqGcksi8m1BRW8ppkmssR7en8TqiXcBkB2gTkCnKG/Ai2NQY8CgdmgZw/fw==", + "files": [ + "lib/dotnet/System.Runtime.Numerics.dll", + "lib/net45/_._", + "lib/netcore50/System.Runtime.Numerics.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Runtime.Numerics.xml", + "ref/dotnet/es/System.Runtime.Numerics.xml", + "ref/dotnet/fr/System.Runtime.Numerics.xml", + "ref/dotnet/it/System.Runtime.Numerics.xml", + "ref/dotnet/ja/System.Runtime.Numerics.xml", + "ref/dotnet/ko/System.Runtime.Numerics.xml", + "ref/dotnet/ru/System.Runtime.Numerics.xml", + "ref/dotnet/System.Runtime.Numerics.dll", + "ref/dotnet/System.Runtime.Numerics.xml", + "ref/dotnet/zh-hans/System.Runtime.Numerics.xml", + "ref/dotnet/zh-hant/System.Runtime.Numerics.xml", + "ref/net45/_._", + "ref/netcore50/System.Runtime.Numerics.dll", + "ref/netcore50/System.Runtime.Numerics.xml", + "ref/win8/_._", + "ref/wpa81/_._", + "System.Runtime.Numerics.4.0.0.nupkg", + "System.Runtime.Numerics.4.0.0.nupkg.sha512", + "System.Runtime.Numerics.nuspec" + ] + }, + "System.Security.Claims/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "94NFR/7JN3YdyTH7hl2iSvYmdA8aqShriTHectcK+EbizT71YczMaG6LuqJBQP/HWo66AQyikYYM9aw+4EzGXg==", + "files": [ + "lib/dotnet/System.Security.Claims.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.Claims.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Security.Claims.xml", + "ref/dotnet/es/System.Security.Claims.xml", + "ref/dotnet/fr/System.Security.Claims.xml", + "ref/dotnet/it/System.Security.Claims.xml", + "ref/dotnet/ja/System.Security.Claims.xml", + "ref/dotnet/ko/System.Security.Claims.xml", + "ref/dotnet/ru/System.Security.Claims.xml", + "ref/dotnet/System.Security.Claims.dll", + "ref/dotnet/System.Security.Claims.xml", + "ref/dotnet/zh-hans/System.Security.Claims.xml", + "ref/dotnet/zh-hant/System.Security.Claims.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.Claims.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Security.Claims.4.0.0.nupkg", + "System.Security.Claims.4.0.0.nupkg.sha512", + "System.Security.Claims.nuspec" + ] + }, + "System.Security.Principal/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "FOhq3jUOONi6fp5j3nPYJMrKtSJlqAURpjiO3FaDIV4DJNEYymWW5uh1pfxySEB8dtAW+I66IypzNge/w9OzZQ==", + "files": [ + "lib/dotnet/System.Security.Principal.dll", + "lib/net45/_._", + "lib/netcore50/System.Security.Principal.dll", + "lib/win8/_._", + "lib/wp80/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Security.Principal.xml", + "ref/dotnet/es/System.Security.Principal.xml", + "ref/dotnet/fr/System.Security.Principal.xml", + "ref/dotnet/it/System.Security.Principal.xml", + "ref/dotnet/ja/System.Security.Principal.xml", + "ref/dotnet/ko/System.Security.Principal.xml", + "ref/dotnet/ru/System.Security.Principal.xml", + "ref/dotnet/System.Security.Principal.dll", + "ref/dotnet/System.Security.Principal.xml", + "ref/dotnet/zh-hans/System.Security.Principal.xml", + "ref/dotnet/zh-hant/System.Security.Principal.xml", + "ref/net45/_._", + "ref/netcore50/System.Security.Principal.dll", + "ref/netcore50/System.Security.Principal.xml", + "ref/win8/_._", + "ref/wp80/_._", + "ref/wpa81/_._", + "System.Security.Principal.4.0.0.nupkg", + "System.Security.Principal.4.0.0.nupkg.sha512", + "System.Security.Principal.nuspec" + ] + }, + "System.Security.SecureString/4.0.0-beta-23225": { + "type": "package", + "serviceable": true, + "sha512": "yeh8SaUJQx7BsyqntzyU0jnnKso5US6QX2g6eHBLC1MRb7swwFb12Bd4N7RwSslEaj6LLWzFKb4Lw8AMaWfXbA==", + "files": [ + "lib/DNXCore50/System.Security.SecureString.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Security.SecureString.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Security.SecureString.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Security.SecureString.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Security.SecureString.4.0.0-beta-23225.nupkg", + "System.Security.SecureString.4.0.0-beta-23225.nupkg.sha512", + "System.Security.SecureString.nuspec" + ] + }, + "System.Text.Encoding/4.0.10": { + "type": "package", + "sha512": "fNlSFgy4OuDlJrP9SFFxMlaLazq6ipv15sU5TiEgg9UCVnA/OgoVUfymFp4AOk1jOkW5SVxWbeeIUptcM+m/Vw==", + "files": [ + "lib/DNXCore50/System.Text.Encoding.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Text.Encoding.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Text.Encoding.xml", + "ref/dotnet/es/System.Text.Encoding.xml", + "ref/dotnet/fr/System.Text.Encoding.xml", + "ref/dotnet/it/System.Text.Encoding.xml", + "ref/dotnet/ja/System.Text.Encoding.xml", + "ref/dotnet/ko/System.Text.Encoding.xml", + "ref/dotnet/ru/System.Text.Encoding.xml", + "ref/dotnet/System.Text.Encoding.dll", + "ref/dotnet/System.Text.Encoding.xml", + "ref/dotnet/zh-hans/System.Text.Encoding.xml", + "ref/dotnet/zh-hant/System.Text.Encoding.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Text.Encoding.dll", + "System.Text.Encoding.4.0.10.nupkg", + "System.Text.Encoding.4.0.10.nupkg.sha512", + "System.Text.Encoding.nuspec" + ] + }, + "System.Text.Encoding.Extensions/4.0.10": { + "type": "package", + "sha512": "TZvlwXMxKo3bSRIcsWZLCIzIhLbvlz+mGeKYRZv/zUiSoQzGOwkYeBu6hOw2XPQgKqT0F4Rv8zqKdvmp2fWKYg==", + "files": [ + "lib/DNXCore50/System.Text.Encoding.Extensions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Text.Encoding.Extensions.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Text.Encoding.Extensions.xml", + "ref/dotnet/es/System.Text.Encoding.Extensions.xml", + "ref/dotnet/fr/System.Text.Encoding.Extensions.xml", + "ref/dotnet/it/System.Text.Encoding.Extensions.xml", + "ref/dotnet/ja/System.Text.Encoding.Extensions.xml", + "ref/dotnet/ko/System.Text.Encoding.Extensions.xml", + "ref/dotnet/ru/System.Text.Encoding.Extensions.xml", + "ref/dotnet/System.Text.Encoding.Extensions.dll", + "ref/dotnet/System.Text.Encoding.Extensions.xml", + "ref/dotnet/zh-hans/System.Text.Encoding.Extensions.xml", + "ref/dotnet/zh-hant/System.Text.Encoding.Extensions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Text.Encoding.Extensions.dll", + "System.Text.Encoding.Extensions.4.0.10.nupkg", + "System.Text.Encoding.Extensions.4.0.10.nupkg.sha512", + "System.Text.Encoding.Extensions.nuspec" + ] + }, + "System.Text.RegularExpressions/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "0vDuHXJePpfMCecWBNOabOKCvzfTbFMNcGgklt3l5+RqHV5SzmF7RUVpuet8V0rJX30ROlL66xdehw2Rdsn2DA==", + "files": [ + "lib/dotnet/System.Text.RegularExpressions.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Text.RegularExpressions.xml", + "ref/dotnet/es/System.Text.RegularExpressions.xml", + "ref/dotnet/fr/System.Text.RegularExpressions.xml", + "ref/dotnet/it/System.Text.RegularExpressions.xml", + "ref/dotnet/ja/System.Text.RegularExpressions.xml", + "ref/dotnet/ko/System.Text.RegularExpressions.xml", + "ref/dotnet/ru/System.Text.RegularExpressions.xml", + "ref/dotnet/System.Text.RegularExpressions.dll", + "ref/dotnet/System.Text.RegularExpressions.xml", + "ref/dotnet/zh-hans/System.Text.RegularExpressions.xml", + "ref/dotnet/zh-hant/System.Text.RegularExpressions.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Text.RegularExpressions.4.0.10.nupkg", + "System.Text.RegularExpressions.4.0.10.nupkg.sha512", + "System.Text.RegularExpressions.nuspec" + ] + }, + "System.Threading/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "0w6pRxIEE7wuiOJeKabkDgeIKmqf4ER1VNrs6qFwHnooEE78yHwi/bKkg5Jo8/pzGLm0xQJw0nEmPXt1QBAIUA==", + "files": [ + "lib/DNXCore50/System.Threading.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Threading.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Threading.xml", + "ref/dotnet/es/System.Threading.xml", + "ref/dotnet/fr/System.Threading.xml", + "ref/dotnet/it/System.Threading.xml", + "ref/dotnet/ja/System.Threading.xml", + "ref/dotnet/ko/System.Threading.xml", + "ref/dotnet/ru/System.Threading.xml", + "ref/dotnet/System.Threading.dll", + "ref/dotnet/System.Threading.xml", + "ref/dotnet/zh-hans/System.Threading.xml", + "ref/dotnet/zh-hant/System.Threading.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Threading.dll", + "System.Threading.4.0.10.nupkg", + "System.Threading.4.0.10.nupkg.sha512", + "System.Threading.nuspec" + ] + }, + "System.Threading.Tasks/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "NOwJGDfk79jR0bnzosbXLVD/PdI8KzBeESoa3CofEM5v9R5EBfcI0Jyf18stx+0IYV9okmDIDxVtxq9TbnR9bQ==", + "files": [ + "lib/DNXCore50/System.Threading.Tasks.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/netcore50/System.Threading.Tasks.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Threading.Tasks.xml", + "ref/dotnet/es/System.Threading.Tasks.xml", + "ref/dotnet/fr/System.Threading.Tasks.xml", + "ref/dotnet/it/System.Threading.Tasks.xml", + "ref/dotnet/ja/System.Threading.Tasks.xml", + "ref/dotnet/ko/System.Threading.Tasks.xml", + "ref/dotnet/ru/System.Threading.Tasks.xml", + "ref/dotnet/System.Threading.Tasks.dll", + "ref/dotnet/System.Threading.Tasks.xml", + "ref/dotnet/zh-hans/System.Threading.Tasks.xml", + "ref/dotnet/zh-hant/System.Threading.Tasks.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "runtimes/win8-aot/lib/netcore50/System.Threading.Tasks.dll", + "System.Threading.Tasks.4.0.10.nupkg", + "System.Threading.Tasks.4.0.10.nupkg.sha512", + "System.Threading.Tasks.nuspec" + ] + }, + "System.Threading.Tasks.Dataflow/4.5.25": { + "type": "package", + "serviceable": true, + "sha512": "Y5/Dj+tYlDxHBwie7bFKp3+1uSG4vqTJRF7Zs7kaUQ3ahYClffCTxvgjrJyPclC+Le55uE7bMLgjZQVOQr3Jfg==", + "files": [ + "lib/dotnet/System.Threading.Tasks.Dataflow.dll", + "lib/dotnet/System.Threading.Tasks.Dataflow.XML", + "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Dataflow.dll", + "lib/portable-net45+win8+wp8+wpa81/System.Threading.Tasks.Dataflow.XML", + "lib/portable-net45+win8+wpa81/System.Threading.Tasks.Dataflow.dll", + "lib/portable-net45+win8+wpa81/System.Threading.Tasks.Dataflow.XML", + "System.Threading.Tasks.Dataflow.4.5.25.nupkg", + "System.Threading.Tasks.Dataflow.4.5.25.nupkg.sha512", + "System.Threading.Tasks.Dataflow.nuspec" + ] + }, + "System.Threading.Tasks.Parallel/4.0.0": { + "type": "package", + "serviceable": true, + "sha512": "GXDhjPhF3nE4RtDia0W6JR4UMdmhOyt9ibHmsNV6GLRT4HAGqU636Teo4tqvVQOFp2R6b1ffxPXiRaoqtzGxuA==", + "files": [ + "lib/dotnet/System.Threading.Tasks.Parallel.dll", + "lib/net45/_._", + "lib/netcore50/System.Threading.Tasks.Parallel.dll", + "lib/win8/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/es/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/fr/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/it/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/ja/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/ko/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/ru/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/System.Threading.Tasks.Parallel.dll", + "ref/dotnet/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/zh-hans/System.Threading.Tasks.Parallel.xml", + "ref/dotnet/zh-hant/System.Threading.Tasks.Parallel.xml", + "ref/net45/_._", + "ref/netcore50/System.Threading.Tasks.Parallel.dll", + "ref/netcore50/System.Threading.Tasks.Parallel.xml", + "ref/win8/_._", + "ref/wpa81/_._", + "System.Threading.Tasks.Parallel.4.0.0.nupkg", + "System.Threading.Tasks.Parallel.4.0.0.nupkg.sha512", + "System.Threading.Tasks.Parallel.nuspec" + ] + }, + "System.Threading.Thread/4.0.0-beta-23225": { + "type": "package", + "serviceable": true, + "sha512": "ZRcBjGWWC/KBJkobKqs2VLh6WBm1hMwQnY502FYl/2lR2XexzIzkWw1vC5bhNKVJ8jMEK82nSVt775q0i8k1rg==", + "files": [ + "lib/DNXCore50/System.Threading.Thread.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/System.Threading.Thread.dll", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/System.Threading.Thread.dll", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/System.Threading.Thread.dll", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Threading.Thread.4.0.0-beta-23225.nupkg", + "System.Threading.Thread.4.0.0-beta-23225.nupkg.sha512", + "System.Threading.Thread.nuspec" + ] + }, + "System.Threading.Timer/4.0.0": { + "type": "package", + "sha512": "BIdJH5/e4FnVl7TkRUiE3pWytp7OYiRUGtwUbyLewS/PhKiLepFetdtlW+FvDYOVn60Q2NMTrhHhJ51q+sVW5g==", + "files": [ + "lib/DNXCore50/System.Threading.Timer.dll", + "lib/net451/_._", + "lib/netcore50/System.Threading.Timer.dll", + "lib/win81/_._", + "lib/wpa81/_._", + "ref/dotnet/de/System.Threading.Timer.xml", + "ref/dotnet/es/System.Threading.Timer.xml", + "ref/dotnet/fr/System.Threading.Timer.xml", + "ref/dotnet/it/System.Threading.Timer.xml", + "ref/dotnet/ja/System.Threading.Timer.xml", + "ref/dotnet/ko/System.Threading.Timer.xml", + "ref/dotnet/ru/System.Threading.Timer.xml", + "ref/dotnet/System.Threading.Timer.dll", + "ref/dotnet/System.Threading.Timer.xml", + "ref/dotnet/zh-hans/System.Threading.Timer.xml", + "ref/dotnet/zh-hant/System.Threading.Timer.xml", + "ref/net451/_._", + "ref/netcore50/System.Threading.Timer.dll", + "ref/netcore50/System.Threading.Timer.xml", + "ref/win81/_._", + "ref/wpa81/_._", + "runtimes/win8-aot/lib/netcore50/System.Threading.Timer.dll", + "System.Threading.Timer.4.0.0.nupkg", + "System.Threading.Timer.4.0.0.nupkg.sha512", + "System.Threading.Timer.nuspec" + ] + }, + "System.Xml.ReaderWriter/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "VdmWWMH7otrYV7D+cviUo7XjX0jzDnD/lTGSZTlZqfIQ5PhXk85j+6P0TK9od3PnOd5ZIM+pOk01G/J+3nh9/w==", + "files": [ + "lib/dotnet/System.Xml.ReaderWriter.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Xml.ReaderWriter.xml", + "ref/dotnet/es/System.Xml.ReaderWriter.xml", + "ref/dotnet/fr/System.Xml.ReaderWriter.xml", + "ref/dotnet/it/System.Xml.ReaderWriter.xml", + "ref/dotnet/ja/System.Xml.ReaderWriter.xml", + "ref/dotnet/ko/System.Xml.ReaderWriter.xml", + "ref/dotnet/ru/System.Xml.ReaderWriter.xml", + "ref/dotnet/System.Xml.ReaderWriter.dll", + "ref/dotnet/System.Xml.ReaderWriter.xml", + "ref/dotnet/zh-hans/System.Xml.ReaderWriter.xml", + "ref/dotnet/zh-hant/System.Xml.ReaderWriter.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Xml.ReaderWriter.4.0.10.nupkg", + "System.Xml.ReaderWriter.4.0.10.nupkg.sha512", + "System.Xml.ReaderWriter.nuspec" + ] + }, + "System.Xml.XDocument/4.0.10": { + "type": "package", + "serviceable": true, + "sha512": "+ej0g0INnXDjpS2tDJsLO7/BjyBzC+TeBXLeoGnvRrm4AuBH9PhBjjZ1IuKWOhCkxPkFognUOKhZHS2glIOlng==", + "files": [ + "lib/dotnet/System.Xml.XDocument.dll", + "lib/MonoAndroid10/_._", + "lib/MonoTouch10/_._", + "lib/net46/_._", + "lib/xamarinios10/_._", + "lib/xamarinmac20/_._", + "ref/dotnet/de/System.Xml.XDocument.xml", + "ref/dotnet/es/System.Xml.XDocument.xml", + "ref/dotnet/fr/System.Xml.XDocument.xml", + "ref/dotnet/it/System.Xml.XDocument.xml", + "ref/dotnet/ja/System.Xml.XDocument.xml", + "ref/dotnet/ko/System.Xml.XDocument.xml", + "ref/dotnet/ru/System.Xml.XDocument.xml", + "ref/dotnet/System.Xml.XDocument.dll", + "ref/dotnet/System.Xml.XDocument.xml", + "ref/dotnet/zh-hans/System.Xml.XDocument.xml", + "ref/dotnet/zh-hant/System.Xml.XDocument.xml", + "ref/MonoAndroid10/_._", + "ref/MonoTouch10/_._", + "ref/net46/_._", + "ref/xamarinios10/_._", + "ref/xamarinmac20/_._", + "System.Xml.XDocument.4.0.10.nupkg", + "System.Xml.XDocument.4.0.10.nupkg.sha512", + "System.Xml.XDocument.nuspec" + ] + } + }, + "projectFileDependencyGroups": { + "": [], + ".NETFramework,Version=v4.0": [ + "Microsoft.Bcl.Async >= 1.0.168", + "fx/System.Configuration " + ], + ".NETFramework,Version=v4.5": [ + "fx/System.Configuration " + ], + "DNX,Version=v4.5.1": [ + "fx/System.Configuration " + ], + ".NETPortable,Version=v4.5,Profile=Profile259": [ + "fx/Microsoft.CSharp ", + "fx/System.Collections ", + "fx/System.Diagnostics.Debug ", + "fx/System.Dynamic.Runtime ", + "fx/System.Globalization ", + "fx/System.IO ", + "fx/System.Linq ", + "fx/System.Reflection ", + "fx/System.Reflection.Extensions ", + "fx/System.Runtime ", + "fx/System.Runtime.Extensions ", + "fx/System.Text.RegularExpressions ", + "fx/System.Threading ", + "fx/System.Threading.Tasks " + ], + ".NETPlatform,Version=v5.0": [ + "Microsoft.NETCore.Platforms >= 1.0.0", + "Microsoft.NETCore >= 5.0.0", + "System.Collections.Concurrent >= 4.0.11-beta-23225", + "System.Console >= 4.0.0-beta-23225", + "System.Diagnostics.Process >= 4.0.0-beta-23225", + "System.Diagnostics.TraceSource >= 4.0.0-beta-23109", + "System.Threading.Thread >= 4.0.0-beta-23225" + ] + } +} \ No newline at end of file diff --git a/test/Serilog.MsTests/Serilog.MsTests.csproj b/test/Serilog.MsTests/Serilog.MsTests.csproj index 6f04e2330..5d72a5b36 100644 --- a/test/Serilog.MsTests/Serilog.MsTests.csproj +++ b/test/Serilog.MsTests/Serilog.MsTests.csproj @@ -53,16 +53,6 @@ - - - {7A9E1095-167D-402A-B43D-B36B97FF183D} - Serilog.FullNetFx - - - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} - Serilog - - diff --git a/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj b/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj index c5093442c..a96f012cc 100644 --- a/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj +++ b/test/Serilog.PerformanceTests/Serilog.PerformanceTests.csproj @@ -46,15 +46,5 @@ - - - {7a9e1095-167d-402a-b43d-b36b97ff183d} - Serilog.FullNetFx - - - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} - Serilog - - \ No newline at end of file diff --git a/test/Serilog.SmokeTest/Serilog.SmokeTest.csproj b/test/Serilog.SmokeTest/Serilog.SmokeTest.csproj index 4dc787b8c..cb3bddb10 100644 --- a/test/Serilog.SmokeTest/Serilog.SmokeTest.csproj +++ b/test/Serilog.SmokeTest/Serilog.SmokeTest.csproj @@ -46,15 +46,5 @@ - - - {7a9e1095-167d-402a-b43d-b36b97ff183d} - Serilog.FullNetFx - - - {0915dbd9-0f7c-4439-8d9e-74c3d579b219} - Serilog - - \ No newline at end of file diff --git a/test/Serilog.Tests/Context/LogContextTests-net40.cs b/test/Serilog.Tests/Context/LogContextTests-net40.cs index 899d1e4c0..e7ab93f87 100644 --- a/test/Serilog.Tests/Context/LogContextTests-net40.cs +++ b/test/Serilog.Tests/Context/LogContextTests-net40.cs @@ -1,14 +1,14 @@ -using NUnit.Framework; +#if NET40 +using Xunit; using Serilog.Context; using Serilog.Events; using Serilog.Tests.Support; namespace Serilog.Tests.Context { - [TestFixture] public class LogContextTests { - [Test] + [Fact] public void MoreNestedPropertiesOverrideLessNestedOnes() { LogEvent lastEvent = null; @@ -21,20 +21,21 @@ public void MoreNestedPropertiesOverrideLessNestedOnes() using (LogContext.PushProperty("A", 1)) { log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); using (LogContext.PushProperty("A", 2)) { log.Write(Some.InformationEvent()); - Assert.AreEqual(2, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(2, lastEvent.Properties["A"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.IsFalse(lastEvent.Properties.ContainsKey("A")); + Assert.False(lastEvent.Properties.ContainsKey("A")); } } } +#endif \ No newline at end of file diff --git a/test/Serilog.Tests/Context/LogContextTests.cs b/test/Serilog.Tests/Context/LogContextTests.cs index 72ba1ef9f..cda911938 100644 --- a/test/Serilog.Tests/Context/LogContextTests.cs +++ b/test/Serilog.Tests/Context/LogContextTests.cs @@ -1,7 +1,8 @@ -using System; +#if !DNXCORE50 +using System; using System.IO; using System.Runtime.Remoting.Messaging; -using NUnit.Framework; +using Xunit; using Serilog.Context; using Serilog.Events; using Serilog.Core.Enrichers; @@ -11,17 +12,15 @@ namespace Serilog.Tests.Context { - [TestFixture] public class LogContextTests { - [SetUp] - public void Setup() + public LogContextTests() { LogContext.PermitCrossAppDomainCalls = false; CallContext.LogicalSetData(typeof(LogContext).FullName, null); } - [Test] + [Fact] public void MoreNestedPropertiesOverrideLessNestedOnes() { LogEvent lastEvent = null; @@ -34,23 +33,23 @@ public void MoreNestedPropertiesOverrideLessNestedOnes() using (LogContext.PushProperty("A", 1)) { log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); using (LogContext.PushProperty("A", 2)) { log.Write(Some.InformationEvent()); - Assert.AreEqual(2, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(2, lastEvent.Properties["A"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.IsFalse(lastEvent.Properties.ContainsKey("A")); + Assert.False(lastEvent.Properties.ContainsKey("A")); } - [Test] + [Fact] public void MultipleNestedPropertiesOverrideLessNestedOnes() { LogEvent lastEvent = null; @@ -63,27 +62,27 @@ public void MultipleNestedPropertiesOverrideLessNestedOnes() using (LogContext.PushProperties(new PropertyEnricher("A1", 1), new PropertyEnricher("A2", 2))) { log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A1"].LiteralValue()); - Assert.AreEqual(2, lastEvent.Properties["A2"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A1"].LiteralValue()); + Assert.Equal(2, lastEvent.Properties["A2"].LiteralValue()); using (LogContext.PushProperties(new PropertyEnricher("A1", 10), new PropertyEnricher("A2", 20))) { log.Write(Some.InformationEvent()); - Assert.AreEqual(10, lastEvent.Properties["A1"].LiteralValue()); - Assert.AreEqual(20, lastEvent.Properties["A2"].LiteralValue()); + Assert.Equal(10, lastEvent.Properties["A1"].LiteralValue()); + Assert.Equal(20, lastEvent.Properties["A2"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A1"].LiteralValue()); - Assert.AreEqual(2, lastEvent.Properties["A2"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A1"].LiteralValue()); + Assert.Equal(2, lastEvent.Properties["A2"].LiteralValue()); } log.Write(Some.InformationEvent()); - Assert.IsFalse(lastEvent.Properties.ContainsKey("A1")); - Assert.IsFalse(lastEvent.Properties.ContainsKey("A2")); + Assert.False(lastEvent.Properties.ContainsKey("A1")); + Assert.False(lastEvent.Properties.ContainsKey("A2")); } - [Test] + [Fact] public async Task ContextPropertiesCrossAsyncCalls() { LogEvent lastEvent = null; @@ -102,15 +101,15 @@ public async Task ContextPropertiesCrossAsyncCalls() var post = Thread.CurrentThread.ManagedThreadId; log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); - // No problem if this happens occasionally. - if (pre == post) - Assert.Inconclusive("The test was marshalled back to the same thread after awaiting"); + // No problem if this happens occasionally; was Assert.Inconclusive(). + // The test was marshalled back to the same thread after awaiting. + Assert.NotSame(pre, post); } } - [Test] + [Fact] public async Task ContextPropertiesPersistWhenCrossAppDomainCallsAreEnabled() { LogEvent lastEvent = null; @@ -131,11 +130,11 @@ public async Task ContextPropertiesPersistWhenCrossAppDomainCallsAreEnabled() var post = Thread.CurrentThread.ManagedThreadId; log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A"].LiteralValue()); - // No problem if this happens occasionally. - if (pre == post) - Assert.Inconclusive("The test was marshalled back to the same thread after awaiting"); + // No problem if this happens occasionally; was Assert.Inconclusive(). + // The test was marshalled back to the same thread after awaiting. + Assert.NotSame(pre, post); } } @@ -143,20 +142,37 @@ public async Task ContextPropertiesPersistWhenCrossAppDomainCallsAreEnabled() // since user property types may not be serializable. // Fails if the Serilog assemblies cannot be loaded in the // remote domain. See also LogContext.Suspend() - [Test] + [Fact(Skip = "Fails when run from Build.ps1, needs more work.")] public void DoesNotPreventCrossDomainCalls() { + var projectRoot = Environment.CurrentDirectory; + while (!File.Exists(Path.Combine(projectRoot, "global.json"))) + { + projectRoot = Directory.GetParent(projectRoot).FullName; + } + AppDomain domain = null; try { - var domaininfo = new AppDomainSetup { ApplicationBase = Path.GetDirectoryName(GetType().Assembly.CodeBase.Replace("file:///", "")) }; + const string configuration = +#if DEBUG + "Debug"; +#else + "Release"; +#endif + + var domaininfo = new AppDomainSetup + { + ApplicationBase = Path.Combine(projectRoot, @"artifacts\"), + PrivateBinPath = @"testbin\Debug\dnx451;bin\Serilog\Debug\dnx451;bin\Serilog.Tests\Debug\dnx451;".Replace("Debug", configuration) + }; var evidence = AppDomain.CurrentDomain.Evidence; domain = AppDomain.CreateDomain("LogContextTest", evidence, domaininfo); var callable = (RemotelyCallable)domain.CreateInstanceAndUnwrap(typeof(RemotelyCallable).Assembly.FullName, typeof(RemotelyCallable).FullName); using (LogContext.PushProperty("Anything", 1001)) - Assert.That(callable.IsCallable()); + Assert.True(callable.IsCallable()); } finally { @@ -165,7 +181,7 @@ public void DoesNotPreventCrossDomainCalls() } } - [Test] + [Fact] public void WhenSuspendedAllPropertiesAreRemovedFromTheContext() { LogEvent lastEvent = null; @@ -180,11 +196,11 @@ public void WhenSuspendedAllPropertiesAreRemovedFromTheContext() using (LogContext.Suspend()) { log.Write(Some.InformationEvent()); - Assert.IsFalse(lastEvent.Properties.ContainsKey("A1")); + Assert.False(lastEvent.Properties.ContainsKey("A1")); } log.Write(Some.InformationEvent()); - Assert.AreEqual(1, lastEvent.Properties["A1"].LiteralValue()); + Assert.Equal(1, lastEvent.Properties["A1"].LiteralValue()); } } } @@ -208,3 +224,4 @@ public bool IsCallable() } } } +#endif diff --git a/test/Serilog.Tests/Core/LoggerTests.cs b/test/Serilog.Tests/Core/LoggerTests.cs index 0879aa672..9c88d0d78 100644 --- a/test/Serilog.Tests/Core/LoggerTests.cs +++ b/test/Serilog.Tests/Core/LoggerTests.cs @@ -2,17 +2,16 @@ using System.IO; using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Core; using Serilog.Events; using Serilog.Tests.Support; namespace Serilog.Tests.Core { - [TestFixture] public class LoggerTests { - [Test] + [Fact] public void AnExceptionThrownByAnEnricherIsNotPropagated() { var thrown = false; @@ -26,20 +25,20 @@ public void AnExceptionThrownByAnEnricherIsNotPropagated() l.Information(Some.String()); - Assert.IsTrue(thrown); + Assert.True(thrown); } - [Test] + [Fact] public void AContextualLoggerAddsTheSourceTypeName() { var evt = DelegatingSink.GetLogEvent(l => l.ForContext() .Information(Some.String())); var lv = evt.Properties[Constants.SourceContextPropertyName].LiteralValue(); - Assert.AreEqual(typeof(LoggerTests).FullName, lv); + Assert.Equal(typeof(LoggerTests).FullName, lv); } - [Test] + [Fact] public void PropertiesInANestedContextOverrideParentContextValues() { var name = Some.String(); @@ -50,17 +49,17 @@ public void PropertiesInANestedContextOverrideParentContextValues() .Write(Some.InformationEvent())); var pActual = evt.Properties[name]; - Assert.AreEqual(v2, pActual.LiteralValue()); + Assert.Equal(v2, pActual.LiteralValue()); } - [Test] + [Fact] public void ParametersForAnEmptyTemplateAreIgnored() { var e = DelegatingSink.GetLogEvent(l => l.Error("message", new object())); - Assert.AreEqual("message", e.RenderMessage()); + Assert.Equal("message", e.RenderMessage()); } - [Test] + [Fact] public void LoggingLevelSwitchDynamicallyChangesLevel() { var events = new List(); @@ -85,8 +84,8 @@ public void LoggingLevelSwitchDynamicallyChangesLevel() log.Error("Emitted"); log.Fatal("Emitted"); - Assert.AreEqual(4, events.Count); - Assert.That(events.All(evt => evt.RenderMessage() == "Emitted")); + Assert.Equal(4, events.Count); + Assert.True(events.All(evt => evt.RenderMessage() == "Emitted")); } } } diff --git a/test/Serilog.Tests/Core/MessageTemplateTests.cs b/test/Serilog.Tests/Core/MessageTemplateTests.cs index 8bfafb484..804e4bc22 100644 --- a/test/Serilog.Tests/Core/MessageTemplateTests.cs +++ b/test/Serilog.Tests/Core/MessageTemplateTests.cs @@ -3,14 +3,13 @@ using System.IO; using System.Linq; using System.Text; -using NUnit.Framework; +using Xunit; using Serilog.Core; using Serilog.Parameters; using MessageTemplateParser = Serilog.Parsing.MessageTemplateParser; namespace Serilog.Tests.Core { - [TestFixture] public class MessageTemplateTests { class Chair @@ -37,85 +36,86 @@ public override string ToString() } } - [Test] + [Fact] public void AnObjectIsRenderedInSimpleNotation() { var m = Render("I sat at {@Chair}", new Chair()); - Assert.AreEqual("I sat at Chair { Back: \"straight\", Legs: [1, 2, 3, 4] }", m); + Assert.Equal("I sat at Chair { Back: \"straight\", Legs: [1, 2, 3, 4] }", m); } - [Test] + [Fact] public void AnObjectIsRenderedInSimpleNotationUsingFormatProvider() { - var m = Render(CultureInfo.GetCultureInfo("fr-FR"), "I received {@Receipt}", new Receipt()); - Assert.AreEqual("I received Receipt { Sum: 12,345, When: 20/05/2013 16:39:00 }", m); + var m = Render(new CultureInfo("fr-FR"), "I received {@Receipt}", new Receipt()); + Assert.Equal("I received Receipt { Sum: 12,345, When: 20/05/2013 16:39:00 }", m); } - [Test] + [Fact] public void AnAnonymousObjectIsRenderedInSimpleNotationWithoutType() { var m = Render("I sat at {@Chair}", new { Back = "straight", Legs = new[] { 1, 2, 3, 4 } }); - Assert.AreEqual("I sat at { Back: \"straight\", Legs: [1, 2, 3, 4] }", m); + Assert.Equal("I sat at { Back: \"straight\", Legs: [1, 2, 3, 4] }", m); } - [Test] + [Fact] public void AnAnonymousObjectIsRenderedInSimpleNotationWithoutTypeUsingFormatProvider() { - var m = Render(CultureInfo.GetCultureInfo("fr-FR"), "I received {@Receipt}", new { Sum = 12.345, When = new DateTime(2013, 5, 20, 16, 39, 0) }); - Assert.AreEqual("I received { Sum: 12,345, When: 20/05/2013 16:39:00 }", m); + var m = Render(new CultureInfo("fr-FR"), "I received {@Receipt}", new { Sum = 12.345, When = new DateTime(2013, 5, 20, 16, 39, 0) }); + Assert.Equal("I received { Sum: 12,345, When: 20/05/2013 16:39:00 }", m); } - [Test] + [Fact] public void AnObjectWithDefaultDestructuringIsRenderedAsAStringLiteral() { var m = Render("I sat at {Chair}", new Chair()); - Assert.AreEqual("I sat at \"a chair\"", m); + Assert.Equal("I sat at \"a chair\"", m); } - [Test] + [Fact] public void AnObjectWithStringifyDestructuringIsRenderedAsAString() { var m = Render("I sat at {$Chair}", new Chair()); - Assert.AreEqual("I sat at \"a chair\"", m); + Assert.Equal("I sat at \"a chair\"", m); } - [Test] + [Fact] public void MultiplePropertiesAreRenderedInOrder() { var m = Render("Just biting {Fruit} number {Count}", "Apple", 12); - Assert.AreEqual("Just biting \"Apple\" number 12", m); + Assert.Equal("Just biting \"Apple\" number 12", m); } - [Test] + [Fact] public void MultiplePropertiesUseFormatProvider() { - var m = Render(CultureInfo.GetCultureInfo("fr-FR"), "Income was {Income} at {Date:d}", 1234.567, new DateTime(2013, 5, 20)); - Assert.AreEqual("Income was 1234,567 at 20/05/2013", m); + var m = Render(new CultureInfo("fr-FR"), "Income was {Income} at {Date:d}", 1234.567, new DateTime(2013, 5, 20)); + Assert.Equal("Income was 1234,567 at 20/05/2013", m); } - [Test] + [Fact] public void FormatStringsArePropagated() { var m = Render("Welcome, customer {CustomerId:0000}", 12); - Assert.AreEqual("Welcome, customer 0012", m); + Assert.Equal("Welcome, customer 0012", m); } - [TestCase("Welcome, customer #{CustomerId,-10}, pleasure to see you", ExpectedResult = "Welcome, customer #1234 , pleasure to see you")] - [TestCase("Welcome, customer #{CustomerId,-10:000000}, pleasure to see you", ExpectedResult = "Welcome, customer #001234 , pleasure to see you")] - [TestCase("Welcome, customer #{CustomerId,10}, pleasure to see you", ExpectedResult = "Welcome, customer # 1234, pleasure to see you")] - [TestCase("Welcome, customer #{CustomerId,10:000000}, pleasure to see you", ExpectedResult = "Welcome, customer # 001234, pleasure to see you")] - [TestCase("Welcome, customer #{CustomerId,10:0,0}, pleasure to see you", ExpectedResult = "Welcome, customer # 1,234, pleasure to see you")] - [TestCase("Welcome, customer #{CustomerId:0,0}, pleasure to see you", ExpectedResult = "Welcome, customer #1,234, pleasure to see you")] - public string AlignmentStringsArePropagated(string value) + [Theory] + [InlineData("Welcome, customer #{CustomerId,-10}, pleasure to see you", "Welcome, customer #1234 , pleasure to see you")] + [InlineData("Welcome, customer #{CustomerId,-10:000000}, pleasure to see you", "Welcome, customer #001234 , pleasure to see you")] + [InlineData("Welcome, customer #{CustomerId,10}, pleasure to see you", "Welcome, customer # 1234, pleasure to see you")] + [InlineData("Welcome, customer #{CustomerId,10:000000}, pleasure to see you", "Welcome, customer # 001234, pleasure to see you")] + [InlineData("Welcome, customer #{CustomerId,10:0,0}, pleasure to see you", "Welcome, customer # 1,234, pleasure to see you")] + [InlineData("Welcome, customer #{CustomerId:0,0}, pleasure to see you", "Welcome, customer #1,234, pleasure to see you")] + public void AlignmentStringsArePropagated(string value, string expected) { - return Render(value, 1234); + Assert.Equal(expected, Render(value, 1234)); } - [Test] + [Fact] public void FormatProviderIsUsed() { - var m = Render(CultureInfo.GetCultureInfo("fr-FR"), "Please pay {Sum}", 12.345); - Assert.AreEqual("Please pay 12,345", m); + var m = Render(new CultureInfo("fr-FR"), "Please pay {Sum}", 12.345); + Assert.Equal("Please pay 12,345", m); } static string Render(string messageTemplate, params object[] properties) @@ -135,33 +135,33 @@ static string Render(IFormatProvider formatProvider, string messageTemplate, par return output.ToString(); } - [Test] + [Fact] public void ATemplateWithOnlyPositionalPropertiesIsAnalyzedAndRenderedPositionally() { var m = Render("{1}, {0}", "world", "Hello"); - Assert.AreEqual("\"Hello\", \"world\"", m); + Assert.Equal("\"Hello\", \"world\"", m); } - [Test] + [Fact] public void ATemplateWithOnlyPositionalPropertiesUsesFormatProvider() { - var m = Render(CultureInfo.GetCultureInfo("fr-FR"), "{1}, {0}", 12.345, "Hello"); - Assert.AreEqual("\"Hello\", 12,345", m); + var m = Render(new CultureInfo("fr-FR"), "{1}, {0}", 12.345, "Hello"); + Assert.Equal("\"Hello\", 12,345", m); } // Debatable what the behavior should be, here. - [Test] + [Fact] public void ATemplateWithNamesAndPositionalsUsesNamesForAllValues() { var m = Render("{1}, {Place}", "world", "Hello"); - Assert.AreEqual("\"world\", \"Hello\"", m); + Assert.Equal("\"world\", \"Hello\"", m); } - [Test] + [Fact] public void MissingPositionalParametersRenderAsTextLikeStandardFormats() { var m = Render("{1}, {0}", "world"); - Assert.AreEqual("{1}, \"world\"", m); + Assert.Equal("{1}, \"world\"", m); } } } diff --git a/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs b/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs index a2ddaef6f..02c4b90aa 100644 --- a/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs +++ b/test/Serilog.Tests/Core/SafeAggregateSinkTests.cs @@ -1,14 +1,13 @@ using System; -using NUnit.Framework; +using Xunit; using Serilog.Core.Sinks; using Serilog.Tests.Support; namespace Serilog.Tests.Core { - [TestFixture] public class SafeAggregateSinkTests { - [Test] + [Fact] public void AnExceptionThrownByASinkIsNotPropagated() { var thrown = false; @@ -20,10 +19,10 @@ public void AnExceptionThrownByASinkIsNotPropagated() s.Emit(Some.InformationEvent()); - Assert.IsTrue(thrown); + Assert.True(thrown); } - [Test] + [Fact] public void WhenASinkThrowsOtherSinksAreStillInvoked() { bool called1 = false, called2 = false; @@ -36,7 +35,7 @@ public void WhenASinkThrowsOtherSinksAreStillInvoked() s.Emit(Some.InformationEvent()); - Assert.IsTrue(called1 && called2); + Assert.True(called1 && called2); } } } diff --git a/test/Serilog.Tests/Core/SecondaryLoggerSinkTests.cs b/test/Serilog.Tests/Core/SecondaryLoggerSinkTests.cs index e5e0e6357..1479361d5 100644 --- a/test/Serilog.Tests/Core/SecondaryLoggerSinkTests.cs +++ b/test/Serilog.Tests/Core/SecondaryLoggerSinkTests.cs @@ -1,13 +1,12 @@ using System; -using NUnit.Framework; using Serilog.Tests.Support; +using Xunit; namespace Serilog.Tests.Core { - [TestFixture] public class SecondaryLoggerSinkTests { - [Test] + [Fact] public void ModifyingCopiesPassedThroughTheSinkPreservesOriginal() { var secondary = new CollectingSink(); @@ -21,14 +20,14 @@ public void ModifyingCopiesPassedThroughTheSinkPreservesOriginal() .CreateLogger() .Write(e); - Assert.AreNotSame(e, secondary.SingleEvent); + Assert.NotSame(e, secondary.SingleEvent); var p = Some.LogEventProperty(); secondary.SingleEvent.AddPropertyIfAbsent(p); - Assert.IsTrue(secondary.SingleEvent.Properties.ContainsKey(p.Name)); - Assert.IsFalse(e.Properties.ContainsKey(p.Name)); + Assert.True(secondary.SingleEvent.Properties.ContainsKey(p.Name)); + Assert.False(e.Properties.ContainsKey(p.Name)); } - [Test] + [Fact] public void WhenOwnedByCallerSecondaryLoggerIsNotDisposed() { var secondary = new DisposeTrackingSink(); @@ -40,10 +39,10 @@ public void WhenOwnedByCallerSecondaryLoggerIsNotDisposed() .WriteTo.Logger(secondaryLogger) .CreateLogger()).Dispose(); - Assert.IsFalse(secondary.IsDisposed); + Assert.False(secondary.IsDisposed); } - [Test] + [Fact] public void WhenOwnedByPrimaryLoggerSecondaryIsDisposed() { var secondary = new DisposeTrackingSink(); @@ -52,7 +51,7 @@ public void WhenOwnedByPrimaryLoggerSecondaryIsDisposed() .WriteTo.Logger(lc => lc.WriteTo.Sink(secondary)) .CreateLogger()).Dispose(); - Assert.That(secondary.IsDisposed); + Assert.True(secondary.IsDisposed); } } } diff --git a/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs b/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs index ad25cc989..0a421f804 100644 --- a/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs +++ b/test/Serilog.Tests/Enrichers/EnvironmentUserNameEnricherTests.cs @@ -1,13 +1,12 @@ -using NUnit.Framework; -using Serilog.Events; +using Serilog.Events; using Serilog.Tests.Support; +using Xunit; namespace Serilog.Tests.Enrichers { - [TestFixture] public class EnvironmentUserNameEnricherTests { - [Test] + [Fact] public void EnvironmentUserNameEnricherIsApplied() { LogEvent evt = null; @@ -18,8 +17,8 @@ public void EnvironmentUserNameEnricherIsApplied() log.Information(@"Has an EnvironmentUserName property with [domain\]userName"); - Assert.IsNotNull(evt); - Assert.IsNotNullOrEmpty((string)evt.Properties["EnvironmentUserName"].LiteralValue()); + Assert.NotNull(evt); + Assert.NotEmpty((string)evt.Properties["EnvironmentUserName"].LiteralValue()); } } } diff --git a/test/Serilog.Tests/Events/DictionaryValueTests.cs b/test/Serilog.Tests/Events/DictionaryValueTests.cs index 21ebc37b5..af8e89dfd 100644 --- a/test/Serilog.Tests/Events/DictionaryValueTests.cs +++ b/test/Serilog.Tests/Events/DictionaryValueTests.cs @@ -1,14 +1,13 @@ using System.Collections.Generic; using System.IO; -using NUnit.Framework; +using Xunit; using Serilog.Events; namespace Serilog.Tests.Events { - [TestFixture] public class DictionaryValueTests { - [Test] + [Fact] public void ADictionaryValueRendersAsMappingOfKeysToValues() { var dict = new DictionaryValue(new[] { @@ -23,7 +22,7 @@ public void ADictionaryValueRendersAsMappingOfKeysToValues() var rendered = sw.ToString(); - Assert.AreEqual("[(1: \"hello\"), (\"world\": [1.2])]", rendered); + Assert.Equal("[(1: \"hello\"), (\"world\": [1.2])]", rendered); } } } diff --git a/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs b/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs index deacf39e8..8d5ee101f 100644 --- a/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs +++ b/test/Serilog.Tests/Events/LogEventPropertyValueTests.cs @@ -1,4 +1,4 @@ -// Copyright 2014 Serilog Contributors +// Copyright 2013-2015 Serilog Contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -15,7 +15,7 @@ using System; using System.Globalization; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Core; using Serilog.Events; using Serilog.Parameters; @@ -24,55 +24,54 @@ namespace Serilog.Tests.Events { - [TestFixture] public class LogEventPropertyValueTests { readonly PropertyValueConverter _converter = new PropertyValueConverter(10, Enumerable.Empty(), Enumerable.Empty()); - [Test] + [Fact] public void AnEnumIsConvertedToANonStringScalarValue() { var value = _converter.CreatePropertyValue(LogEventLevel.Debug, Destructuring.Default); - Assert.IsInstanceOf(value); + Assert.IsType(value); var sv = (ScalarValue)value; - Assert.IsNotNull(sv.Value); - Assert.IsInstanceOf(sv.Value); + Assert.NotNull(sv.Value); + Assert.IsType(sv.Value); } - [Test] + [Fact] public void AScalarValueToStringRendersTheValue() { var num = Some.Int(); var value = _converter.CreatePropertyValue(num, Destructuring.Default); var str = value.ToString(); - Assert.AreEqual(num.ToString(CultureInfo.InvariantCulture), str); + Assert.Equal(num.ToString(CultureInfo.InvariantCulture), str); } - [Test] + [Fact] public void AScalarValueToStringRendersTheValueUsingFormat() { var num = Some.Decimal(); var value = _converter.CreatePropertyValue(num, Destructuring.Default); var str = value.ToString("N2", null); - Assert.AreEqual(num.ToString("N2", CultureInfo.InvariantCulture), str); + Assert.Equal(num.ToString("N2", CultureInfo.InvariantCulture), str); } - [Test] + [Fact] public void AScalarValueToStringRendersTheValueUsingFormatProvider() { var num = Some.Decimal(); var value = _converter.CreatePropertyValue(num, Destructuring.Default); - var str = value.ToString(null, CultureInfo.GetCultureInfo("fr-FR")); - Assert.AreEqual(num.ToString(CultureInfo.GetCultureInfo("fr-FR")), str); + var str = value.ToString(null, new CultureInfo("fr-FR")); + Assert.Equal(num.ToString(new CultureInfo("fr-FR")), str); } - [Test] + [Fact] public void WhenDestructuringAKnownLiteralTypeIsScalar() { var guid = Guid.NewGuid(); var value = _converter.CreatePropertyValue(guid, Destructuring.Destructure); var str = value.ToString(); - Assert.AreEqual(guid.ToString(), str); + Assert.Equal(guid.ToString(), str); } } } diff --git a/test/Serilog.Tests/Filters/MatchingTests.cs b/test/Serilog.Tests/Filters/MatchingTests.cs index 652ef6565..425487c76 100644 --- a/test/Serilog.Tests/Filters/MatchingTests.cs +++ b/test/Serilog.Tests/Filters/MatchingTests.cs @@ -1,13 +1,12 @@ -using NUnit.Framework; +using Xunit; using Serilog.Filters; using Serilog.Tests.Support; namespace Serilog.Tests.Filters { - [TestFixture] public class MatchingTests { - [Test] + [Fact] public void EventsCanBeExcludedBySource() { var written = false; @@ -20,10 +19,10 @@ public void EventsCanBeExcludedBySource() var sourceContext = log.ForContext(); sourceContext.Write(Some.InformationEvent()); - Assert.IsFalse(written); + Assert.False(written); } - [Test] + [Fact] public void EventsCanBeExcludedByPredicate() { var seen = 0; @@ -38,10 +37,10 @@ public void EventsCanBeExcludedByPredicate() log.Information("{Count}", "wrong type"); log.Information("{Count}", 15); - Assert.AreEqual(3, seen); + Assert.Equal(3, seen); } - [Test] + [Fact] public void SourceFiltersWorkOnNamespaces() { var written = false; @@ -52,7 +51,7 @@ public void SourceFiltersWorkOnNamespaces() .ForContext(); log.Write(Some.InformationEvent()); - Assert.IsFalse(written); + Assert.False(written); } } } diff --git a/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs b/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs index 878d94f6f..e5a6ad3e0 100644 --- a/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs +++ b/test/Serilog.Tests/Formatting/Display/MessageTemplateTextFormatterTests.cs @@ -1,53 +1,52 @@ using System.Globalization; using System.IO; -using NUnit.Framework; +using Xunit; using Serilog.Tests.Support; using Serilog.Formatting.Display; namespace Serilog.Tests.Formatting.Display { - [TestFixture] public class MessageTemplateTextFormatterTests { - [Test] + [Fact] public void UsesFormatProvider() { - var french = CultureInfo.GetCultureInfo("fr-FR"); + var french = new CultureInfo("fr-FR"); var formatter = new MessageTemplateTextFormatter("{Message}", french); var evt = DelegatingSink.GetLogEvent(l => l.Information("{0}", 12.345)); var sw = new StringWriter(); formatter.Format(evt, sw); - Assert.AreEqual("12,345", sw.ToString()); + Assert.Equal("12,345", sw.ToString()); } - [Test] + [Fact] public void MessageTemplatesContainingFormatStringPropertiesRenderCorrectly() { var formatter = new MessageTemplateTextFormatter("{Message}", CultureInfo.InvariantCulture); var evt = DelegatingSink.GetLogEvent(l => l.Information("{Message}", "Hello, world!")); var sw = new StringWriter(); formatter.Format(evt, sw); - Assert.AreEqual("\"Hello, world!\"", sw.ToString()); + Assert.Equal("\"Hello, world!\"", sw.ToString()); } - [Test] + [Fact] public void UppercaseFormatSpecifierIsSupportedForStrings() { var formatter = new MessageTemplateTextFormatter("{Name:u}", CultureInfo.InvariantCulture); var evt = DelegatingSink.GetLogEvent(l => l.Information("{Name}", "Nick")); var sw = new StringWriter(); formatter.Format(evt, sw); - Assert.AreEqual("NICK", sw.ToString()); + Assert.Equal("NICK", sw.ToString()); } - [Test] + [Fact] public void LowercaseFormatSpecifierIsSupportedForStrings() { var formatter = new MessageTemplateTextFormatter("{Name:w}", CultureInfo.InvariantCulture); var evt = DelegatingSink.GetLogEvent(l => l.Information("{Name}", "Nick")); var sw = new StringWriter(); formatter.Format(evt, sw); - Assert.AreEqual("nick", sw.ToString()); + Assert.Equal("nick", sw.ToString()); } } } diff --git a/test/Serilog.Tests/Formatting/Json/JsonFormatterTests.cs b/test/Serilog.Tests/Formatting/Json/JsonFormatterTests.cs index 65771eedb..4b5db1646 100644 --- a/test/Serilog.Tests/Formatting/Json/JsonFormatterTests.cs +++ b/test/Serilog.Tests/Formatting/Json/JsonFormatterTests.cs @@ -1,10 +1,9 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Globalization; using System.IO; using System.Linq; -using NUnit.Framework; +using Xunit; using Newtonsoft.Json; using Serilog.Events; using Serilog.Formatting.Json; @@ -13,10 +12,9 @@ namespace Serilog.Tests.Formatting.Json { - [TestFixture] public class JsonFormatterTests { - [Test] + [Fact] public void JsonFormattedEventsIncludeTimestamp() { var @event = new LogEvent( @@ -27,8 +25,8 @@ public void JsonFormattedEventsIncludeTimestamp() new LogEventProperty[0]); var formatted = FormatJson(@event); - - Assert.AreEqual( + + Assert.Equal( "2013-03-11T15:59:00.1230000+10:00", (string)formatted.Timestamp); } @@ -48,7 +46,7 @@ static dynamic FormatJson(LogEvent @event) return serializer.Deserialize(new JsonTextReader(new StringReader(output))); } - [Test] + [Fact] public void AnIntegerPropertySerializesAsIntegerValue() { var name = Some.String(); @@ -58,10 +56,10 @@ public void AnIntegerPropertySerializesAsIntegerValue() var formatted = FormatJson(@event); - Assert.AreEqual(value, (int)formatted.Properties[name]); + Assert.Equal(value, (int)formatted.Properties[name]); } - [Test] + [Fact] public void ABooleanPropertySerializesAsBooleanValue() { var name = Some.String(); @@ -71,10 +69,10 @@ public void ABooleanPropertySerializesAsBooleanValue() var formatted = FormatJson(@event); - Assert.AreEqual(value, (bool)formatted.Properties[name]); + Assert.Equal(value, (bool)formatted.Properties[name]); } - [Test] + [Fact] public void ACharPropertySerializesAsStringValue() { var name = Some.String(); @@ -84,10 +82,10 @@ public void ACharPropertySerializesAsStringValue() var formatted = FormatJson(@event); - Assert.AreEqual(value.ToString(CultureInfo.InvariantCulture), (string)formatted.Properties[name]); + Assert.Equal(value.ToString(), (string)formatted.Properties[name]); } - [Test] + [Fact] public void ADecimalSerializesAsNumericValue() { var name = Some.String(); @@ -97,10 +95,10 @@ public void ADecimalSerializesAsNumericValue() var formatted = FormatJson(@event); - Assert.AreEqual(value, (decimal)formatted.Properties[name]); + Assert.Equal(value, (decimal)formatted.Properties[name]); } - [Test] + [Fact] public void ASequencePropertySerializesAsArrayValue() { var name = Some.String(); @@ -114,10 +112,10 @@ public void ASequencePropertySerializesAsArrayValue() foreach (var el in formatted.Properties[name]) result.Add((int)el); - CollectionAssert.AreEqual(ints, result); + Assert.Equal(ints, result); } - [Test] + [Fact] public void AStructureSerializesAsAnObject() { var value = Some.Int(); @@ -129,10 +127,10 @@ public void AStructureSerializesAsAnObject() var formatted = FormatJson(@event); var result = (int)formatted.Properties[structureProp.Name][memberProp.Name]; - Assert.AreEqual(value, result); + Assert.Equal(value, result); } - [Test] + [Fact] public void ADictionaryWithScalarKeySerializesAsAnObject() { var dictKey = Some.Int(); @@ -146,42 +144,42 @@ public void ADictionaryWithScalarKeySerializesAsAnObject() var formatted = FormatToJson(@event); var expected = string.Format("{{\"{0}\":{1}}}", dictKey, dictValue); - Assert.IsTrue(formatted.Contains(expected)); + Assert.True(formatted.Contains(expected)); } - [Test] + [Fact] public void WellKnownSpecialCharactersAreEscapedAsNormal() { const string s = "\\\"\t\r\n\f"; var escaped = JsonFormatter.Escape(s); - Assert.AreEqual("\\\\\\\"\\t\\r\\n\\f", escaped); + Assert.Equal("\\\\\\\"\\t\\r\\n\\f", escaped); } - [Test] + [Fact] public void StringsWithoutSpecialCharactersAreUnchanged() { const string s = "Hello, world!"; var escaped = JsonFormatter.Escape(s); - Assert.AreSame(s, escaped); + Assert.Same(s, escaped); } - [Test] + [Fact] public void UnprintableCharactersAreEscapedAsUnicodeSequences() { const string s = "\u0001"; var escaped = JsonFormatter.Escape(s); - Assert.AreEqual("\\u0001", escaped); + Assert.Equal("\\u0001", escaped); } - [Test] + [Fact] public void EmbeddedEscapesPreservePrefixAndSuffix() { const string s = "a\nb"; var escaped = JsonFormatter.Escape(s); - Assert.AreEqual("a\\nb", escaped); + Assert.Equal("a\\nb", escaped); } - [Test] + [Fact] public void DictionariesAreSerialisedAsObjects() { var dict = new Dictionary { @@ -192,11 +190,11 @@ public void DictionariesAreSerialisedAsObjects() var e = DelegatingSink.GetLogEvent(l => l.Information("Value is {ADictionary}", dict)); var f = FormatJson(e); - Assert.AreEqual("world", (string)f.Properties.ADictionary["hello"]); - Assert.AreEqual(1.2, (double)f.Properties.ADictionary.nums[0]); + Assert.Equal("world", (string)f.Properties.ADictionary["hello"]); + Assert.Equal(1.2, (double)f.Properties.ADictionary.nums[0]); } - [Test] + [Fact] public void PropertyTokensWithFormatStringsAreIncludedAsRenderings() { var p = new MessageTemplateParser(); @@ -206,12 +204,12 @@ public void PropertyTokensWithFormatStringsAreIncludedAsRenderings() var d = FormatEvent(e); var rs = ((IEnumerable)d.Renderings).Cast().ToArray(); - Assert.AreEqual(1, rs.Count()); + Assert.Equal(1, rs.Count()); var ap = d.Renderings.AProperty; var fs = ((IEnumerable)ap).Cast().ToArray(); - Assert.AreEqual(1, fs.Count()); - Assert.AreEqual("000", (string)fs.Single().Format); - Assert.AreEqual("012", (string)fs.Single().Rendering); + Assert.Equal(1, fs.Count()); + Assert.Equal("000", (string)fs.Single().Format); + Assert.Equal("012", (string)fs.Single().Rendering); } static dynamic FormatEvent(LogEvent e) @@ -225,7 +223,7 @@ static dynamic FormatEvent(LogEvent e) return d; } - [Test] + [Fact] public void PropertyTokensWithoutFormatStringsAreNotIncludedAsRenderings() { var p = new MessageTemplateParser(); @@ -235,10 +233,10 @@ public void PropertyTokensWithoutFormatStringsAreNotIncludedAsRenderings() var d = FormatEvent(e); var rs = ((IEnumerable)d.Renderings); - Assert.IsNull(rs); + Assert.Null(rs); } - [Test] + [Fact] public void SequencesOfSequencesAreSerialized() { var p = new MessageTemplateParser(); @@ -248,7 +246,7 @@ public void SequencesOfSequencesAreSerialized() var d = FormatEvent(e); var h = (string)d.Properties.AProperty[0][0]; - Assert.AreEqual("Hello", h); + Assert.Equal("Hello", h); } } } diff --git a/test/Serilog.Tests/LogTests.cs b/test/Serilog.Tests/LogTests.cs index 0707c448d..c2426f213 100644 --- a/test/Serilog.Tests/LogTests.cs +++ b/test/Serilog.Tests/LogTests.cs @@ -1,15 +1,47 @@ -using NUnit.Framework; +using System; +using Xunit; using Serilog.Core.Pipeline; +using Serilog.Tests.Support; namespace Serilog.Tests { - [TestFixture] public class LogTests { - [Test] + [Fact] public void TheUninitializedLoggerIsSilent() { - Assert.IsInstanceOf(Log.Logger); + Assert.IsType(Log.Logger); + } + + [Fact] + public void DisposesTheLogger() + { + var disposableLogger = new DisposableLogger(); + using (SwappedLogger(disposableLogger)) + { + Log.CloseAndFlush(); + + Assert.True(disposableLogger.Disposed); + } + } + + [Fact] + public void ResetsLoggerToSilentLogger() + { + using (SwappedLogger(new DisposableLogger())) + { + Log.CloseAndFlush(); + + Assert.IsType(Log.Logger); + } + } + + private static IDisposable SwappedLogger(ILogger logger) + { + ILogger originalLogger = Log.Logger; + Log.Logger = logger; + + return new DelegateDisposable(() => Log.Logger = originalLogger); } } } diff --git a/test/Serilog.Tests/LoggerConfigurationTests.cs b/test/Serilog.Tests/LoggerConfigurationTests.cs index 1178436da..5a354457e 100644 --- a/test/Serilog.Tests/LoggerConfigurationTests.cs +++ b/test/Serilog.Tests/LoggerConfigurationTests.cs @@ -2,7 +2,7 @@ using System.IO; using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Core; using Serilog.Core.Filters; using Serilog.Events; @@ -10,14 +10,15 @@ namespace Serilog.Tests { - [TestFixture] public class LoggerConfigurationTests { class DisposableSink : ILogEventSink, IDisposable { - public bool IsDisposed { get; set; } + public bool IsDisposed { get; private set; } - public void Emit(LogEvent logEvent) { } + public void Emit(LogEvent logEvent) + { + } public void Dispose() { @@ -25,7 +26,7 @@ public void Dispose() } } - [Test] + [Fact] public void DisposableSinksAreDisposedAlongWithRootLogger() { var sink = new DisposableSink(); @@ -33,11 +34,11 @@ public void DisposableSinksAreDisposedAlongWithRootLogger() .WriteTo.Sink(sink) .CreateLogger(); - logger.Dispose(); - Assert.IsTrue(sink.IsDisposed); + logger.Dispose(); + Assert.True(sink.IsDisposed); } - [Test] + [Fact] public void DisposableSinksAreNotDisposedAlongWithContextualLoggers() { var sink = new DisposableSink(); @@ -47,10 +48,10 @@ public void DisposableSinksAreNotDisposedAlongWithContextualLoggers() .ForContext(); logger.Dispose(); - Assert.IsFalse(sink.IsDisposed); + Assert.False(sink.IsDisposed); } - [Test] + [Fact] public void AFilterPreventsMatchedEventsFromPassingToTheSink() { var excluded = Some.InformationEvent(); @@ -65,20 +66,25 @@ public void AFilterPreventsMatchedEventsFromPassingToTheSink() .CreateLogger(); logger.Write(included); logger.Write(excluded); - Assert.AreEqual(1, events.Count); - Assert.That(events.Contains(included)); + Assert.Equal(1, events.Count); + Assert.True(events.Contains(included)); } // ReSharper disable UnusedMember.Local, UnusedAutoPropertyAccessor.Local - class AB { public int A { get; set; } public int B { get; set; } } + class AB + { + public int A { get; set; } + public int B { get; set; } + } + // ReSharper restore UnusedAutoPropertyAccessor.Local, UnusedMember.Local - [Test] + [Fact] public void SpecifyingThatATypeIsScalarCausesItToBeLoggedAsScalarEvenWhenDestructuring() { var events = new List(); var sink = new DelegatingSink(events.Add); - + var logger = new LoggerConfiguration() .WriteTo.Sink(sink) .Destructure.AsScalar(typeof(AB)) @@ -88,10 +94,10 @@ public void SpecifyingThatATypeIsScalarCausesItToBeLoggedAsScalarEvenWhenDestruc var ev = events.Single(); var prop = ev.Properties["AB"]; - Assert.IsInstanceOf(prop); + Assert.IsType(prop); } - [Test] + [Fact] public void TransformationsAreAppliedToEventProperties() { var events = new List(); @@ -99,19 +105,22 @@ public void TransformationsAreAppliedToEventProperties() var logger = new LoggerConfiguration() .WriteTo.Sink(sink) - .Destructure.ByTransforming(ab => new { C = ab.B }) + .Destructure.ByTransforming(ab => new + { + C = ab.B + }) .CreateLogger(); logger.Information("{@AB}", new AB()); var ev = events.Single(); var prop = ev.Properties["AB"]; - var sv = (StructureValue)prop; + var sv = (StructureValue) prop; var c = sv.Properties.Single(); - Assert.AreEqual("C", c.Name); + Assert.Equal("C", c.Name); } - [Test] + [Fact] public void WritingToALoggerWritesToSubLogger() { var eventReceived = false; @@ -123,10 +132,10 @@ public void WritingToALoggerWritesToSubLogger() logger.Write(Some.InformationEvent()); - Assert.That(eventReceived); + Assert.True(eventReceived); } - [Test] + [Fact] public void SubLoggerRestrictsFilter() { var eventReceived = false; @@ -139,10 +148,10 @@ public void SubLoggerRestrictsFilter() logger.Write(Some.InformationEvent()); - Assert.That(!eventReceived); + Assert.True(!eventReceived); } - [Test] + [Fact] public void EnrichersExecuteInConfigurationOrder() { var property = Some.LogEventProperty(); @@ -156,13 +165,25 @@ public void EnrichersExecuteInConfigurationOrder() logger.Write(Some.InformationEvent()); - Assert.That(enrichedPropertySeen); + Assert.True(enrichedPropertySeen); } - [Test] + [Fact] public void MaximumDestructuringDepthIsEffective() { - var x = new { A = new { B = new { C = new { D = "F" } } } }; + var x = new + { + A = new + { + B = new + { + C = new + { + D = "F" + } + } + } + }; LogEvent evt = null; var log = new LoggerConfiguration() @@ -173,15 +194,50 @@ public void MaximumDestructuringDepthIsEffective() log.Information("{@X}", x); var xs = evt.Properties["X"].ToString(); - Assert.That(xs, Is.StringContaining("C")); - Assert.That(xs, Is.Not.StringContaining("D")); + Assert.Contains("C", xs); + Assert.DoesNotContain(xs, "D"); + } + + [Fact] + public void DynamicallySwitchingSinkRestrictsOutput() + { + var eventsReceived = 0; + var levelSwitch = new LoggingLevelSwitch(); + + var logger = new LoggerConfiguration() + .WriteTo.Sink( + new DelegatingSink(e => eventsReceived++), + levelSwitch: levelSwitch) + .CreateLogger(); + + logger.Write(Some.InformationEvent()); + levelSwitch.MinimumLevel = LogEventLevel.Warning; + logger.Write(Some.InformationEvent()); + levelSwitch.MinimumLevel = LogEventLevel.Verbose; + logger.Write(Some.InformationEvent()); + + Assert.Equal(2, eventsReceived); + } + + [Fact] + public void LevelSwitchTakesPrecedenceOverMinimumLevel() + { + var sink = new CollectingSink(); + + var logger = new LoggerConfiguration() + .WriteTo.Sink(sink, LogEventLevel.Fatal, new LoggingLevelSwitch()) + .CreateLogger(); + + logger.Write(Some.InformationEvent()); + + Assert.Equal(1, sink.Events.Count); } - [Test] + [Fact] public void AnUnconfiguredLoggerShouldBeTheNullLogger() { var actual = new LoggerConfiguration().CreateLogger(); - Assert.That(actual.GetType().Name, Is.EqualTo("SilentLogger")); + Assert.Equal(actual.GetType().Name, "SilentLogger"); } } -} +} \ No newline at end of file diff --git a/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs b/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs index f719929dd..d567a2421 100644 --- a/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs +++ b/test/Serilog.Tests/Parameters/PropertyValueConverterTests.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Core; using Serilog.Events; using Serilog.Parameters; @@ -10,48 +10,47 @@ namespace Serilog.Tests.Parameters { - [TestFixture] public class PropertyValueConverterTests { readonly PropertyValueConverter _converter = new PropertyValueConverter(10, Enumerable.Empty(), Enumerable.Empty()); - [Test] + [Fact] public void UnderDestructuringAByteArrayIsAScalarValue() { var pv = _converter.CreatePropertyValue(new byte[0], Destructuring.Destructure); - Assert.IsInstanceOf(pv); - Assert.IsInstanceOf(((ScalarValue)pv).Value); + Assert.IsType(pv); + Assert.IsType(((ScalarValue)pv).Value); } - [Test] + [Fact] public void UnderDestructuringABooleanIsAScalarValue() { var pv = _converter.CreatePropertyValue(true, Destructuring.Destructure); - Assert.IsInstanceOf(pv); - Assert.IsInstanceOf(((ScalarValue)pv).Value); + Assert.IsType(pv); + Assert.IsType(((ScalarValue)pv).Value); } - [Test] + [Fact] public void UnderDestructuringAnIntegerArrayIsASequenceValue() { var pv = _converter.CreatePropertyValue(new int[0], Destructuring.Destructure); - Assert.IsInstanceOf(pv); + Assert.IsType(pv); } - [Test] + [Fact] public void ByDefaultADestructuredNullNullableIsAScalarNull() { var pv = _converter.CreatePropertyValue(new int?(), Destructuring.Destructure); - Assert.IsNull(((ScalarValue)pv).Value); + Assert.Null(((ScalarValue)pv).Value); } - [Test] + [Fact] public void ByDefaultADestructuredNonNullNullableIsItsValue() { // ReSharper disable RedundantExplicitNullableCreation var pv = _converter.CreatePropertyValue(new int?(2), Destructuring.Destructure); // ReSharper restore RedundantExplicitNullableCreation - Assert.AreEqual(2, ((ScalarValue)pv).Value); + Assert.Equal(2, ((ScalarValue)pv).Value); } class A @@ -66,14 +65,14 @@ class B // ReSharper restore UnusedAutoPropertyAccessor.Local } - [Test] + [Fact] public void DestructuringACyclicStructureDoesNotStackOverflow() { var ab = new A { B = new B() }; ab.B.A = ab; var pv = _converter.CreatePropertyValue(ab, true); - Assert.IsInstanceOf(pv); + Assert.IsType(pv); } struct C @@ -88,60 +87,60 @@ class D public IList C { get; set; } } - [Test] + [Fact] public void CollectionsAndCustomPoliciesInCyclesDoNotStackOverflow() { var cd = new C { D = new D() }; cd.D.C = new List { cd }; var pv = _converter.CreatePropertyValue(cd, true); - Assert.IsInstanceOf(pv); + Assert.IsType(pv); } - [Test] + [Fact] public void ByDefaultAScalarDictionaryIsADictionaryValue() { var pv = _converter.CreatePropertyValue(new Dictionary { { 1, "hello" } }, Destructuring.Default); - Assert.IsInstanceOf(pv); + Assert.IsType(pv); var dv = (DictionaryValue)pv; - Assert.AreEqual(1, dv.Elements.Count); + Assert.Equal(1, dv.Elements.Count); } - [Test] + [Fact] public void ByDefaultANonScalarDictionaryIsASequenceValue() { var pv = _converter.CreatePropertyValue(new Dictionary { { new A(), "hello" } }, Destructuring.Default); - Assert.IsInstanceOf(pv); + Assert.IsType(pv); var sv = (SequenceValue)pv; - Assert.AreEqual(1, sv.Elements.Count); + Assert.Equal(1, sv.Elements.Count); } - [Test] + [Fact] public void DelegatesAreConvertedToScalarStringsWhenDestructuring() { Action del = DelegatesAreConvertedToScalarStringsWhenDestructuring; var pv = _converter.CreatePropertyValue(del, Destructuring.Destructure); - Assert.IsInstanceOf(pv); - Assert.IsInstanceOf(pv.LiteralValue()); + Assert.IsType(pv); + Assert.IsType(pv.LiteralValue()); } - [Test] + [Fact] public void WhenByteArraysAreConvertedTheyAreCopiedToArrayScalars() { var bytes = Enumerable.Range(0, 10).Select(b => (byte)b).ToArray(); var pv = _converter.CreatePropertyValue(bytes); var lv = (byte[])pv.LiteralValue(); - Assert.AreEqual(bytes.Length, lv.Length); - Assert.AreNotSame(bytes, lv); + Assert.Equal(bytes.Length, lv.Length); + Assert.NotSame(bytes, lv); } - [Test] + [Fact] public void ByteArraysLargerThan1kAreConvertedToStrings() { var bytes = Enumerable.Range(0, 1025).Select(b => (byte)b).ToArray(); var pv = _converter.CreatePropertyValue(bytes); var lv = (string)pv.LiteralValue(); - Assert.That(lv.EndsWith("(1025 bytes)")); + Assert.True(lv.EndsWith("(1025 bytes)")); } public class Thrower @@ -150,23 +149,23 @@ public class Thrower public string Doesnt { get { return "Hello"; } } } - [Test] + [Fact] public void FailsGracefullyWhenGettersThrow() { var pv = _converter.CreatePropertyValue(new Thrower(), Destructuring.Destructure); var sv = (StructureValue)pv; - Assert.AreEqual(2, sv.Properties.Count); + Assert.Equal(2, sv.Properties.Count); var t = sv.Properties.Single(m => m.Name == "Throws"); - Assert.AreEqual("The property accessor threw an exception: NotSupportedException", t.Value.LiteralValue()); + Assert.Equal("The property accessor threw an exception: NotSupportedException", t.Value.LiteralValue()); var d = sv.Properties.Single(m => m.Name == "Doesnt"); - Assert.AreEqual("Hello", d.Value.LiteralValue()); + Assert.Equal("Hello", d.Value.LiteralValue()); } - [Test] + [Fact] public void SurvivesDestructuringASystemType() { var pv = _converter.CreatePropertyValue(typeof(string), Destructuring.Destructure); - Assert.AreEqual(typeof(string), pv.LiteralValue()); + Assert.Equal(typeof(string), pv.LiteralValue()); } public class BaseWithProps @@ -183,7 +182,7 @@ public class DerivedWithOverrides : BaseWithProps public string PropD { get; set; } } - [Test] + [Fact] public void NewAndInheritedPropertiesAppearOnlyOnce() { var valAsDerived = new DerivedWithOverrides @@ -199,9 +198,9 @@ public void NewAndInheritedPropertiesAppearOnlyOnce() var pv = (StructureValue) _converter.CreatePropertyValue(valAsDerived, true); - Assert.AreEqual(4, pv.Properties.Count); - Assert.AreEqual("A", pv.Properties.Single(pp => pp.Name == "PropA").Value.LiteralValue()); - Assert.AreEqual("B", pv.Properties.Single(pp => pp.Name == "PropB").Value.LiteralValue()); + Assert.Equal(4, pv.Properties.Count); + Assert.Equal("A", pv.Properties.Single(pp => pp.Name == "PropA").Value.LiteralValue()); + Assert.Equal("B", pv.Properties.Single(pp => pp.Name == "PropB").Value.LiteralValue()); } class HasIndexer @@ -209,12 +208,12 @@ class HasIndexer public string this[int index] { get { return "Indexer"; } } } - [Test] + [Fact] public void IndexerPropertiesAreIgnoredWhenDestructuring() { var indexed = new HasIndexer(); var pv = (StructureValue)_converter.CreatePropertyValue(indexed, true); - Assert.AreEqual(0, pv.Properties.Count); + Assert.Equal(0, pv.Properties.Count); } // Important because we use "Item" to short cut indexer checking @@ -224,14 +223,14 @@ class HasItem public string Item { get { return "Item"; } } } - [Test] + [Fact] public void ItemPropertiesNotAreIgnoredWhenDestructuring() { var indexed = new HasItem(); var pv = (StructureValue)_converter.CreatePropertyValue(indexed, true); - Assert.AreEqual(1, pv.Properties.Count); + Assert.Equal(1, pv.Properties.Count); var item = pv.Properties.Single(); - Assert.AreEqual("Item", item.Name); + Assert.Equal("Item", item.Name); } } } diff --git a/test/Serilog.Tests/Parsing/MessageTemplateParserTests.cs b/test/Serilog.Tests/Parsing/MessageTemplateParserTests.cs index 0baf6fb42..611e45ad7 100644 --- a/test/Serilog.Tests/Parsing/MessageTemplateParserTests.cs +++ b/test/Serilog.Tests/Parsing/MessageTemplateParserTests.cs @@ -1,10 +1,9 @@ using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Parsing; namespace Serilog.Tests.Parsing { - [TestFixture] public class MessageTemplateParserTests { static MessageTemplateToken[] Parse(string messsageTemplate) @@ -15,77 +14,77 @@ static MessageTemplateToken[] Parse(string messsageTemplate) static void AssertParsedAs(string message, params MessageTemplateToken[] messageTemplateTokens) { var parsed = Parse(message); - CollectionAssert.AreEqual( + Assert.Equal( parsed, messageTemplateTokens); } - [Test] + [Fact] public void AnEmptyMessageIsASingleTextToken() { var t = Parse(""); - Assert.AreEqual(1, t.Length); - Assert.IsInstanceOf(t.Single()); + Assert.Equal(1, t.Length); + Assert.IsType(t.Single()); } - [Test] + [Fact] public void AMessageWithoutPropertiesIsASingleTextToken() { AssertParsedAs("Hello, world!", new TextToken("Hello, world!")); } - [Test] + [Fact] public void AMessageWithPropertyOnlyIsASinglePropertyToken() { AssertParsedAs("{Hello}", new PropertyToken("Hello", "{Hello}")); } - [Test] + [Fact] public void DoubledLeftBracketsAreParsedAsASingleBracket() { AssertParsedAs("{{ Hi! }", new TextToken("{ Hi! }")); } - [Test] + [Fact] public void DoubledLeftBracketsAreParsedAsASingleBracketInsideText() { AssertParsedAs("Well, {{ Hi!", new TextToken("Well, { Hi!")); } - [Test] + [Fact] public void DoubledRightBracketsAreParsedAsASingleBracket() { AssertParsedAs("Nice }}-: mo", new TextToken("Nice }-: mo")); } - [Test] + [Fact] public void AMalformedPropertyTagIsParsedAsText() { AssertParsedAs("{0 space}", new TextToken("{0 space}")); } - [Test] + [Fact] public void AnIntegerPropertyNameIsParsedAsPositionalProperty() { var parsed = (PropertyToken) Parse("{0}").Single(); - Assert.AreEqual("0", parsed.PropertyName); - Assert.IsTrue(parsed.IsPositional); + Assert.Equal("0", parsed.PropertyName); + Assert.True(parsed.IsPositional); } - [Test] + [Fact] public void FormatsCanContainColons() { var parsed = (PropertyToken) Parse("{Time:hh:mm}").Single(); - Assert.AreEqual("hh:mm", parsed.Format); + Assert.Equal("hh:mm", parsed.Format); } - [Test] + [Fact] public void ZeroValuesAlignmentIsParsedAsText() { AssertParsedAs("{Hello,-0}", @@ -95,7 +94,7 @@ public void ZeroValuesAlignmentIsParsedAsText() new TextToken("{Hello,0}")); } - [Test] + [Fact] public void NonNumberAlignmentIsParsedAsText() { AssertParsedAs("{Hello,-aa}", @@ -111,7 +110,7 @@ public void NonNumberAlignmentIsParsedAsText() new TextToken("{Hello,10-1}")); } - [Test] + [Fact] public void EmptyAlignmentIsParsedAsText() { AssertParsedAs("{Hello,}", @@ -121,7 +120,7 @@ public void EmptyAlignmentIsParsedAsText() new TextToken("{Hello,:format}")); } - [Test] + [Fact] public void MultipleTokensHasCorrectIndexes() { AssertParsedAs("{Greeting}, {Name}!", @@ -131,35 +130,35 @@ public void MultipleTokensHasCorrectIndexes() new TextToken("!", 18)); } - [Test] + [Fact] public void MissingRightBracketIsParsedAsText() { AssertParsedAs("{Hello", new TextToken("{Hello")); } - [Test] + [Fact] public void DestructureHintIsParsedCorrectly() { var parsed = (PropertyToken)Parse("{@Hello}").Single(); - Assert.AreEqual(Destructuring.Destructure, parsed.Destructuring); + Assert.Equal(Destructuring.Destructure, parsed.Destructuring); } - [Test] + [Fact] public void StringifyHintIsParsedCorrectly() { var parsed = (PropertyToken)Parse("{$Hello}").Single(); - Assert.AreEqual(Destructuring.Stringify, parsed.Destructuring); + Assert.Equal(Destructuring.Stringify, parsed.Destructuring); } - [Test] + [Fact] public void DestructuringWithEmptyPropertyNameIsParsedAsText() { AssertParsedAs("{@}", new TextToken("{@}")); } - [Test] + [Fact] public void UnderscoresAreValidInPropertyNames() { AssertParsedAs("{_123_Hello}", new PropertyToken("_123_Hello", "{_123_Hello}")); diff --git a/test/Serilog.Tests/Properties/launchSettings.json b/test/Serilog.Tests/Properties/launchSettings.json new file mode 100644 index 000000000..2ab595ba9 --- /dev/null +++ b/test/Serilog.Tests/Properties/launchSettings.json @@ -0,0 +1,11 @@ +{ + "profiles": { + "test": { + "commandName": "test" + }, + "test-dnxcore50": { + "commandName": "test", + "sdkVersion": "dnx-coreclr-win-x86.1.0.0-beta8" + } + } +} \ No newline at end of file diff --git a/test/Serilog.Tests/Serilog.Tests-net40.csproj b/test/Serilog.Tests/Serilog.Tests-net40.csproj deleted file mode 100644 index 706781b98..000000000 --- a/test/Serilog.Tests/Serilog.Tests-net40.csproj +++ /dev/null @@ -1,127 +0,0 @@ - - - - Debug - AnyCPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41} - Library - Properties - Serilog.Tests - Serilog.Tests - v4.0 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - ..\..\ - - - - true - full - false - bin40\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin40\Release\ - TRACE - prompt - 4 - - - true - - - ..\..\assets\Serilog.snk - - - - - ..\..\packages\Newtonsoft.Json.5.0.8\lib\net40\Newtonsoft.Json.dll - - - ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Serilog.snk - - - - - - - - {7a9e1095-167d-402a-b43d-b36b97ff183d} - Serilog.FullNetFx-net40 - - - {0915dbd9-0f7c-4439-8d9e-74c3d579b219} - Serilog-net40 - - - - - - - False - - - False - - - False - - - False - - - - - - - \ No newline at end of file diff --git a/test/Serilog.Tests/Serilog.Tests.csproj b/test/Serilog.Tests/Serilog.Tests.csproj deleted file mode 100644 index 8755bfb53..000000000 --- a/test/Serilog.Tests/Serilog.Tests.csproj +++ /dev/null @@ -1,135 +0,0 @@ - - - - Debug - AnyCPU - {D5648551-D19D-41E3-9FC1-E74B111EEF41} - Library - Properties - Serilog.Tests - Serilog.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - ..\..\ - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - true - - - ..\..\assets\Serilog.snk - - - - - False - ..\..\packages\Newtonsoft.Json.5.0.8\lib\net45\Newtonsoft.Json.dll - - - False - ..\..\packages\NUnit.2.6.3\lib\nunit.framework.dll - - - - - False - ..\..\packages\Rx-Core.2.2.1-beta\lib\net45\System.Reactive.Core.dll - - - False - ..\..\packages\Rx-Interfaces.2.2.1-beta\lib\net45\System.Reactive.Interfaces.dll - - - False - ..\..\packages\Rx-Linq.2.2.1-beta\lib\net45\System.Reactive.Linq.dll - - - False - ..\..\packages\Rx-PlatformServices.2.2.1-beta\lib\net45\System.Reactive.PlatformServices.dll - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {7a9e1095-167d-402a-b43d-b36b97ff183d} - Serilog.FullNetFx - - - {0915DBD9-0F7C-4439-8D9E-74C3D579B219} - Serilog - - - - - Serilog.snk - - - - Designer - - - - - - - \ No newline at end of file diff --git a/test/Serilog.Tests/Serilog.Tests.xproj b/test/Serilog.Tests/Serilog.Tests.xproj new file mode 100644 index 000000000..d98096627 --- /dev/null +++ b/test/Serilog.Tests/Serilog.Tests.xproj @@ -0,0 +1,28 @@ + + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + 3c2d8e01-5580-426a-bdd9-ec59cd98e618 + Serilog.Tests + ..\..\artifacts\obj\$(MSBuildProjectName) + ..\..\artifacts\bin\$(MSBuildProjectName)\ + + + 2.0 + True + + + True + + + True + + + + + + \ No newline at end of file diff --git a/test/Serilog.Tests/Settings/AppSettingsTests.cs b/test/Serilog.Tests/Settings/AppSettingsTests.cs index 3347018ba..35142179c 100644 --- a/test/Serilog.Tests/Settings/AppSettingsTests.cs +++ b/test/Serilog.Tests/Settings/AppSettingsTests.cs @@ -1,18 +1,19 @@ -using System.Configuration; -using NUnit.Framework; +#if !DNXCORE50 +using System; +using System.Configuration; +using Xunit; using Serilog.Events; using Serilog.Tests.Support; -namespace Serilog.Extras.AppSettings.Tests +namespace Serilog.Tests.AppSettings.Tests { - [TestFixture] public class AppSettingsTests { - [Test] + [Fact] public void EnvironmentVariableExpansionIsApplied() { // Make sure we have the expected key in the App.config - Assert.AreEqual("%PATH%", ConfigurationManager.AppSettings["serilog:enrich:with-property:Path"]); + Assert.Equal("%PATH%", ConfigurationManager.AppSettings["serilog:enrich:with-property:Path"]); LogEvent evt = null; var log = new LoggerConfiguration() @@ -22,20 +23,20 @@ public void EnvironmentVariableExpansionIsApplied() log.Information("Has a Path property with value expanded from the environment variable"); - Assert.IsNotNull(evt); - Assert.IsNotNullOrEmpty((string)evt.Properties["Path"].LiteralValue()); - Assert.AreNotEqual("%PATH%", evt.Properties["Path"].LiteralValue()); + Assert.NotNull(evt); + Assert.NotEmpty((string)evt.Properties["Path"].LiteralValue()); + Assert.NotEqual("%PATH%", evt.Properties["Path"].LiteralValue()); } - [Test] + [Fact] public void CanUseCustomPrefixToConfigureSettings() { const string prefix1 = "custom1"; const string prefix2 = "custom2"; // Make sure we have the expected keys in the App.config - Assert.AreEqual("Warning", ConfigurationManager.AppSettings[prefix1 + ":serilog:minimum-level"]); - Assert.AreEqual("Error", ConfigurationManager.AppSettings[prefix2 + ":serilog:minimum-level"]); + Assert.Equal("Warning", ConfigurationManager.AppSettings[prefix1 + ":serilog:minimum-level"]); + Assert.Equal("Error", ConfigurationManager.AppSettings[prefix2 + ":serilog:minimum-level"]); var log1 = new LoggerConfiguration() .WriteTo.Observers(o => { }) @@ -47,11 +48,26 @@ public void CanUseCustomPrefixToConfigureSettings() .ReadFrom.AppSettings(prefix2) .CreateLogger(); - Assert.IsFalse(log1.IsEnabled(LogEventLevel.Information)); - Assert.IsTrue(log1.IsEnabled(LogEventLevel.Warning)); + Assert.False(log1.IsEnabled(LogEventLevel.Information)); + Assert.True(log1.IsEnabled(LogEventLevel.Warning)); - Assert.IsFalse(log2.IsEnabled(LogEventLevel.Warning)); - Assert.IsTrue(log2.IsEnabled(LogEventLevel.Error)); + Assert.False(log2.IsEnabled(LogEventLevel.Warning)); + Assert.True(log2.IsEnabled(LogEventLevel.Error)); + } + + [Fact] + public void CustomPrefixCannotContainColon() + { + Assert.Throws(() => + new LoggerConfiguration().ReadFrom.AppSettings("custom1:custom2")); + } + + [Fact] + public void CustomPrefixCannotBeSerilog() + { + Assert.Throws(() => + new LoggerConfiguration().ReadFrom.AppSettings("serilog")); } } } +#endif diff --git a/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs b/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs index 4e81ea4d8..7731d4d12 100644 --- a/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs +++ b/test/Serilog.Tests/Settings/KeyValuePairSettingsTests.cs @@ -1,83 +1,85 @@ using System.Collections.Generic; using System.Linq; -using NUnit.Framework; +using System.Reflection; +using Xunit; using Serilog.Events; using Serilog.Settings.KeyValuePairs; using Serilog.Sinks.RollingFile; using Serilog.Tests.Support; -namespace Serilog.Extras.AppSettings.Tests +namespace Serilog.Tests.AppSettings.Tests { - [TestFixture] public class KeyValuePairSettingsTests { - [Test] + [Fact] public void ConvertibleValuesConvertToTIfTargetIsNullable() { var result = (int?)KeyValuePairSettings.ConvertToType("3", typeof(int?)); - Assert.That(result == 3); + Assert.True(result == 3); } - [Test] + [Fact] public void NullValuesConvertToNullIfTargetIsNullable() { var result = (int?)KeyValuePairSettings.ConvertToType(null, typeof(int?)); - Assert.That(result == null); + Assert.True(result == null); } - [Test] + [Fact] public void EmptyStringValuesConvertToNullIfTargetIsNullable() { var result = (int?)KeyValuePairSettings.ConvertToType("", typeof(int?)); - Assert.That(result == null); + Assert.True(result == null); } - [Test] + [Fact] public void ValuesConvertToNullableTimeSpan() { var result = (System.TimeSpan?)KeyValuePairSettings.ConvertToType("00:01:00", typeof(System.TimeSpan?)); - Assert.AreEqual(System.TimeSpan.FromMinutes(1), result); + Assert.Equal(System.TimeSpan.FromMinutes(1), result); } - [Test] + [Fact] public void ValuesConvertToEnumMembers() { var result = (LogEventLevel)KeyValuePairSettings.ConvertToType("Information", typeof(LogEventLevel)); - Assert.AreEqual(LogEventLevel.Information, result); + Assert.Equal(LogEventLevel.Information, result); } - [Test] + [Fact] public void FindsConfigurationAssemblies() { - var configurationAssemblies = KeyValuePairSettings.LoadConfigurationAssemblies(new Dictionary - { - {"using:FullNetFx", "Serilog.FullNetFx"} - }).ToList(); + var configurationAssemblies = KeyValuePairSettings.LoadConfigurationAssemblies(new Dictionary()).ToList(); // The core Serilog assembly is always considered - Assert.AreEqual(2, configurationAssemblies.Count); + Assert.Equal(1, configurationAssemblies.Count); } - [Test] + [Fact] public void FindsConfigurationMethodsWithinAnAssembly() { var configurationMethods = KeyValuePairSettings - .FindSinkConfigurationMethods(new[] { typeof(RollingFileSink).Assembly }) + .FindSinkConfigurationMethods(new[] { typeof(RollingFileSink) +#if DNXCORE50 + .GetTypeInfo() +#endif + .Assembly + }) .Select(m => m.Name) .Distinct() .ToList(); - Assert.AreEqual(6, configurationMethods.Count); + Assert.Equal(6, configurationMethods.Count); - Assert.That(configurationMethods.Contains("ColoredConsole")); - Assert.That(configurationMethods.Contains("Console")); - Assert.That(configurationMethods.Contains("DumpFile")); - Assert.That(configurationMethods.Contains("File")); - Assert.That(configurationMethods.Contains("RollingFile")); - Assert.That(configurationMethods.Contains("Trace")); + Assert.True(configurationMethods.Contains("ColoredConsole")); + Assert.True(configurationMethods.Contains("Console")); + Assert.True(configurationMethods.Contains("DumpFile")); + Assert.True(configurationMethods.Contains("File")); + Assert.True(configurationMethods.Contains("RollingFile")); + Assert.True(configurationMethods.Contains("Trace")); } - [Test] + [Fact] public void PropertyEnrichmentIsApplied() { LogEvent evt = null; @@ -91,8 +93,8 @@ public void PropertyEnrichmentIsApplied() log.Information("Has a test property"); - Assert.IsNotNull(evt); - Assert.AreEqual("Test", evt.Properties["App"].LiteralValue()); + Assert.NotNull(evt); + Assert.Equal("Test", evt.Properties["App"].LiteralValue()); } } } diff --git a/test/Serilog.Tests/Sinks/IOFile/FileSinkTests.cs b/test/Serilog.Tests/Sinks/IOFile/FileSinkTests.cs index 7b6c175d8..d66757f72 100644 --- a/test/Serilog.Tests/Sinks/IOFile/FileSinkTests.cs +++ b/test/Serilog.Tests/Sinks/IOFile/FileSinkTests.cs @@ -1,30 +1,29 @@ using System; using System.IO; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Events; using Serilog.Tests.Support; namespace Serilog.Tests.Sinks.IOFile { - [TestFixture] public class FileSinkTests { - [Test] + [Fact] public void FileIsWrittenIfNonexistent() { var path = Some.NonexistentTempFilePath(); TestLoggingAndDelete(path); } - [Test] + [Fact] public void FileIsAppendedToWhenAlreadyCreated() { var path = Some.TempFilePath(); TestLoggingAndDelete(path); } - [Test] + [Fact] public void WhenLimitIsSpecifiedFileSizeIsRestricted() { const int maxBytes = 100; @@ -38,8 +37,8 @@ public void WhenLimitIsSpecifiedFileSizeIsRestricted() { log.Information(new string('n', maxBytes + 1)); var size = new FileInfo(path).Length; - Assert.That(size > 0); - Assert.That(size < maxBytes); + Assert.True(size > 0); + Assert.True(size < maxBytes); }); } @@ -65,7 +64,7 @@ static void TestLoggingAndDelete(string path) var content = new StreamReader(refile).ReadToEnd(); refile.Dispose(); - Assert.That(content.Contains(message.Text)); + Assert.True(content.Contains(message.Text)); }); } diff --git a/test/Serilog.Tests/Sinks/Observable/ObservableSinkTests.cs b/test/Serilog.Tests/Sinks/Observable/ObservableSinkTests.cs index 89309e457..3ad137905 100644 --- a/test/Serilog.Tests/Sinks/Observable/ObservableSinkTests.cs +++ b/test/Serilog.Tests/Sinks/Observable/ObservableSinkTests.cs @@ -1,14 +1,13 @@ using System; using System.Reactive.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Tests.Support; namespace Serilog.Tests.Sinks.Observable { - [TestFixture] public class ObservableSinkTests { - [Test] + [Fact] public void EventsAreWrittenToObservers() { var eventSeen = false; @@ -20,7 +19,7 @@ public void EventsAreWrittenToObservers() .CreateLogger(); log.Write(Some.InformationEvent()); - Assert.That(eventSeen); + Assert.True(eventSeen); } } } diff --git a/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs b/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs index 0c5f73108..9d83ccb65 100644 --- a/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs +++ b/test/Serilog.Tests/Sinks/PeriodicBatching/BatchedConnectionStatusTests.cs @@ -1,60 +1,60 @@ -using System; -using NUnit.Framework; +#if !DNXCORE50 +using System; +using Xunit; using Serilog.Sinks.PeriodicBatching; namespace Serilog.Tests.Sinks.PeriodicBatching { - [TestFixture] public class BatchedConnectionStatusTests { readonly TimeSpan DefaultPeriod = TimeSpan.FromSeconds(2); - [Test] + [Fact] public void WhenNoFailuresHaveOccurredTheRegularIntervalIsUsed() { var bcs = new BatchedConnectionStatus(DefaultPeriod); - Assert.AreEqual(DefaultPeriod, bcs.NextInterval); + Assert.Equal(DefaultPeriod, bcs.NextInterval); } - [Test] + [Fact] public void WhenOneFailureHasOccurredTheRegularIntervalIsUsed() { var bcs = new BatchedConnectionStatus(DefaultPeriod); bcs.MarkFailure(); - Assert.AreEqual(DefaultPeriod, bcs.NextInterval); + Assert.Equal(DefaultPeriod, bcs.NextInterval); } - [Test] + [Fact] public void WhenTwoFailuresHaveOccurredTheIntervalBacksOff() { var bcs = new BatchedConnectionStatus(DefaultPeriod); bcs.MarkFailure(); bcs.MarkFailure(); - Assert.AreEqual(TimeSpan.FromSeconds(10), bcs.NextInterval); + Assert.Equal(TimeSpan.FromSeconds(10), bcs.NextInterval); } - [Test] + [Fact] public void WhenABatchSucceedsTheStatusResets() { var bcs = new BatchedConnectionStatus(DefaultPeriod); bcs.MarkFailure(); bcs.MarkFailure(); bcs.MarkSuccess(); - Assert.AreEqual(DefaultPeriod, bcs.NextInterval); + Assert.Equal(DefaultPeriod, bcs.NextInterval); } - [Test] + [Fact] public void WhenThreeFailuresHaveOccurredTheIntervalBacksOff() { var bcs = new BatchedConnectionStatus(DefaultPeriod); bcs.MarkFailure(); bcs.MarkFailure(); bcs.MarkFailure(); - Assert.AreEqual(TimeSpan.FromSeconds(20), bcs.NextInterval); - Assert.IsFalse(bcs.ShouldDropBatch); + Assert.Equal(TimeSpan.FromSeconds(20), bcs.NextInterval); + Assert.False(bcs.ShouldDropBatch); } - [Test] + [Fact] public void WhenFourFailuresHaveOccurredTheIntervalBacksOffAndBatchIsDropped() { var bcs = new BatchedConnectionStatus(DefaultPeriod); @@ -62,18 +62,19 @@ public void WhenFourFailuresHaveOccurredTheIntervalBacksOffAndBatchIsDropped() bcs.MarkFailure(); bcs.MarkFailure(); bcs.MarkFailure(); - Assert.AreEqual(TimeSpan.FromSeconds(40), bcs.NextInterval); - Assert.That(bcs.ShouldDropBatch); - Assert.IsFalse(bcs.ShouldDropQueue); + Assert.Equal(TimeSpan.FromSeconds(40), bcs.NextInterval); + Assert.True(bcs.ShouldDropBatch); + Assert.False(bcs.ShouldDropQueue); } - [Test] + [Fact] public void WhenSixFailuresHaveOccurredTheQueueIsDropped() { var bcs = new BatchedConnectionStatus(DefaultPeriod); for (var i = 0; i < 6; ++i ) bcs.MarkFailure(); - Assert.That(bcs.ShouldDropQueue); + Assert.True(bcs.ShouldDropQueue); } } } +#endif diff --git a/test/Serilog.Tests/Sinks/PeriodicBatching/PeriodicBatchingSinkTests.cs b/test/Serilog.Tests/Sinks/PeriodicBatching/PeriodicBatchingSinkTests.cs index 986b82553..1fbb6bc64 100644 --- a/test/Serilog.Tests/Sinks/PeriodicBatching/PeriodicBatchingSinkTests.cs +++ b/test/Serilog.Tests/Sinks/PeriodicBatching/PeriodicBatchingSinkTests.cs @@ -2,7 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using NUnit.Framework; +using System.Threading.Tasks; +using Xunit; using Serilog.Events; using Serilog.Sinks.PeriodicBatching; using Serilog.Tests.Support; @@ -18,9 +19,10 @@ class InMemoryPeriodicBatchingSink : PeriodicBatchingSink // Post-mortem only public bool WasCalledAfterDisposal { get; private set; } - public IList> Batches { get; private set; } - - public InMemoryPeriodicBatchingSink(int batchSizeLimit, TimeSpan period, TimeSpan batchEmitDelay) : base(batchSizeLimit, period) + public IList> Batches { get; } + + public InMemoryPeriodicBatchingSink(int batchSizeLimit, TimeSpan period, TimeSpan batchEmitDelay) + : base(batchSizeLimit, period) { _batchEmitDelay = batchEmitDelay; Batches = new List>(); @@ -56,28 +58,27 @@ protected override void Dispose(bool disposing) } } - [TestFixture] public class PeriodicBatchingSinkTests { - static readonly TimeSpan TinyWait = TimeSpan.FromMilliseconds(50); + static readonly TimeSpan TinyWait = TimeSpan.FromMilliseconds(200); static readonly TimeSpan MicroWait = TimeSpan.FromMilliseconds(1); // Some very, very approximate tests here :) - [Test] + [Fact] public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnFlush() { var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero); var evt = Some.InformationEvent(); pbs.Emit(evt); pbs.Dispose(); - Assert.AreEqual(1, pbs.Batches.Count); - Assert.AreEqual(1, pbs.Batches[0].Count); - Assert.AreSame(evt, pbs.Batches[0][0]); - Assert.IsFalse(pbs.WasCalledAfterDisposal); + Assert.Equal(1, pbs.Batches.Count); + Assert.Equal(1, pbs.Batches[0].Count); + Assert.Same(evt, pbs.Batches[0][0]); + Assert.False(pbs.WasCalledAfterDisposal); } - [Test] + [Fact] public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnTimer() { var pbs = new InMemoryPeriodicBatchingSink(2, TinyWait, TimeSpan.Zero); @@ -85,11 +86,11 @@ public void WhenAnEventIsEnqueuedItIsWrittenToABatch_OnTimer() pbs.Emit(evt); Thread.Sleep(TinyWait + TinyWait); pbs.Stop(); - Assert.AreEqual(1, pbs.Batches.Count); - Assert.IsFalse(pbs.WasCalledAfterDisposal); + Assert.Equal(1, pbs.Batches.Count); + Assert.False(pbs.WasCalledAfterDisposal); } - [Test] + [Fact] public void WhenAnEventIsEnqueuedItIsWrittenToABatch_FlushWhileRunning() { var pbs = new InMemoryPeriodicBatchingSink(2, MicroWait, TinyWait + TinyWait); @@ -97,8 +98,8 @@ public void WhenAnEventIsEnqueuedItIsWrittenToABatch_FlushWhileRunning() pbs.Emit(evt); Thread.Sleep(TinyWait); pbs.Dispose(); - Assert.AreEqual(1, pbs.Batches.Count); - Assert.IsFalse(pbs.WasCalledAfterDisposal); + Assert.Equal(1, pbs.Batches.Count); + Assert.False(pbs.WasCalledAfterDisposal); } } } diff --git a/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs b/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs index d362f05b7..73a82b463 100644 --- a/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs +++ b/test/Serilog.Tests/Sinks/RollingFile/RollingFileSinkTests.cs @@ -1,23 +1,22 @@ using System; using System.Collections.Generic; using System.IO; -using NUnit.Framework; +using Xunit; using Serilog.Events; using Serilog.Sinks.RollingFile; using Serilog.Tests.Support; namespace Serilog.Tests.Sinks.RollingFile { - [TestFixture] public class RollingFileSinkTests { - [Test] + [Fact] public void LogEventsAreEmittedToTheFileNamedAccordingToTheEventTimestamp() { TestRollingEventSequence(Some.InformationEvent()); } - [Test] + [Fact] public void WhenTheDateChangesTheCorrectFileIsWritten() { var e1 = Some.InformationEvent(); @@ -25,7 +24,7 @@ public void WhenTheDateChangesTheCorrectFileIsWritten() TestRollingEventSequence(e1, e2); } - [Test] + [Fact] public void WhenRetentionCountIsSetOldFilesAreDeleted() { LogEvent e1 = Some.InformationEvent(), @@ -35,14 +34,14 @@ public void WhenRetentionCountIsSetOldFilesAreDeleted() TestRollingEventSequence(new[] { e1, e2, e3 }, 2, files => { - Assert.AreEqual(3, files.Count); - Assert.That(!File.Exists(files[0])); - Assert.That(File.Exists(files[1])); - Assert.That(File.Exists(files[2])); + Assert.Equal(3, files.Count); + Assert.True(!File.Exists(files[0])); + Assert.True(File.Exists(files[1])); + Assert.True(File.Exists(files[2])); }); } - [Test] + [Fact] public void IfTheLogFolderDoesNotExistItWillBeCreated() { var fileName = Some.String() + "-{Date}.txt"; @@ -60,7 +59,7 @@ public void IfTheLogFolderDoesNotExistItWillBeCreated() log.Write(Some.InformationEvent()); - Assert.That(Directory.Exists(folder)); + Assert.True(Directory.Exists(folder)); } finally { @@ -98,7 +97,7 @@ static void TestRollingEventSequence( log.Write(@event); var expected = pathFormat.Replace("{Date}", @event.Timestamp.ToString("yyyyMMdd")); - Assert.That(File.Exists(expected)); + Assert.True(File.Exists(expected)); verified.Add(expected); } diff --git a/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs b/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs index d43ca13fb..48b53ce06 100644 --- a/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs +++ b/test/Serilog.Tests/Sinks/RollingFile/TemplatedPathRollerTests.cs @@ -1,129 +1,128 @@ using System; using System.IO; using System.Linq; -using NUnit.Framework; +using Xunit; using Serilog.Sinks.RollingFile; namespace Serilog.Tests.Sinks.RollingFile { - [TestFixture] public class TemplatedPathRollerTests { - [Test] + [Fact] public void WhenOldStyleSpecifierIsSuppliedTheExceptionIsInformative() { var ex = Assert.Throws(() => new TemplatedPathRoller("log-{0}.txt")); - Assert.That(ex.Message.Contains("{Date}")); + Assert.True(ex.Message.Contains("{Date}")); } - [Test] + [Fact] public void NewStyleSpecifierCannotBeProvidedInDirectory() { var ex = Assert.Throws(() => new TemplatedPathRoller("{Date}\\log.txt")); - Assert.That(ex.Message.Contains("directory")); + Assert.True(ex.Message.Contains("directory")); } - [Test] + [Fact] public void TheLogFileIncludesDateToken() { var roller = new TemplatedPathRoller("Logs\\log.{Date}.txt"); var now = new DateTime(2013, 7, 14, 3, 24, 9, 980); string path; roller.GetLogFilePath(now, 0, out path); - AssertAreEqualAbsolute("Logs\\log.20130714.txt", path); + AssertEqualAbsolute("Logs\\log.20130714.txt", path); } - [Test] + [Fact] public void ANonZeroIncrementIsIncludedAndPadded() { var roller = new TemplatedPathRoller("Logs\\log.{Date}.txt"); var now = new DateTime(2013, 7, 14, 3, 24, 9, 980); string path; roller.GetLogFilePath(now, 12, out path); - AssertAreEqualAbsolute("Logs\\log.20130714_012.txt", path); + AssertEqualAbsolute("Logs\\log.20130714_012.txt", path); } - static void AssertAreEqualAbsolute(string path1, string path2) + static void AssertEqualAbsolute(string path1, string path2) { var abs1 = Path.GetFullPath(path1); var abs2 = Path.GetFullPath(path2); - Assert.AreEqual(abs1, abs2); + Assert.Equal(abs1, abs2); } - [Test] + [Fact] public void TheRollerReturnsTheLogFileDirectory() { var roller = new TemplatedPathRoller("Logs\\log.{Date}.txt"); - AssertAreEqualAbsolute("Logs", roller.LogFileDirectory); + AssertEqualAbsolute("Logs", roller.LogFileDirectory); } - [Test] + [Fact] public void IfNoTokenIsSpecifiedDashFollowedByTheDateIsImplied() { var roller = new TemplatedPathRoller("Logs\\log.txt"); var now = new DateTime(2013, 7, 14, 3, 24, 9, 980); string path; roller.GetLogFilePath(now, 0, out path); - AssertAreEqualAbsolute("Logs\\log-20130714.txt", path); + AssertEqualAbsolute("Logs\\log-20130714.txt", path); } - [Test] + [Fact] public void TheLogFileIsNotRequiredToIncludeAnExtension() { var roller = new TemplatedPathRoller("Logs\\log-{Date}"); var now = new DateTime(2013, 7, 14, 3, 24, 9, 980); string path; roller.GetLogFilePath(now, 0, out path); - AssertAreEqualAbsolute("Logs\\log-20130714", path); + AssertEqualAbsolute("Logs\\log-20130714", path); } - [Test] + [Fact] public void TheLogFileIsNotRequiredToIncludeADirectory() { var roller = new TemplatedPathRoller("log-{Date}"); var now = new DateTime(2013, 7, 14, 3, 24, 9, 980); string path; roller.GetLogFilePath(now, 0, out path); - AssertAreEqualAbsolute("log-20130714", path); + AssertEqualAbsolute("log-20130714", path); } - [Test] + [Fact] public void TheDirectorSearchPatternUsesWildcardInPlaceOfDate() { var roller = new TemplatedPathRoller("Logs\\log-{Date}.txt"); - Assert.AreEqual("log-*.txt", roller.DirectorySearchPattern); + Assert.Equal("log-*.txt", roller.DirectorySearchPattern); } - [Test] + [Fact] public void MatchingSelectsFiles() { var roller = new TemplatedPathRoller("log-{Date}.txt"); const string example1 = "log-20131210.txt"; const string example2 = "log-20131210_031.txt"; var matched = roller.SelectMatches(new[] { example1, example2 }).ToArray(); - Assert.AreEqual(2, matched.Count()); - Assert.AreEqual(0, matched[0].SequenceNumber); - Assert.AreEqual(31, matched[1].SequenceNumber); + Assert.Equal(2, matched.Count()); + Assert.Equal(0, matched[0].SequenceNumber); + Assert.Equal(31, matched[1].SequenceNumber); } - [Test] + [Fact] public void MatchingExcludesSimilarButNonmatchingFiles() { var roller = new TemplatedPathRoller("log-{Date}.txt"); const string similar1 = "log-0.txt"; const string similar2 = "log-helloyou.txt"; var matched = roller.SelectMatches(new[] { similar1, similar2 }); - Assert.AreEqual(0, matched.Count()); + Assert.Equal(0, matched.Count()); } - [Test] + [Fact] public void MatchingParsesDates() { var roller = new TemplatedPathRoller("log-{Date}.txt"); const string newer = "log-20150101.txt"; const string older = "log-20141231.txt"; var matched = roller.SelectMatches(new[] { older, newer }).OrderByDescending(m => m.Date).Select(m => m.Filename).ToArray(); - CollectionAssert.AreEqual(new[] { newer, older }, matched); + Assert.Equal(new[] { newer, older }, matched); } } } diff --git a/test/Serilog.Tests/Sinks/TextWriter/TextWriterSinkTests.cs b/test/Serilog.Tests/Sinks/TextWriter/TextWriterSinkTests.cs index 0fe4adaf9..9a5b0d475 100644 --- a/test/Serilog.Tests/Sinks/TextWriter/TextWriterSinkTests.cs +++ b/test/Serilog.Tests/Sinks/TextWriter/TextWriterSinkTests.cs @@ -1,15 +1,14 @@ using System; using System.Globalization; using System.IO; -using NUnit.Framework; +using Xunit; using Serilog.Tests.Support; namespace Serilog.Tests.Sinks.TextWriter { - [TestFixture] public class TextWriterSinkTests { - [Test] + [Fact] public void EventsAreWrittenToTheTextWriter() { var sw = new StringWriter(); @@ -22,15 +21,15 @@ public void EventsAreWrittenToTheTextWriter() log.Information(mt); var s = sw.ToString(); - Assert.That(s.Contains(mt)); + Assert.True(s.Contains(mt)); } - [Test] + [Fact] public void EventsAreWrittenToTheTextWriterUsingFormatProvider() { var sw = new StringWriter(); - var french = CultureInfo.GetCultureInfo("fr-FR"); + var french = new CultureInfo("fr-FR"); var log = new LoggerConfiguration() .WriteTo.TextWriter(sw, formatProvider: french) .CreateLogger(); @@ -39,7 +38,7 @@ public void EventsAreWrittenToTheTextWriterUsingFormatProvider() log.Information("{0}", 12.345); var s = sw.ToString(); - Assert.That(s.Contains(mt)); + Assert.True(s.Contains(mt)); } } } diff --git a/test/Serilog.Tests/Support/DelegateDisposable.cs b/test/Serilog.Tests/Support/DelegateDisposable.cs new file mode 100644 index 000000000..fbafd3820 --- /dev/null +++ b/test/Serilog.Tests/Support/DelegateDisposable.cs @@ -0,0 +1,24 @@ +using System; + +namespace Serilog.Tests.Support +{ + public class DelegateDisposable : IDisposable + { + private readonly Action _disposeAction; + private bool _disposed; + + public DelegateDisposable(Action disposeAction) + { + _disposeAction = disposeAction; + } + + public void Dispose() + { + if (_disposed) + return; + + _disposeAction(); + _disposed = true; + } + } +} \ No newline at end of file diff --git a/test/Serilog.Tests/Support/DelegatingEnricher.cs b/test/Serilog.Tests/Support/DelegatingEnricher.cs index 840e21db7..1d49f3136 100644 --- a/test/Serilog.Tests/Support/DelegatingEnricher.cs +++ b/test/Serilog.Tests/Support/DelegatingEnricher.cs @@ -10,7 +10,7 @@ class DelegatingEnricher : ILogEventEnricher public DelegatingEnricher(Action enrich) { - if (enrich == null) throw new ArgumentNullException("enrich"); + if (enrich == null) throw new ArgumentNullException(nameof(enrich)); _enrich = enrich; } diff --git a/test/Serilog.Tests/Support/DelegatingSink.cs b/test/Serilog.Tests/Support/DelegatingSink.cs index 4306d5cc7..e19ee7895 100644 --- a/test/Serilog.Tests/Support/DelegatingSink.cs +++ b/test/Serilog.Tests/Support/DelegatingSink.cs @@ -10,7 +10,7 @@ public class DelegatingSink : ILogEventSink public DelegatingSink(Action write) { - if (write == null) throw new ArgumentNullException("write"); + if (write == null) throw new ArgumentNullException(nameof(write)); _write = write; } diff --git a/test/Serilog.Tests/Support/DisposableLogger.cs b/test/Serilog.Tests/Support/DisposableLogger.cs new file mode 100644 index 000000000..61d682a4e --- /dev/null +++ b/test/Serilog.Tests/Support/DisposableLogger.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; +using Serilog.Core; +using Serilog.Events; + +namespace Serilog.Tests.Support +{ + public class DisposableLogger : ILogger, IDisposable + { + public bool Disposed { get; set; } + + public void Dispose() + { + Disposed = true; + } + + public ILogger ForContext(IEnumerable enrichers) + { + throw new NotImplementedException(); + } + + public ILogger ForContext(string propertyName, object value, bool destructureObjects = false) + { + throw new NotImplementedException(); + } + + public ILogger ForContext() + { + throw new NotImplementedException(); + } + + public ILogger ForContext(Type source) + { + throw new NotImplementedException(); + } + + public void Write(LogEvent logEvent) + { + throw new NotImplementedException(); + } + + public void Write(LogEventLevel level, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Write(LogEventLevel level, Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public bool IsEnabled(LogEventLevel level) + { + throw new NotImplementedException(); + } + + public void Verbose(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Verbose(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Debug(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Debug(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Information(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Information(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Warning(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Warning(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Error(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Error(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Fatal(string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + + public void Fatal(Exception exception, string messageTemplate, params object[] propertyValues) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/test/Serilog.Tests/app.config b/test/Serilog.Tests/app.config index 93fb1ab99..346514b7e 100644 --- a/test/Serilog.Tests/app.config +++ b/test/Serilog.Tests/app.config @@ -2,24 +2,7 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Serilog.Tests/packages.config b/test/Serilog.Tests/packages.config deleted file mode 100644 index c644c58fc..000000000 --- a/test/Serilog.Tests/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/test/Serilog.Tests/project.json b/test/Serilog.Tests/project.json new file mode 100644 index 000000000..a55febea8 --- /dev/null +++ b/test/Serilog.Tests/project.json @@ -0,0 +1,69 @@ +{ + "version": "2.0.0-beta-*", + "commands": { + "test": "xunit.runner.dnx", + "test-dnxcore50": "xunit.runner.dnx" + }, + "dependencies": { + "Newtonsoft.Json": "7.0.1", + "Rx-Main": "2.2.5", + "Serilog": "2.0.0-beta-*", + "xunit": "2.1.0", + "xunit.runner.visualstudio": "2.1.0" + }, + "frameworks": { + "net45": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk" + }, + "frameworkAssemblies": { + "System.Configuration": "", + "Microsoft.CSharp": "", + "System.Collections": "", + "System.Diagnostics.Debug": "", + "System.Dynamic.Runtime": "", + "System.Globalization": "", + "System.IO": "", + "System.Linq": "", + "System.Reflection": "", + "System.Reflection.Extensions": "", + "System.Runtime": "", + "System.Runtime.Extensions": "", + "System.Text.RegularExpressions": "", + "System.Threading": "", + "System.Threading.Tasks": "" + } + }, + "dnx451": { + "compilationOptions": { + "keyFile": "../../assets/Serilog.snk" + }, + "frameworkAssemblies": { + "System.Configuration": "" + }, + "dependencies": { + "xunit.runner.dnx": "2.1.0-beta5-build169" + } + }, + "dnxcore50": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.0.0", + "Microsoft.NETCore": "5.0.0", + "Microsoft.CSharp": "4.0.1-beta-23225", + "System.Collections": "4.0.11-beta-23225", + "System.Console": "4.0.0-beta-23225", + "System.Diagnostics.Process": "4.0.0-beta-23225", + "System.Diagnostics.TraceSource": "4.0.0-beta-23109", + "System.IO.FileSystem": "4.0.1-beta-23225", + "System.Linq": "4.0.1-beta-23225", + "System.Runtime": "4.0.21-beta-23409", + "System.Runtime.Extensions": "4.0.11-beta-23225", + "System.Text.RegularExpressions": "4.0.11-beta-23225", + "System.Threading": "4.0.11-beta-23225", + "System.Threading.Thread": "4.0.0-beta-23225", + "System.Threading.Timer": "4.0.1-beta-23225", + "xunit.runner.dnx": "2.1.0-beta5-build169" + } + } + } +}