-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grand Unified Console [WIP] #8
Merged
nblumhardt
merged 16 commits into
serilog:dev
from
nblumhardt:great-console-unification
Jun 19, 2017
Merged
Changes from 11 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
fd38b89
Upgrade to RTM dotnet tooling
nblumhardt 76ed0a1
Updated build/appveyor.yml
nblumhardt dc3b5c8
Switched implementation to literate console
nblumhardt b0ff2de
Sort out special-cased foreground/background coloring
nblumhardt 32466e1
Complete rewrite
nblumhardt 9c4f503
ANSI literate theme
nblumhardt 76c6e11
Output redirect detection.
nblumhardt c098412
Working version
nblumhardt cbe5076
Move type to matching filename
nblumhardt f8c8d28
Added Grayscale themes (System and ANSI 16-color); cleanup
nblumhardt 969677c
`AnsiConsoleTheme.Code`
nblumhardt e4f61d4
Enable ANSI coloring on Windows
nblumhardt e382585
Themed JSON formatter basic tests
nblumhardt dc5ac47
Themed message template renderer basic tests
nblumhardt 6ecc782
Quick explanatory comment
nblumhardt 5969acc
Update Serilog dependency
nblumhardt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,44 @@ | ||
echo "build: Build started" | ||
|
||
Push-Location $PSScriptRoot | ||
|
||
if(Test-Path .\artifacts) { Remove-Item .\artifacts -Force -Recurse } | ||
if(Test-Path .\artifacts) { | ||
echo "build: Cleaning .\artifacts" | ||
Remove-Item .\artifacts -Force -Recurse | ||
} | ||
|
||
& dotnet restore --no-cache | ||
|
||
$branch = @{ $true = $env:APPVEYOR_REPO_BRANCH; $false = $(git symbolic-ref --short -q HEAD) }[$env:APPVEYOR_REPO_BRANCH -ne $NULL]; | ||
$revision = @{ $true = "{0:00000}" -f [convert]::ToInt32("0" + $env:APPVEYOR_BUILD_NUMBER, 10); $false = "local" }[$env:APPVEYOR_BUILD_NUMBER -ne $NULL]; | ||
$suffix = @{ $true = ""; $false = "$branch-$revision"}[$branch -eq "master" -and $revision -ne "local"] | ||
$suffix = @{ $true = ""; $false = "$($branch.Substring(0, [math]::Min(10,$branch.Length)))-$revision"}[$branch -eq "master" -and $revision -ne "local"] | ||
$commitHash = $(git rev-parse --short HEAD) | ||
$buildSuffix = @{ $true = "$($suffix)-$($commitHash)"; $false = "$($branch)-$($commitHash)" }[$suffix -ne ""] | ||
|
||
echo "build: Package version suffix is $suffix" | ||
echo "build: Build version suffix is $buildSuffix" | ||
|
||
foreach ($src in ls src/Serilog.*) { | ||
foreach ($src in ls src/*) { | ||
Push-Location $src | ||
|
||
& dotnet pack -c Release -o ..\..\.\artifacts --version-suffix=$suffix | ||
echo "build: Packaging project in $src" | ||
|
||
& dotnet build -c Release --version-suffix=$buildSuffix | ||
& dotnet pack -c Release --include-symbols -o ..\..\artifacts --version-suffix=$suffix --no-build | ||
if($LASTEXITCODE -ne 0) { exit 1 } | ||
|
||
Pop-Location | ||
} | ||
|
||
foreach ($test in ls test/Serilog.*.Tests) { | ||
foreach ($test in ls test/*.Tests) { | ||
Push-Location $test | ||
|
||
echo "build: Testing project in $test" | ||
|
||
& dotnet test -c Release | ||
if($LASTEXITCODE -ne 0) { exit 2 } | ||
if($LASTEXITCODE -ne 0) { exit 3 } | ||
|
||
Pop-Location | ||
} | ||
|
||
Pop-Location | ||
Pop-Location |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp1.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Serilog.Sinks.Console\Serilog.Sinks.Console.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using Serilog; | ||
using System; | ||
using System.Threading; | ||
|
||
namespace ConsoleDemo | ||
{ | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
Log.Logger = new LoggerConfiguration() | ||
.MinimumLevel.Verbose() | ||
.WriteTo.Console() | ||
.CreateLogger(); | ||
|
||
try | ||
{ | ||
Log.Debug("Getting started"); | ||
|
||
Log.Information("Hello {Name} from thread {ThreadId}", Environment.GetEnvironmentVariable("USERNAME"), Thread.CurrentThread.ManagedThreadId); | ||
|
||
Log.Warning("No coins remain at position {@Position}", new { Lat = 25, Long = 134 }); | ||
|
||
Fail(); | ||
} | ||
catch (Exception e) | ||
{ | ||
Log.Error(e, "Something went wrong"); | ||
} | ||
|
||
Log.CloseAndFlush(); | ||
} | ||
|
||
static void Fail() | ||
{ | ||
throw new DivideByZeroException(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Description>A Serilog sink that writes log events to the console/terminal.</Description> | ||
<VersionPrefix>3.0.0</VersionPrefix> | ||
<Authors>Serilog Contributors</Authors> | ||
<TargetFrameworks>net45;netstandard1.3</TargetFrameworks> | ||
<AssemblyName>Serilog.Sinks.Console</AssemblyName> | ||
<AssemblyOriginatorKeyFile>../../assets/Serilog.snk</AssemblyOriginatorKeyFile> | ||
<SignAssembly>true</SignAssembly> | ||
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> | ||
<PackageId>Serilog.Sinks.Console</PackageId> | ||
<PackageTags>serilog;console;terminal</PackageTags> | ||
<PackageIconUrl>http://serilog.net/images/serilog-sink-nuget.png</PackageIconUrl> | ||
<PackageProjectUrl>https://github.com/serilog/serilog-sinks-console</PackageProjectUrl> | ||
<PackageLicenseUrl>https://www.apache.org/licenses/LICENSE-2.0</PackageLicenseUrl> | ||
<GenerateAssemblyVersionAttribute>true</GenerateAssemblyVersionAttribute> | ||
<GenerateAssemblyFileVersionAttribute>true</GenerateAssemblyFileVersionAttribute> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
<!-- Don't reference the full NETStandard.Library --> | ||
<DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences> | ||
<TreatWarningsAsErrors>True</TreatWarningsAsErrors> | ||
<TreatSpecificWarningsAsErrors /> | ||
<RootNamespace>Serilog</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Serilog" Version="2.5.0-dev-00842" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can't forget to circle back to this, post |
||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' "> | ||
<Reference Include="System" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.3' "> | ||
<PackageReference Include="System.Console" Version="4.3.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@merbla yep :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
soz missed that one. I was looking for
project.json
😜There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still find myself doing that, too.