chore(logging): Logging cleanup (#580)

This commit is contained in:
Kamron Batman 2021-04-23 18:57:42 -07:00 • committed by GitHub
parent c6cbda6f52
commit 9f9d990f85
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 32 additions and 47 deletions

View file

@ -14,8 +14,8 @@ namespace Benchmarks
private Logger logger;
private Logger asyncLogger;
[IterationSetup]
public void IterationSetup()
[GlobalSetup]
public void GlobalSetup()
{
logger = new LoggerConfiguration()
.WriteTo.Console()
@ -26,8 +26,8 @@ namespace Benchmarks
.CreateLogger();
}
[IterationCleanup]
public void IterationCleanup()
[GlobalCleanup]
public void GlobalCleanup()
{
logger = null;
asyncLogger = null;
@ -36,7 +36,7 @@ namespace Benchmarks
[Benchmark]
public void TestConsoleWriteLine()
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 10000; i++)
{
Console.WriteLine(text);
}
@ -45,7 +45,7 @@ namespace Benchmarks
[Benchmark]
public void TestSerilogConsoleSink()
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 10000; i++)
{
logger.Information(text);
}
@ -54,7 +54,7 @@ namespace Benchmarks
[Benchmark]
public void TestSerilogAsyncConsoleSink()
{
for (int i = 0; i < 100; i++)
for (int i = 0; i < 10000; i++)
{
asyncLogger.Information(text);
}