Skip to content

PrismLog improvements#274

Merged
davexparker merged 8 commits intoprismmodelchecker:masterfrom
davexparker:log
Mar 1, 2026
Merged

PrismLog improvements#274
davexparker merged 8 commits intoprismmodelchecker:masterfrom
davexparker:log

Conversation

@davexparker
Copy link
Member

Tidy up PrismLog, fix some bugs and more cleanly allow both pure Java and native implementations.

Various code, notably for exporting, uses:

try (PrismLog out = getPrismLogForFile(file)) { ... }

to create either a fresh file for export, or a pointer to the log
when file==null. But, when using when the log is a file (with -mainlog),
the auto-close caused the file to be closed prematuraly. Examples:

* prism poll2.sm -ss -mainlog tmp.log
* prism poll2.sm -exportmodel stdout.tra -ex -mainlog tmp.log

This is snow fixed, using a log wrapper class.
The Java implementation is not yet used anywhere.
Previously, the way to test for successful file opening was to call
ready() immediately afterwards, but this is often not done.
Also make sure that close() always triggers flush() first.

Remove an unusewd GUI log.
@davexparker davexparker force-pushed the log branch 3 times, most recently from 7ec8751 to c815584 Compare March 1, 2026 14:16
@davexparker davexparker merged commit 92f6680 into prismmodelchecker:master Mar 1, 2026
6 checks passed
@davexparker davexparker deleted the log branch March 1, 2026 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant