ILogger question.
How does ILogger's LogInformation() work? I thought it was to output to a console, debug output or anywhere I wanted?
I had to supply a Debug.WriteLine() just to see something.
Thank you.
11 Replies
are you following https://medium.com/@shalahuddinshanto/dependency-injection-in-wpf-a-complete-implementation-guide-468abcf95337 ?
add package Microsoft.Extensions.Logging.Debug (or .Console if you want it there), then on the AddLogging(), chain .AddDebug() or .AddConsole()
Ohh ok.
What if I wanted to output to a ListBox?
think you'd have to write your own ILoggerProvider for that
ah, that I'll suck with probablyh but i can use console for now, thank you
Also, I put the ILogger on my .Core project and not Wpf, does it matter?

your ILogger? it's provided by the package Microsoft.Extensions.Logging (actually .Abstractions but it's transitive)
Ah okay, removed then.
for the core, you can add package Microsoft.Extensions.Logging.Abstractions if all you want is ILogger
Yep, I got that installed too.
I'm trying to figure out how to load a View via this DI thing, confused.
besides the main view of course
I already registered everything
i don't really do any wpf so ui people might know
It's okay, I think I'm close to solving it.
Thank you for your help though 🙂