Forum Discussion
Hi,
In your case OnLogEvent calls Runner.Stop() immediately after the first event was occurred. And your test stops before the error was posted into the log. I suppose that the OnLogError event is more suitable here.
Thanks for reply.
I made a mistake when I descripted my problem. I'm actually using OnLogError, not OnLogEvent.
The main problem is debug info not works for all test units excluded the first one.
- tristaanogre10 years agoEsteemed Contributor
If I understand the OnLogError event, it intercepts the logging process at the moment it needs to log the error BEFORE the error is written to the log. This allows you to do other processing and stuff before continuing on. So, if you're stopping the test run before the error is written, then you'll get the behavior you're seeing.
In your event handler, you might want to make sure you flush the error to the log FIRST before you do the Runner.Stop call.
Again... this is conjecture so someone else might correct me but I'd give that a shot.- KazakovMaxim10 years agoNew Contributor
Thanks, I guess it probably so!
Please can you tell me the best way to write error in log using Sender and LogParams with condistion that I want to see the log message like really error (with additional info with stack trace and so on)? :)