How to delete latest log messages / Rollback log to specified point
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   jochen_herrmann
Posted On:   Tuesday, March 2, 2004 02:04 AM

Hi, I run several testcases with junit that generate a lot of messages. For all succesful testcases I need only a short message, for all faulty testcases I need a detailed log. Desired Solution: Each start of a testcase should set some somekind of flag/marker. After that the testcase will run as normal and generate output to the log. When the test was successful, it should remove all previous logmessage back to the flag/marker set in the beginning. (and set a short log message to report success). When the test fails, log stays as it is. Are there any known solutions with such a feature, like to rollback the log to a specific point?    More>>

Hi,

I run several testcases with junit that generate a lot of messages. For all succesful testcases I need only a short message, for all faulty testcases I need a detailed log.



Desired Solution:

Each start of a testcase should set some somekind of flag/marker.

After that the testcase will run as normal and generate output to the log.

When the test was successful, it should remove all previous logmessage back to the flag/marker set in the beginning. (and set a short log message to report success).

When the test fails, log stays as it is.



Are there any known solutions with such a feature,
like to rollback the log to a specific point?



Any ideas, any hints?



Thanks and bye
Jochen

   <<Less

Re: How to delete latest log messages / Rollback log to specified point

Posted By:   Stephen_McConnell  
Posted On:   Tuesday, March 2, 2004 05:23 AM

We have written several Perl Scripts that do that (the code is company owned and I can't share it). You could write it in Java, however to parse the log up to the point of your marker and then, copy the portion of the file up to that point to a temp file, delete the origional log, then copy the temp file to the location of the orgional log.... (Which is what our perl scripts do).


Stephen McConnell

About | Sitemap | Contact