-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit JSON simplification logs with -l SimplifyJson
#516
Conversation
f704a1a
to
549e9eb
Compare
c21e088
to
bf9dd42
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
library/Booster/CLOptions.hs
Outdated
<*> optional | ||
( strOption | ||
( metavar "LOG_FILE" | ||
<> long "log-file" | ||
<> help | ||
"Log file to write the logs to" | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe not a bad idea to optionally log to a file... (but we can use a redirect, the server does not have any important output).
At the moment, this option only affects the SimplifyJSON
log level, so it should maybe have a more specific name:
<*> optional | |
( strOption | |
( metavar "LOG_FILE" | |
<> long "log-file" | |
<> help | |
"Log file to write the logs to" | |
) | |
) | |
<*> optional | |
( strOption | |
( metavar "JSON_LOG_FILE" | |
<> long "simplification-log-file" | |
<> help | |
"Log file for the JSON simplification logs" | |
) | |
) |
IDK if it is possible to automatically imply -l SimplifyJSON
when this option is present (absolutely not required in this PR!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've renamed --log-file
to --simplification-log-file
.
Summary of changes
This PR enables the
-l SimplifyJson
log option inkore-rpc-booster
andbooster-dev
. This option enables structured (as JSON) logging of equation application/failures to apply an equation.These feature is a reincarnation of the
log-*-simplifications
request parameter. It has become evident that bundling the logs into the response is a bad idea, as they tend to be very heavy-weight. In this iteration, we change two things:Log format
the logs follow the format of the Simplification constructor of the
LogEntry
datatype fromkore-rpc-types
. This allows us to shovel both Booster's and Kore's equation application data into the same format that. Here are three examples of a log entries:Note: we do not have a way to get the failures from Kore at that point.
Output to file or
stderr
Both
kore-rpc-booster
andbooster-dev
now support a new CLI option,--log-file FILENAME
. This option only has effect of-l SimplifyJson
is supplied too. If both are present, the simplification logs will be written toFILENAME
, otherwise they will end-up instderr
.Note: when written to
stderr
, the logs are prefixed with[SimplifyJson]
to distinguish them from log entries of other types. When writing to a file, this prefix is skipped.Analysis of logs
These logs are intended for machine, rather direct human consumption. I'm working on a Python tool on top of
pyk
that would allow transforming these logs into a table. Something along the lines of:the above entries as are an exert from a table produced from logs of a Kontrol proof. For proof-wide tables to be more useful, we may want to add request IDs.