问题
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.
回答1:
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.
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!
来源:https://stackoverflow.com/questions/61384581/logging-in-revit-design-automation-add-in