gpt4 book ai didi

c# - Cortana 应用程序日志

转载 作者:可可西里 更新时间:2023-11-01 14:02:48 25 4
gpt4 key购买 nike

我正在开发一个 Cortana 应用程序(Windows 应用程序 C#),我正在使用以下命令来打印调试信息:

System.Diagnostics.Debug.WriteLine("voiceCommandName: " + voiceCommandName);
System.Diagnostics.Debug.WriteLine("textSpoken: " + textSpoken);

我的问题是:当我使用 cortana 启动我的应用程序时,我应该在哪里寻找这些文本/调试输出?

最佳答案

通常需要在应用程序配置文件中配置跟踪监听器以获取跟踪/调试输出。这在你使用 cortana 时不起作用吗?尝试将文件配置为跟踪监听器 - TextWriterTraceListener。

https://msdn.microsoft.com/en-us/library/system.diagnostics.textwritertracelistener(v=vs.110).aspx

To add a trace listener, edit the configuration file that corresponds to the name of your application. Within this file, you can add a listener, set its type and set its parameter, remove a listener, or clear all the listeners previously set by the application. The configuration file should be formatted like the following example.

<configuration>
<system.diagnostics>
<trace autoflush="false" indentsize="4">
<listeners>
<add name="myListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="TextWriterOutput.log" />
<remove name="Default" />
</listeners>
</trace>
</system.diagnostics>
</configuration>

关于c# - Cortana 应用程序日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35000599/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com