feat(logs): add --env flag to fetch preview, prod, or all logs#551
Open
ImriKochWix wants to merge 3 commits into
Open
feat(logs): add --env flag to fetch preview, prod, or all logs#551ImriKochWix wants to merge 3 commits into
ImriKochWix wants to merge 3 commits into
Conversation
Default is "all": fetches both preview and prod per function, merges by time, and deduplicates entries that appear in both (when draft == published, same deployment ID returns same logs). Backend changes required: send env=preview|prod query param. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.0.56-pr.551.6632e1bPrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.0.56-pr.551.6632e1b"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.0.56-pr.551.6632e1b"
}
}
Preview published to npm registry — try new features instantly! |
…hint - Remove "all" env option; preview/prod only - Default to preview (consistent with industry standard of "current context") - When --env prod returns empty, show: "No production logs found. Has this app been published? Try --env preview to see draft logs." - Simplify fetchLogsForFunctions (no more merge/dedup needed) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- --format json outputs clean JSON (no UI chrome) for piping to jq etc. - --since/--until now accept relative shorthands: 1h, 30m, 2d - Suppress clack intro/outro when --format json via isRawOutputMode() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Enhances the
base44 logscommand with environment targeting, a JSON output format, and ergonomic relative-time shortcuts. Logs now default to thepreviewenvironment, support--env preview|prodselection (with a helpful empty-state hint for unpublished production apps), and can emit machine-readable JSON via--format jsonfor scripting and piping. The per-function fetch logic is also refactored into a dedicated helper for clarity.Related Issue
None
Type of Change
Changes Made
--env <preview|prod>option to fetch logs from a specific environment, defaulting topreview; theenvfilter is plumbed throughFunctionLogFiltersand the logs query string.--format <text|json>option (defaulttext);--format jsonprints pretty-printed JSON, suppresses the outro message, and runs the command in quiet/raw output mode viaBase44Command.isRawOutputMode().--since/--until(e.g.1h,30m,7d), resolved to ISO timestamps innormalizeDatetime().--env preview.fetchLogsForFunction()helper.--formatrejection, and relative--sinceshortcuts.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
--env alloption from an earlier iteration was dropped; logs now default topreview. JSON output is designed to be pipe-friendly (banner and outro suppressed) for downstream tooling.🤖 Generated by Claude | 2026-06-24 07:53 UTC | 6632e1b