Custom GUI do not release session log after completed TestPlanRun

I am quite new to OpenTAP but have been able to build a good platform that we are using. However i have one major issue that i cannot figure out a solution to.
I am using a custom GUI, it is working fine but after the run is finished it will not release the created sessionlog file. If i then rerun the testplan without closing and repoening the GUI the next run will be added to the existing sessionlog.
I have tried everthing that i can come up with to release the sessionlog but so far no luck, except restarting the entire GUI.
Anyone have any idea about this? all help would be very much appreciated.

1 Like

Hi @diiminores, and welcome to the forum!

The idea of the session log file is that it records events throughout the lifetime of the application. If you want to get the log file of a test plan run, you can get that separately using a ResultListener.

Anyway, if you don’t want to store log messages in the session log, you can redirect the log messages by creating a new ‘Session’:

            using (Session.Create(SessionOptions.RedirectLogging))
                // none of the log messages created here gets recorded.
                // Use Log.AddListener() to add something to intercept them.
                Log.CreateSource("test").Info("This log message gets redirected (not recorded)");
            Log.CreateSource("test").Info("This log message does not get redirected.");

1 Like

thank you for the quick reply, now i understand how it should work. With my result listener i am able to capture what i need and get individual logs