简体   繁体   中英

PostSharp Logging line by line

Does PostSharp support logging each line executed, or just function calls?

I have a program that randomly fails two or three times a week. I want to see the line and related info that the code is failing on. It just dies when it fails, so I will end up seeing the last successful line run. I know Postsharp will log function by function call for me. Will it also do line by line?

No, this is not possible to do that automatically and, in general, I think it would generate huge logs that would be difficult to read.

The recommended approach in this case is to combine automatic logging on method entry/exit with manual logging at essentials forking points within the offending method -- for instance, add logging inside if and foreach blocks.

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