Skip to content

Conversation

@DatGuyJonathan
Copy link
Contributor

@DatGuyJonathan DatGuyJonathan commented Nov 10, 2025

Note

Adds --log-payloads to moose dev to enable compact payload logging at ingest and before/after streaming functions (Python/TypeScript), with docs updated.

  • CLI
    • Add --log-payloads flag to moose dev in apps/framework-cli/src/cli/commands.rs; when set, apps/framework-cli/src/cli.rs sets MOOSE_LOG_PAYLOADS=true.
  • Runtime (Ingest API)
    • Log compact JSON payloads on ingest with [PAYLOAD:INGEST] prefix in apps/framework-cli/src/cli/local_webserver.rs.
  • Streaming Runners
    • Python: Log [PAYLOAD:STREAM_IN] before transform and [PAYLOAD:STREAM_OUT] after, gated by MOOSE_LOG_PAYLOADS, in packages/py-moose-lib/moose_lib/streaming/streaming_function_runner.py.
    • TypeScript: Same payload logging before/after transform in packages/ts-moose-lib/src/streaming-functions/runner.ts; return processed messages via processedMessages variable.
  • Docs
    • Update CLI and local dev docs to include --log-payloads usage and log prefixes in apps/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.

@vercel
Copy link

vercel bot commented Nov 10, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
framework-docs Ready Ready Preview Comment Nov 11, 2025 7:14pm
moosestack-framework-docs-v2 Ready Ready Preview Comment Nov 11, 2025 7:14pm

debug!("parsed json array for {}", topic_name);

// Log payload if enabled (compact JSON on one line)
if std::env::var("MOOSE_LOG_PAYLOADS")
Copy link
Collaborator

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

Copy link
Collaborator

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 {
Copy link
Collaborator

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

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.

3 participants