简体   繁体   English

Xamarin.Forms - Debug.WriteLine() - 输出去哪里?

[英]Xamarin.Forms - Debug.WriteLine() - where does the output go?

I have a simple Xamarin.Forms project that I'm running in Visual Studio, using an iphone emulator.我有一个简单的 Xamarin.Forms 项目,我在 Visual Studio 中运行,使用 iphone 模拟器。 I have the following code in App.cs:我在 App.cs 中有以下代码:

protected override void OnStart()
{
    Debug.WriteLine("---------- OnStart called!");
}

Where exactly is that supposed to output to?那到底应该输出到哪里? I don't see it in any of the Visual Studio output windows (Build, Build Order, Debug, Xamarin, Xamarin Diagnostics).我在任何 Visual Studio 输出窗口(构建、构建顺序、调试、Xamarin、Xamarin 诊断)中都没有看到它。

Using Console.WriteLine() works with Device Log.使用Console.WriteLine()适用于设备日志。 Also you can filter out all device log with mono-stdout tag.您也可以使用mono-stdout标签过滤掉所有设备日志。

它应该在设备日志上,例如在 Android 上,您可以使用 Android 设备监视器查看消息,您始终可以使用Console.Writeline()在调试控制台上查看这些消息。

It will be coming in application output window.它将出现在应用程序输出窗口中。 if it is not open automatically, you can go to view -> Pads -> Application Output.如果它没有自动打开,你可以去查看 -> Pads -> Application Output。 This was about mac visual studio.这是关于 mac 视觉工作室。 i am not sure about windows.我不确定窗户。

Rider has a plugin called Logcat, when I write Rider 有一个插件叫做 Logcat,我写的时候

Console.WriteLine("**** Hi mate");

, then I can filter the Logcat window for **** and it will show the Console.WriteLine's ,然后我可以过滤 **** 的 Logcat 窗口,它会显示 Console.WriteLine 的

This is in Xamarin Forms, for both iOS and Android这是在 Xamarin Forms 中,适用于 iOS 和 Android

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM