您好,我正在开发一个 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 http://code.msdn.microsoft.com/windowsapps/LoggingSession-Sample-ccd52336请参阅构建会话:http://channel9.msdn.com/Events/Build/2013/3-136 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");
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)