Console.WriteLine and Console.Debug do not log to VSCode console, but a library I use does #21316
tpitman
started this conversation in
Upgrading from Xamarin
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am upgrading my app from Xamarin Forms to MAUI.
I have started using VSCode and the MAUI plugin for it.
There are many questions / issues recorded about how Console.WriteLine and Debug.WriteLine do not output anything to the debug console in VSCode.
I use a library in my app that supports MAUI and seems to be using the Microsoft.Extensions.Logging nuget packet and it DOES show it debug output on the VSCode debug console.
I have the source code to that library, but can't seem to find where the actual implementation on Android is.
An interesting note about this is that when I run on iOS my output DOES show up, but the output from this library does NOT. So it is backwards.
What I would like to know if how can I figure out what the microsoft logger is doing that is able to output to the VSCode debug console for a MAUI app on Android?
I don't want to introduce the full microsoft logging api because I already have my own that is lighter weight. I just want to add to the one line where I have Console.WriteLine / Debug.WriteLine that works on iOS with whatever this 3rd party library gets when it uses the microsoft logging extensions.
Can someone tell me how to find that out?
An example of one of their log output functions is this:
[LoggerMessage(
EventId = 3,
Level = LogLevel.Error,
Message = "Binding Failure: {typeFullName} - {storeAlias}"
)]
public static partial void BindError(this ILogger logger, Exception exception, string typeFullName, string storeAlias);
Beta Was this translation helpful? Give feedback.
All reactions