Skip to content

feat: add job log command#268

Merged
clavery merged 3 commits intomainfrom
feature/job-log
Mar 16, 2026
Merged

feat: add job log command#268
clavery merged 3 commits intomainfrom
feature/job-log

Conversation

@clavery
Copy link
Copy Markdown
Collaborator

@clavery clavery commented Mar 16, 2026

Summary

  • Add new b2c job log command to retrieve and display job execution logs on demand
  • Three usage modes: specific execution by ID, most recent execution with a log, most recent failed execution (--failed)
  • ANSI syntax highlighting for timestamps and log levels (shared highlightLogText in utils/logs/format.ts), matching b2c logs color palette
  • Raw log content written to stdout for easy piping (b2c job log my-job > job.log), status messages to stderr
  • --json support returning { execution, log } structured output
  • --no-color flag to disable highlighting

Test plan

  • pnpm --filter @salesforce/b2c-cli run typecheck:agent — clean
  • pnpm --filter @salesforce/b2c-cli run lint:agent — clean
  • pnpm --filter @salesforce/b2c-cli run test:agent — 1032 passing (6 new command tests + 4 highlight tests)
  • Manual: b2c job log <jobId> on a real instance
  • Manual: b2c job log <jobId> --failed
  • Manual: b2c job log <jobId> --json | jq .
  • Manual: b2c job log <jobId> > /tmp/job.log (verify no ANSI codes in file)

clavery added 3 commits March 16, 2026 13:56
New command to fetch and display job execution logs with three modes:
- Specific execution: `b2c job log <jobId> <executionId>`
- Most recent with log: `b2c job log <jobId>`
- Most recent failed: `b2c job log <jobId> --failed`

Includes ANSI syntax highlighting (shared with `b2c logs`) for
timestamps and log levels when output is a TTY.
@clavery clavery merged commit 0c4e288 into main Mar 16, 2026
5 checks passed
@clavery clavery deleted the feature/job-log branch March 16, 2026 20:07
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