Notepad.Extensions.Logging/README.md

34 lines
967 B
Markdown
Raw Normal View History

2020-05-21 00:38:03 +00:00
# Notepad.Extensions.Logging
2020-05-21 03:24:10 +00:00
[![NuGet](https://img.shields.io/nuget/v/Notepad.Extensions.Logging)](https://www.nuget.org/packages/Notepad.Extensions.Logging/)
2020-05-21 02:38:30 +00:00
2020-05-21 00:38:03 +00:00
This is a library for .NET / .NET Core to log your program's output to a handy Notepad window!
2020-05-21 03:51:23 +00:00
## Installation
To use:
2020-05-21 03:51:52 +00:00
1. Add a package reference to `Notepad.Extensions.Logging`.
2020-05-21 03:51:23 +00:00
2. In `Startup.cs`, call `AddNotepad()`, like so:
```csharp
// This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddControllersWithViews();
// ...
services.AddLogging(lb => lb.AddNotepad()); // This is where the magic happens
}
```
2020-05-24 12:34:49 +00:00
3. Open a new Notepad, Notepad++, or Notepad2 window.
2020-05-21 03:51:52 +00:00
4. Run your application.
2020-05-21 03:51:23 +00:00
## Source Material
2020-05-21 00:38:03 +00:00
Inspired by [this tweet](https://twitter.com/steveklabnik/status/1263190719721766918):
2020-05-21 03:24:10 +00:00
![](https://pbs.twimg.com/media/EYfBQ5cXsAEcu2e?format=jpg&name=orig)