登录 Revit Design Automation 加载项 [英] Logging in Revit Design Automation add-in

查看:23
本文介绍了登录 Revit Design Automation 加载项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将一些诊断输出发送到默认的 report.txt 文件.

I want to send some diagnostic output to the default report.txt file.

在某些帖子中显示异常以某种方式(自动或不自动?)记录到此 report.txt 文件中.

In some posts it is shown that exceptions are logged to this report.txt file somehow (automatically or not?).

此外,我在一些示例中看到人们使用System.Console.WriteLine(),

Also, I see in some samples that people do the logging with System.Console.WriteLine(),

我已经试过了,但仍然无法在报告文件中看到它.

I've tried this, but still can't see it in the report file.

你能告诉我,如何实现这一目标吗?我知道有一个选项可以创建另一个日志文件并将结果与​​结果一起发回,但我认为使用现有的 report.txt 会更容易.

Could you tell me, how to achieve this? I understand there is an option to create another log file and send it back with the result, but I think it would be easier to use this existing report.txt.

谢谢!

更新: System.Console.WriteLine() 有效.
我没有看到输出的原因是我的加载项加载失败.所以,它根本没有到达这行代码.

UPDATE: System.Console.WriteLine() works.
The reason why I didn't see the output was that my add-in failed to load. So, it simply didn't reach this line of code.

推荐答案

登录 Revit appbundles 的设计自动化确实可以使用 SystemConsole.WriteLine 来完成.发送到标准输出的任何内容都将被捕获在您的 workitems report.txt 中.例如.

Logging in Design Automation for Revit appbundles can indeed be done with SystemConsole.WriteLine. Anything sent to standard output will be capture in your workitems report.txt. For example.

以下代码:

System.Console.WriteLine("Hello World!");

将在 report.txt 中生成以下几行:

Will generate the following lines in the report.txt:

[04/23/2020 19:20:59] Hello World!

这篇关于登录 Revit Design Automation 加载项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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