-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dependency updates, langversion, embed README
- Loading branch information
1 parent
08e9025
commit 4688ab3
Showing
8 changed files
with
39 additions
and
462 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
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 |
---|---|---|
@@ -1,35 +1,27 @@ | ||
using Serilog; | ||
using Serilog.Debugging; | ||
|
||
namespace Sample; | ||
SelfLog.Enable(Console.Out); | ||
|
||
public class Program | ||
{ | ||
public static void Main(string[] args) | ||
{ | ||
SelfLog.Enable(Console.Out); | ||
|
||
var sw = System.Diagnostics.Stopwatch.StartNew(); | ||
var sw = System.Diagnostics.Stopwatch.StartNew(); | ||
|
||
Log.Logger = new LoggerConfiguration() | ||
.WriteTo.File("log.txt") | ||
.CreateLogger(); | ||
Log.Logger = new LoggerConfiguration() | ||
.WriteTo.File("log.txt") | ||
.CreateLogger(); | ||
|
||
for (var i = 0; i < 1000000; ++i) | ||
{ | ||
Log.Information("Hello, file logger!"); | ||
} | ||
for (var i = 0; i < 1000000; ++i) | ||
{ | ||
Log.Information("Hello, file logger!"); | ||
} | ||
|
||
Log.CloseAndFlush(); | ||
Log.CloseAndFlush(); | ||
|
||
sw.Stop(); | ||
sw.Stop(); | ||
|
||
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds} ms"); | ||
Console.WriteLine($"Size: {new FileInfo("log.txt").Length}"); | ||
Console.WriteLine($"Elapsed: {sw.ElapsedMilliseconds} ms"); | ||
Console.WriteLine($"Size: {new FileInfo("log.txt").Length}"); | ||
|
||
Console.WriteLine("Press any key to delete the temporary log file..."); | ||
Console.ReadKey(true); | ||
Console.WriteLine("Press any key to delete the temporary log file..."); | ||
Console.ReadKey(true); | ||
|
||
File.Delete("log.txt"); | ||
} | ||
} | ||
File.Delete("log.txt"); |
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
Oops, something went wrong.