gpt4 book ai didi

windows-8 - 如何在 Windows 8 METRO 应用程序中实现错误日志记录?

转载 作者:行者123 更新时间:2023-12-02 22:57:53 25 4
gpt4 key购买 nike

您好,我正在开发一个 Windows 8 c#/xaml Metro 应用程序。

我想在我的应用程序中实现错误日志记录。我想以更好的方式处理错误日志。

1)如何记录错误信息(以便于开发者纠正错误)

2)是否有任何第三方工具/免费库用于在 Metro 应用程序中记录错误。

3)有哪些可用于错误日志记录的各种替代方案??

4)错误日志记录的最佳遵循实践是什么??

请帮帮我。

您的回答对我很有帮助。

提前致谢。

最佳答案

对于 Windows 8.1,您可以使用 LoggingSession 和 LogginChannel 的新 Windows.Foundation.Diagnostics 功能。

http://code.msdn.microsoft.com/windowsapps/LoggingSession-Sample-ccd52336请参阅构建 session :http://channel9.msdn.com/Events/Build/2013/3-136

var channel = new LoggingChannel ("ChannelName");
var session = new LoggingSession("Session Name");
session.AddLoggingChannel(channel, LoggingLevel.Warning);

channel.LogMessage("Message to log", LoggingLevel.Error);
channel.LogValuePair("Count", 42, LoggingLevel.Error);

//when error detected, save the log session to disk
var logFile = await session.SaveToFileAsync(ApplicationData.Current.LocalFolder, "CrashLog");

关于windows-8 - 如何在 Windows 8 METRO 应用程序中实现错误日志记录?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15570364/

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