Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinmoris committed Nov 12, 2018
2 parents 2946006 + 70fded8 commit 57e2ef0
Show file tree
Hide file tree
Showing 22 changed files with 167 additions and 133 deletions.
91 changes: 54 additions & 37 deletions .psscripts/build-functions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ function Test-IsWindows
[environment]::OSVersion.Platform -ne "Unix"
}

function Test-IsMonoInstalled
{
<#
.DESCRIPTION
Checks to see whether the current environment has the Mono framework installed.
.EXAMPLE
if (Test-IsMonoInstalled) { Write-Host "Mono is available." }
#>

$result = Invoke-Cmd "mono --version" -Silent
return $result.StartsWith("Mono JIT compiler version")
}

function Get-UbuntuVersion
{
<#
Expand All @@ -25,11 +39,13 @@ function Get-UbuntuVersion
$ubuntuVersion = Get-UbuntuVersion
#>

$version = Invoke-Cmd "lsb_release -r -s"
$version = Invoke-Cmd "lsb_release -r -s" -Silent
return $version
}

function Invoke-UnsafeCmd ($cmd)
function Invoke-UnsafeCmd (
[string] $Cmd,
[switch] $Silent)
{
<#
.DESCRIPTION
Expand All @@ -45,12 +61,14 @@ function Invoke-UnsafeCmd ($cmd)
Use this PowerShell command to execute any CLI commands which might not exit with 0 on a success.
#>

Write-Host $cmd -ForegroundColor DarkCyan
if (!($Silent.IsPresent)) { Write-Host $cmd -ForegroundColor DarkCyan }
if (Test-IsWindows) { $cmd = "cmd.exe /C $cmd" }
Invoke-Expression -Command $cmd
}

function Invoke-Cmd ($Cmd)
function Invoke-Cmd (
[string] $Cmd,
[switch] $Silent)
{
<#
.DESCRIPTION
Expand All @@ -66,7 +84,7 @@ function Invoke-Cmd ($Cmd)
Use this PowerShell command to execute any dotnet CLI commands in order to ensure that they behave the same way in the case of an error across different environments (Windows, OSX and Linux).
#>

Invoke-UnsafeCmd $cmd
if ($Silent.IsPresent) { Invoke-UnsafeCmd $cmd -Silent } else { Invoke-UnsafeCmd $cmd }
if ($LastExitCode -ne 0) { Write-Error "An error occured when executing '$Cmd'."; return }
}

Expand Down Expand Up @@ -131,30 +149,6 @@ function Test-CompareVersions ($version, [string]$gitTag)
# .NET Core functions
# ----------------------------------------------

function dotnet-info { Invoke-Cmd "dotnet --info" }
function dotnet-version { Invoke-Cmd "dotnet --version" }
function dotnet-restore ($project, $argv) { Invoke-Cmd "dotnet restore $project $argv" }
function dotnet-build ($project, $argv) { Invoke-Cmd "dotnet build $project $argv" }
function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" }
function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" }
function dotnet-publish ($project, $argv) { Invoke-Cmd "dotnet publish $project $argv" }

function Get-DotNetRuntimeVersion
{
<#
.DESCRIPTION
Runs the dotnet --info command and extracts the .NET Core Runtime version number.
.NOTES
The .NET Core Runtime version can sometimes be useful for other dotnet CLI commands (e.g. dotnet xunit -fxversion ".NET Core Runtime version").
#>

$info = dotnet-info
[System.Array]::Reverse($info)
$version = $info | Where-Object { $_.Contains("Version") } | Select-Object -First 1
$version.Split(":")[1].Trim()
}

function Get-TargetFrameworks ($projFile)
{
<#
Expand Down Expand Up @@ -198,20 +192,43 @@ function Get-NetCoreTargetFramework ($projFile)
Get-TargetFrameworks $projFile | Where-Object { $_ -like "netstandard*" -or $_ -like "netcoreapp*" }
}

