-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
87 additions
and
6 deletions.
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<Description>Demonstrates the default output of the [italic black on white]SpectreConsoleLogger[/].</Description> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Spectre.Console.Extensions.Logging\Spectre.Console.Extensions.Logging.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.7" /> | ||
</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,27 @@ | ||
using System; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Default | ||
{ | ||
class Program | ||
{ | ||
private static ILogger _logger; | ||
|
||
static void Main(string[] args) | ||
{ | ||
using (var factory = LoggerFactory.Create(b => | ||
{ | ||
b.SetMinimumLevel(LogLevel.Trace).AddSpectreConsole(c => { c.LogLevel = LogLevel.Trace; c.IncludeEventId = true; }); | ||
})) | ||
{ | ||
_logger = factory.CreateLogger("SampleCategory"); | ||
} | ||
|
||
_logger.LogInformation(0, "Sample application starting up..."); | ||
_logger.LogTrace(1234, "Use a {adjective} format for logging {noun}", "familiar", "messages"); | ||
_logger.LogWarning(100, "Your logs can have [bold italic]formatting[/]!"); | ||
_logger.LogDebug("This is doing well to not have [underline]any[/] critical errors"); | ||
_logger.LogCritical(500, "Log your errors with all the [bold underline white on red]impact[/] they deserve!"); | ||
} | ||
} | ||
} |
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,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\..\src\Spectre.Console.Extensions.Logging\Spectre.Console.Extensions.Logging.csproj" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<Description>Demonstrates the terser output of the [italic black on white]SpectreInlineLogger[/].</Description> | ||
</PropertyGroup> | ||
|
||
</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,23 @@ | ||
using System; | ||
using Microsoft.Extensions.Logging; | ||
|
||
namespace Inline | ||
{ | ||
class Program | ||
{ | ||
static void Main(string[] args) | ||
{ | ||
var factory = LoggerFactory.Create(b => | ||
{ | ||
b.SetMinimumLevel(LogLevel.Trace).AddInlineSpectreConsole(c => { c.LogLevel = LogLevel.Trace; }); | ||
}); | ||
var logger = factory.CreateLogger<Program>(); | ||
|
||
logger.LogInformation("Sample application starting up..."); | ||
logger.LogTrace("Use a {adjective} format for logging {noun}", "familiar", "messages"); | ||
logger.LogWarning("Your logs can have [bold italic]formatting[/]!"); | ||
logger.LogDebug("This is doing well to not have [underline]any[/] critical errors"); | ||
logger.LogCritical("Log your errors with all the [bold underline red on white]impact[/] they deserve!"); | ||
} | ||
} | ||
} |
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