MonoTouch - XCode 管理器中更好的控制台输出 [英] MonoTouch - better console output in XCode's organizer

查看:30
本文介绍了MonoTouch - XCode 管理器中更好的控制台输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们一直在玩新的 MonoTouch NUnit 测试项目,这非常好.

We've been playing around with the new MonoTouch NUnit test project, which is quite nice.

我们已经在 CI 软件中在 Windows 上运行了这些测试中的一些,并且我们在控制台上打印了很多东西以查看测试过程中出了什么问题.

Several of these tests we already run on Windows in CI software, and we print alot of stuff on the console to see what went wrong during the tests.

如果我们为 MonoTouch 构建和运行这些测试,并在 XCode 的管理器中查看控制台,它们看起来非常难看:

If we build and run these tests for MonoTouch, and view the console in XCode's organizer they look pretty ugly:

Feb 20 10:34:57 unknown UIKitApplication:com.ourcompany.ourapp[0xab78][8329] <Notice>: [Our usually pretty rainbows and unicorn console output here]

有没有办法在 iOS 中清理这个输出?至少用更有意义的东西替换未知",或者将它和 UIKitApplication 一起删除会很好.

Is there a way to cleanup this output in iOS? It would be nice to at least replace "unknown" with something more meaningful, or remove it and UIKitApplication altogether.

另外,我们不介意以某种方式调用 NSLog 而不是 Console.WriteLine 如果它会解决这个问题.

Also, we don't mind to somehow call NSLog instead of Console.WriteLine if it will fix this.

推荐答案

我认为最简单的方法是:

I think the easiest way, that would not require changes to your existing tests, is to:

  • 使用可选 网络记录器.这会将每个测试结果发送到套接字服务器,将它们与来自 iOS 设备的其他日志分开;和

  • Use the optional network logger. That will send every test results to a socket server, separating them from other logs coming from iOS devices; and

使用 TouchRunner.Writer 作为参数调用 Console.SetOut(在 AppDelegate.cs 中).这应该(现在未经测试;-)将您对控制台的所有现有写入记录到网络记录器中.

Call Console.SetOut with TouchRunner.Writer as a parameter (in AppDelegate.cs). This should (untested right now ;-) log every existing write you have to the console into the network logger.

这篇关于MonoTouch - XCode 管理器中更好的控制台输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