function dotnet-test ($project, $argv)
function Invoke-DotNetCli ($cmd, $proj, $argv)
{
# Currently dotnet test does not work for net461 on Linux/Mac
# See: https://github.com/Microsoft/vstest/issues/1318
#
# Previously dotnet-xunit was a working alternative, however
# after issues with the maintenance of dotnet xunit it has been
# discontinued since xunit 2.4: https://xunit.github.io/releases/2.4
if(!(Test-IsWindows))

if((!(Test-IsWindows) -and !(Test-IsMonoInstalled)) `
-or (!(Test-IsWindows) -and ($cmd -eq "test")))
{
$fw = Get-NetCoreTargetFramework $project;
$fw = Get-NetCoreTargetFramework($proj)
$argv = "-f $fw " + $argv
}
Invoke-Cmd "dotnet test $project $argv"
Invoke-Cmd "dotnet $cmd $proj $argv"
}

function dotnet-info { Invoke-Cmd "dotnet --info" -Silent }
function dotnet-version { Invoke-Cmd "dotnet --version" -Silent }
function dotnet-restore ($project, $argv) { Invoke-Cmd "dotnet restore $project $argv" }
function dotnet-build ($project, $argv) { Invoke-DotNetCli -Cmd "build" -Proj $project -Argv $argv }
function dotnet-test ($project, $argv) { Invoke-DotNetCli -Cmd "test" -Proj $project -Argv $argv }
function dotnet-run ($project, $argv) { Invoke-Cmd "dotnet run --project $project $argv" }
function dotnet-pack ($project, $argv) { Invoke-Cmd "dotnet pack $project $argv" }
function dotnet-publish ($project, $argv) { Invoke-Cmd "dotnet publish $project $argv" }

function Get-DotNetRuntimeVersion
{
<#
.DESCRIPTION
Runs the dotnet --info command and extracts the .NET Core Runtime version number.
.NOTES
The .NET Core Runtime version can sometimes be useful for other dotnet CLI commands (e.g. dotnet xunit -fxversion ".NET Core Runtime version").
#>

$info = dotnet-info
[System.Array]::Reverse($info)
$version = $info | Where-Object { $_.Contains("Version") } | Select-Object -First 1
$version.Split(":")[1].Trim()
}

function Write-DotnetCoreVersions
Expand Down
6 changes: 6 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Release Notes
=============

## 0.20.0

- Added shebang and fixed shellcheck warnings
- Updated Giraffe to version 3.4.x
- Updated TestHost to version 2.1.x for test projects

## 0.19.0

- Updated Giraffe to version 3.2.x
Expand Down
6 changes: 5 additions & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ if ($UpdatePaketDependencies.IsPresent -or $TestPermutations.IsPresent -or $Crea
Write-Host "Uninstalling existing Giraffe template..." -ForegroundColor Magenta
$giraffeInstallation = Invoke-UnsafeCmd "dotnet new giraffe --list"
$giraffeInstallation
if ($giraffeInstallation.Length -lt 6) { Invoke-Cmd "dotnet new -u giraffe-template" }
if ($giraffeInstallation[$giraffeInstallation.Length - 2].StartsWith("Giraffe Web App"))
{
Invoke-Cmd "dotnet new -u giraffe-template"
}
# if ($giraffeInstallation.Length -lt 6) { Invoke-Cmd "dotnet new -u giraffe-template" }

$nupkg = Get-ChildItem "./giraffe-template.$version.nupkg"
$nupkgPath = $nupkg.FullName
Expand Down
6 changes: 4 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
export FrameworkPathOverride=$(dirname $(which mono))/../lib/mono/4.5/
pwsh ./build.ps1
#!/bin/sh
FrameworkPathOverride=$(dirname "$(which mono)")/../lib/mono/4.5/
export FrameworkPathOverride
pwsh ./build.ps1
34 changes: 17 additions & 17 deletions src/content/DotLiquid/paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ NUGET
remote: https://api.nuget.org/v3/index.json
DotLiquid (2.0.298) - restriction: || (>= net461) (>= netstandard2.0)
FSharp.Core (4.5.2) - restriction: || (>= net461) (>= netstandard2.0)
Giraffe (3.2)
Giraffe (3.4)
FSharp.Core (>= 4.5.2) - restriction: || (>= net461) (>= netstandard2.0)
Microsoft.AspNetCore.Authentication (>= 2.1.2) - restriction: || (>= net461) (>= netstandard2.0)
Microsoft.AspNetCore.Authorization (>= 2.1.2) - restriction: || (>= net461) (>= netstandard2.0)
Expand Down Expand Up @@ -892,7 +892,7 @@ NUGET
Microsoft.Win32.Registry (4.5) - restriction: >= netcoreapp1.0
System.Security.AccessControl (>= 4.5) - restriction: || (&& (>= monoandroid) (< netstandard2.0)) (>= monotouch) (&& (< net46) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.0) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
System.Security.Principal.Windows (>= 4.5) - restriction: || (&& (>= monoandroid) (< netstandard2.0)) (>= monotouch) (&& (< net46) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.0) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
NETStandard.Library (2.0.3) - restriction: || (&& (< net35) (>= netstandard1.1) (< netstandard2.0)) (&& (< net45) (>= net461) (>= netstandard1.6)) (&& (< net45) (>= netstandard2.0)) (&& (< net452) (>= netstandard1.1) (< netstandard2.0)) (>= netcoreapp1.0)
NETStandard.Library (2.0.3) - restriction: || (&& (< net35) (>= netstandard1.1) (< netstandard2.0)) (&& (< net45) (>= net461) (>= netstandard1.6)) (&& (< net45) (>= netstandard2.0)) (&& (< net452) (>= netstandard1.1)) (>= netcoreapp1.0)
Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (>= net45) (< netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.4) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.4) (< netstandard1.5) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.6) (< netstandard2.0) (< win8) (< wpa81)) (&& (< net45) (>= netstandard2.0)) (&& (>= net46) (< netstandard1.4)) (>= net461) (>= netcoreapp2.0) (&& (>= netstandard1.0) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8) (< win8)) (&& (< netstandard1.0) (< portable-net45+win8) (>= portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8+wp8+wpa81) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= win8)) (&& (< netstandard1.3) (< win8) (>= wpa81)) (&& (< netstandard1.5) (>= uap10.0)) (>= uap10.1) (>= wp8)
Newtonsoft.Json (11.0.2) - restriction: || (>= net461) (>= netcoreapp1.0) (>= netstandard2.0) (>= uap10.0)
Newtonsoft.Json.Bson (1.0.1) - restriction: >= netcoreapp2.1
Expand Down Expand Up @@ -1576,23 +1576,23 @@ NUGET
System.Reflection.Emit.Lightweight (>= 4.3) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
System.Threading.Tasks.Extensions (>= 4.4) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
System.ValueTuple (>= 4.4) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
xunit (2.4)
xunit (2.4.1)
xunit.analyzers (>= 0.10)
xunit.assert (2.4)
xunit.core (2.4)
xunit.assert (2.4.1)
xunit.core (2.4.1)
xunit.abstractions (2.0.3) - restriction: >= netstandard1.1
NETStandard.Library (>= 1.6) - restriction: && (< net35) (>= netstandard1.0) (< netstandard2.0)
xunit.analyzers (0.10)
xunit.assert (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.core (2.4)
xunit.extensibility.core (2.4)
xunit.extensibility.execution (2.4)
xunit.extensibility.core (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.abstractions (>= 2.0.2) - restriction: >= netstandard1.1
xunit.extensibility.execution (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.extensibility.core (2.4) - restriction: >= netstandard1.1
xunit.runner.visualstudio (2.4)
xunit.assert (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.core (2.4.1)
xunit.extensibility.core (2.4.1)
xunit.extensibility.execution (2.4.1)
xunit.extensibility.core (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.abstractions (>= 2.0.3) - restriction: >= netstandard1.1
xunit.extensibility.execution (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.extensibility.core (2.4.1) - restriction: >= netstandard1.1
xunit.runner.visualstudio (2.4.1)
Microsoft.NET.Test.Sdk (>= 15.0) - restriction: >= netcoreapp1.0
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup Condition="'$(UsePaket)' == false OR '$(UsePaket)' == ''">
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.*" />
<PackageReference Include="Giraffe" Version="3.2.*" />
<PackageReference Include="Giraffe" Version="3.4.*" />
<PackageReference Include="Giraffe.DotLiquid" Version="1.2.*" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
</ItemGroup>
Expand Down
7 changes: 4 additions & 3 deletions src/content/DotLiquid/src/AppNamePlaceholder/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ let webApp =
// ---------------------------------

let errorHandler (ex : Exception) (logger : ILogger) =
logger.LogError(EventId(), ex, "An unhandled exception has occurred while executing the request.")
logger.LogError(ex, "An unhandled exception has occurred while executing the request.")
clearResponse >=> setStatusCode 500 >=> text ex.Message

// ---------------------------------
Expand Down Expand Up @@ -62,8 +62,9 @@ let configureServices (services : IServiceCollection) =
services.AddGiraffe() |> ignore

let configureLogging (builder : ILoggingBuilder) =
let filter (l : LogLevel) = l.Equals LogLevel.Error
builder.AddFilter(filter).AddConsole().AddDebug() |> ignore
builder.AddFilter(fun l -> l.Equals LogLevel.Error)
.AddConsole()
.AddDebug() |> ignore

[<EntryPoint>]
let main _ =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
</PropertyGroup>

<ItemGroup Condition="'$(UsePaket)' == false OR '$(UsePaket)' == ''">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.*" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.*" />
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.*" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.0.*" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.1.*" />
<PackageReference Include="xunit" Version="2.4.*" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.*" />
</ItemGroup>
Expand Down
34 changes: 17 additions & 17 deletions src/content/Giraffe/paket.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ STORAGE: NONE
NUGET
remote: https://api.nuget.org/v3/index.json
FSharp.Core (4.5.2) - restriction: || (>= net461) (>= netstandard2.0)
Giraffe (3.2)
Giraffe (3.4)
FSharp.Core (>= 4.5.2) - restriction: || (>= net461) (>= netstandard2.0)
Microsoft.AspNetCore.Authentication (>= 2.1.2) - restriction: || (>= net461) (>= netstandard2.0)
Microsoft.AspNetCore.Authorization (>= 2.1.2) - restriction: || (>= net461) (>= netstandard2.0)
Expand Down Expand Up @@ -884,7 +884,7 @@ NUGET
Microsoft.Win32.Registry (4.5) - restriction: >= netcoreapp1.0
System.Security.AccessControl (>= 4.5) - restriction: || (&& (>= monoandroid) (< netstandard2.0)) (>= monotouch) (&& (< net46) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.0) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
System.Security.Principal.Windows (>= 4.5) - restriction: || (&& (>= monoandroid) (< netstandard2.0)) (>= monotouch) (&& (< net46) (>= netstandard2.0)) (>= net461) (>= netcoreapp2.0) (>= xamarinios) (>= xamarinmac) (>= xamarintvos) (>= xamarinwatchos)
NETStandard.Library (2.0.3) - restriction: || (&& (< net35) (>= netstandard1.1) (< netstandard2.0)) (&& (< net45) (>= net461) (>= netstandard1.6)) (&& (< net45) (>= netstandard2.0)) (&& (< net452) (>= netstandard1.1) (< netstandard2.0)) (>= netcoreapp1.0)
NETStandard.Library (2.0.3) - restriction: || (&& (< net35) (>= netstandard1.1) (< netstandard2.0)) (&& (< net45) (>= net461) (>= netstandard1.6)) (&& (< net45) (>= netstandard2.0)) (&& (< net452) (>= netstandard1.1)) (>= netcoreapp1.0)
Microsoft.NETCore.Platforms (>= 1.1) - restriction: || (&& (>= net45) (< netstandard1.3)) (&& (< net45) (>= netstandard1.1) (< netstandard1.2) (< win8)) (&& (< net45) (>= netstandard1.2) (< netstandard1.3) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.3) (< netstandard1.4) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.4) (< netstandard1.5) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.5) (< netstandard1.6) (< win8) (< wpa81)) (&& (< net45) (>= netstandard1.6) (< netstandard2.0) (< win8) (< wpa81)) (&& (< net45) (>= netstandard2.0)) (&& (>= net46) (< netstandard1.4)) (>= net461) (>= netcoreapp2.0) (&& (>= netstandard1.0) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8) (< win8)) (&& (< netstandard1.0) (< portable-net45+win8) (>= portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= portable-net45+win8+wp8+wpa81) (< portable-net45+win8+wpa81)) (&& (< netstandard1.0) (>= win8)) (&& (< netstandard1.3) (< win8) (>= wpa81)) (&& (< netstandard1.5) (>= uap10.0)) (>= uap10.1) (>= wp8)
Newtonsoft.Json (11.0.2) - restriction: || (>= net461) (>= netcoreapp1.0) (>= netstandard2.0) (>= uap10.0)
Newtonsoft.Json.Bson (1.0.1) - restriction: >= netcoreapp2.1
Expand Down Expand Up @@ -1568,23 +1568,23 @@ NUGET
System.Reflection.Emit.Lightweight (>= 4.3) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
System.Threading.Tasks.Extensions (>= 4.4) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
System.ValueTuple (>= 4.4) - restriction: || (&& (>= net45) (< netstandard2.0)) (&& (< net45) (>= netstandard2.0)) (>= net47)
xunit (2.4)
xunit (2.4.1)
xunit.analyzers (>= 0.10)
xunit.assert (2.4)
xunit.core (2.4)
xunit.assert (2.4.1)
xunit.core (2.4.1)
xunit.abstractions (2.0.3) - restriction: >= netstandard1.1
NETStandard.Library (>= 1.6) - restriction: && (< net35) (>= netstandard1.0) (< netstandard2.0)
xunit.analyzers (0.10)
xunit.assert (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.core (2.4)
xunit.extensibility.core (2.4)
xunit.extensibility.execution (2.4)
xunit.extensibility.core (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.abstractions (>= 2.0.2) - restriction: >= netstandard1.1
xunit.extensibility.execution (2.4)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1) (< netstandard2.0)
xunit.extensibility.core (2.4) - restriction: >= netstandard1.1
xunit.runner.visualstudio (2.4)
xunit.assert (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.core (2.4.1)
xunit.extensibility.core (2.4.1)
xunit.extensibility.execution (2.4.1)
xunit.extensibility.core (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.abstractions (>= 2.0.3) - restriction: >= netstandard1.1
xunit.extensibility.execution (2.4.1)
NETStandard.Library (>= 1.6.1) - restriction: && (< net452) (>= netstandard1.1)
xunit.extensibility.core (2.4.1) - restriction: >= netstandard1.1
xunit.runner.visualstudio (2.4.1)
Microsoft.NET.Test.Sdk (>= 15.0) - restriction: >= netcoreapp1.0
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<ItemGroup Condition="'$(UsePaket)' == false OR '$(UsePaket)' == ''">
<PackageReference Include="Microsoft.AspNetCore.App" Version="2.1.*" />
<PackageReference Include="Giraffe" Version="3.2.*" />
<PackageReference Include="Giraffe" Version="3.4.*" />
<PackageReference Include="TaskBuilder.fs" Version="2.1.*" />
</ItemGroup>

Expand Down
7 changes: 4 additions & 3 deletions src/content/Giraffe/src/AppNamePlaceholder/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ let webApp =
// ---------------------------------

let errorHandler (ex : Exception) (logger : ILogger) =
logger.LogError(EventId(), ex, "An unhandled exception has occurred while executing the request.")
logger.LogError(ex, "An unhandled exception has occurred while executing the request.")
clearResponse >=> setStatusCode 500 >=> text ex.Message

// ---------------------------------
Expand Down Expand Up @@ -97,8 +97,9 @@ let configureServices (services : IServiceCollection) =
services.AddGiraffe() |> ignore

let configureLogging (builder : ILoggingBuilder) =
let filter (l : LogLevel) = l.Equals LogLevel.Error
builder.AddFilter(filter).AddConsole().AddDebug() |> ignore
builder.AddFilter(fun l -> l.Equals LogLevel.Error)
.AddConsole()
.AddDebug() |> ignore

[<EntryPoint>]
let main _ =
Expand Down
Loading

0 comments on commit 57e2ef0

Please sign in to comment.