简体   繁体   中英

Logging in Revit Design Automation add-in

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

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

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.

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.

Thanks!

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.

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

The following code:

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

Will generate the following lines in the report.txt :

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM