-
Notifications
You must be signed in to change notification settings - Fork 25
add option to log payload #2966
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
base: main
Are you sure you want to change the base?
add option to log payload #2966
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
d497bc7 to
19200ff
Compare
packages/py-moose-lib/moose_lib/streaming/streaming_function_runner.py
Outdated
Show resolved
Hide resolved
| debug!("parsed json array for {}", topic_name); | ||
|
|
||
| // Log payload if enabled (compact JSON on one line) | ||
| if std::env::var("MOOSE_LOG_PAYLOADS") |
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.
Could we preload it?
This will get re-executed for every requests which we get a lot of
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.
Also shouldn't that be passed through the cli flag?
| info!("Moose Version: {}", CLI_VERSION); | ||
|
|
||
| // Set environment variable for payload logging if flag is enabled | ||
| if *log_payloads { |
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.
instead of the pattern set the env variable and re-read it later could we just modify the project and have that be used as a reference. It would be less error prone reading the code and less performance overhead
Note
Adds
--log-payloadstomoose devto enable compact payload logging at ingest and before/after streaming functions (Python/TypeScript), with docs updated.--log-payloadsflag tomoose devinapps/framework-cli/src/cli/commands.rs; when set,apps/framework-cli/src/cli.rssetsMOOSE_LOG_PAYLOADS=true.[PAYLOAD:INGEST]prefix inapps/framework-cli/src/cli/local_webserver.rs.[PAYLOAD:STREAM_IN]before transform and[PAYLOAD:STREAM_OUT]after, gated byMOOSE_LOG_PAYLOADS, inpackages/py-moose-lib/moose_lib/streaming/streaming_function_runner.py.packages/ts-moose-lib/src/streaming-functions/runner.ts; return processed messages viaprocessedMessagesvariable.--log-payloadsusage and log prefixes inapps/framework-docs/src/pages/moose/{moose-cli.mdx,local-dev.mdx}.Written by Cursor Bugbot for commit 32a68fb. This will update automatically on new commits. Configure here.