Skip to content

feat(cli): improve logsv2 output format#14767

Merged
adriancooney merged 27 commits intomainfrom
adriancooney/logsv2-compact-output
Jan 30, 2026
Merged

feat(cli): improve logsv2 output format#14767
adriancooney merged 27 commits intomainfrom
adriancooney/logsv2-compact-output

Conversation

@adriancooney
Copy link
Contributor

@adriancooney adriancooney commented Jan 28, 2026

Summary

Improve the logsv2 command output to be more compact and terminal-friendly.

Changes

  • Single-line compact format with inline message snippets
  • Text-based level labels (info, warn, error, fatal) instead of emojis
  • Simplified source icons: λ (serverless), ε (edge), (static)
  • Dynamic column widths based on actual data (method width adapts to visible methods)
  • Smart date display: shows date only when logs span multiple days (with milliseconds)
  • Color-coded output: levels, status codes, and messages colored by severity
  • --expand flag (-x) to show full message details below each request line
  • Automatic color disable in non-TTY mode (piping/redirects)

Output Format

Same day:

TIME         LEVEL    PATH                            STATUS  MESSAGE
14:23:45.23  error  λ GET    /api/users               500     TypeError: Cannot read property...
14:23:46.12  info   λ POST   /api/posts               201     Created post id=123
14:23:47.89  warn   ε DELETE /api/items/123           204     Item deleted

Multiple days:

DATE/TIME           LEVEL    PATH                        STATUS  MESSAGE
Jan 27 14:23:45.23  error  λ GET /api/users              500     TypeError: Cannot read...
Jan 28 09:15:22.45  info   λ GET /api/posts              200     Success

Expanded mode (--expand):

TIME         LEVEL    PATH
14:23:45.23  error  λ GET /api/users
TypeError: Cannot read property 'id' of undefined
    at UserController.getUser (/api/users.js:42:15)

14:23:46.12  info   λ POST /api/posts
Created post id=123

Color Scheme

Element Color
Level fatal red bold
Level error red
Level warn yellow
Level info dim
Status 5xx red
Status 4xx yellow
Status 3xx cyan
Status 2xx green
Message (error/fatal) red
Message (warning) yellow
Message (info) dim

@adriancooney adriancooney requested a review from a team as a code owner January 28, 2026 11:13
@changeset-bot
Copy link

changeset-bot bot commented Jan 28, 2026

🦋 Changeset detected

Latest commit: fce7669

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

📦 CLI Tarball Ready

The Vercel CLI tarball for this PR is now available!

Quick Test

You can test this PR's CLI directly by running:

npx https://vercel-nkljaok3a.vercel.sh/tarballs/vercel.tgz --help

Use in vercel.json

To use this CLI version in your project builds, add to your vercel.json:

{
  "build": {
    "env": {
      "VERCEL_CLI_VERSION": "vercel@https://vercel-nkljaok3a.vercel.sh/tarballs/vercel.tgz"
    }
  }
}

@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

🧪 Unit Test Strategy

Comparing: e0cca0efce7669 (view diff)

Strategy: Affected packages only

✅ Only testing packages that have been modified or depend on modified packages.

Affected packages - 1 (2%)
  1. vercel
Unaffected packages - 40 (98%)
  1. @vercel-internals/get-package-json
  2. @vercel/backends
  3. @vercel/build-utils
  4. @vercel/cervel
  5. @vercel/cli-auth
  6. @vercel/client
  7. @vercel/config
  8. @vercel/detect-agent
  9. @vercel/edge
  10. @vercel/elysia
  11. @vercel/error-utils
  12. @vercel/express
  13. @vercel/fastify
  14. @vercel/firewall
  15. @vercel/frameworks
  16. @vercel/fs-detectors
  17. @vercel/functions
  18. @vercel/gatsby-plugin-vercel-builder
  19. @vercel/go
  20. @vercel/h3
  21. @vercel/hono
  22. @vercel/hydrogen
  23. @vercel/introspection
  24. @vercel/koa
  25. @vercel/nestjs
  26. @vercel/next
  27. @vercel/node
  28. @vercel/oidc
  29. @vercel/oidc-aws-credentials-provider
  30. @vercel/python
  31. @vercel/python-analysis
  32. @vercel/redwood
  33. @vercel/related-projects
  34. @vercel/remix-builder
  35. @vercel/routing-utils
  36. @vercel/ruby
  37. @vercel/rust
  38. @vercel/static-build
  39. @vercel/static-config
  40. examples

Results

  • Unit tests: Only affected packages will run unit tests
  • E2E tests: Handled separately (Version Packages PRs or run-e2e-tests label)
  • Type checks: Only affected packages will run type checks

This comment is automatically generated based on the affected testing strategy

@adriancooney adriancooney force-pushed the adriancooney/logsv2-compact-output branch from 9828c2c to a3694ab Compare January 28, 2026 14:54
- Print header row (TIME, LVL, METHOD, STS, S, PATH, MESSAGE)
- Consistent column widths with proper alignment
- Dynamically adjust PATH and MESSAGE columns based on terminal width
- Truncate long paths from the left (…/long/path)
- Reorder: TIME, LEVEL, S, METHOD, PATH, STATUS, MESSAGE
- Lowercase level labels: info, warn, err, fatl
- Full words in header: LEVEL, STATUS
- Full level names: info, warn, error, fatal
- Remove S and METHOD from header, just use PATH
- Don't truncate path, show full path
- Add source type legend to help: λ=serverless, ε=edge, ◇=static
- Single space between source icon and method
- Variable method width based on actual methods in data
- Collect all logs first to calculate max method width
- Build output lines programmatically with cols.join()
- Fix alignment issues between STATUS and MESSAGE
- If all logs are from the same day, show time only (HH:mm:ss.SS)
- If logs span multiple days, show date and time (MMM dd HH:mm:ss)
- Header changes from TIME to DATE/TIME accordingly
- Date format now includes milliseconds: MMM dd HH:mm:ss.SS
- PATH header indented to align with method column (after source icon)
Introduces a typed table() function that handles column width calculation,
padding, truncation, and formatting. Columns define getValue() for data
extraction and optional format() for styling. Table-level formatHeader()
and formatRow() hooks enable custom output transformations.
The API returns logs in a different format than RequestLogEntry:
- requestId instead of id
- statusCode instead of responseStatusCode
- logs[] and events[] arrays for level/message/source
Address PR feedback: contextName showed user's current team instead
of the project's team. Now shows project name which is clearer.
Shows project as org/project-slug with link, matching other CLI commands.
@adriancooney adriancooney force-pushed the adriancooney/logsv2-compact-output branch from 4b919bd to fce7669 Compare January 30, 2026 11:54
@adriancooney adriancooney merged commit aa79f2e into main Jan 30, 2026
126 checks passed
@adriancooney adriancooney deleted the adriancooney/logsv2-compact-output branch January 30, 2026 17:49
jeffsee55 pushed a commit that referenced this pull request Feb 3, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@50.10.0

### Minor Changes

- feat(cli): Add webhooks command for managing webhooks
([#14789](#14789))

Adds a new `webhooks` command to the Vercel CLI with the following
subcommands:

- `webhooks ls` - List all webhooks with optional `--format json` output
- `webhooks get <id>` - Get details of a specific webhook with optional
`--format json` output
- `webhooks create <url> --event <event>` - Create a new webhook with
specified events
- `webhooks rm <id>` - Remove a webhook with `--yes` flag to skip
confirmation

Webhook event types are fetched dynamically from the OpenAPI spec to
stay in sync with the API.

- Added experimental services support in the CLI new project flow. When
`VERCEL_USE_EXPERIMENTAL_SERVICES=1` is set and a project's
`vercel.json` contains `experimentalServices`, the CLI will detect and
display the configured services during project setup, automatically
selecting the "services" framework preset.
([#14776](#14776))

### Patch Changes

- Improve logsv2 command output format with compact single-line display,
text-based level labels, dynamic column widths, and smart date display
([#14767](#14767))

- Skip update check when running on Vercel to prevent unnecessary worker
spawning in build container
([#14794](#14794))

- fix --help exit codes for marketplace commands
([#14834](#14834))

- Updated dependencies
\[[`687f73cebb6ae1cdd7c7feb0910967de99a17ad6`](687f73c),
[`e7c5d5fd41e124ef7314978b351696d130e89917`](e7c5d5f),
[`c3104a1ae9dbf9048e08bb2fa85605a95b254876`](c3104a1),
[`b029736b4be8dac135bef77283f47e1450faf0a9`](b029736),
[`d36c1ad3ddaf9303041e61a0a41d973b02007988`](d36c1ad),
[`5b31b133970539986ff9e98013d2c364536bd0b5`](5b31b13)]:
    -   @vercel/next@4.15.21
    -   @vercel/python@6.5.0
    -   @vercel/remix-builder@5.5.10
    -   @vercel/backends@0.0.25
    -   @vercel/static-build@2.8.28
    -   @vercel/node@5.5.28
    -   @vercel/express@0.1.36

## @vercel/python@6.5.0

### Minor Changes

- vendor Python runtime dependencies
([#14827](#14827))

- Bump vercel-runtime version automatically on its releases
([#14842](#14842))

## @vercel/python-analysis@0.3.0

### Minor Changes

- initial implementation of Python semantic analysis in Rust
([#14690](#14690))

## @vercel/backends@0.0.25

### Patch Changes

- Improve handling of cjs/esm interop during imports
([#14798](#14798))

## @vercel/cervel@0.0.12

### Patch Changes

- Improve handling of cjs/esm interop during imports
([#14798](#14798))

- Updated dependencies
\[[`d36c1ad3ddaf9303041e61a0a41d973b02007988`](d36c1ad)]:
    -   @vercel/backends@0.0.25

## @vercel/express@0.1.36

### Patch Changes

- Updated dependencies
\[[`d36c1ad3ddaf9303041e61a0a41d973b02007988`](d36c1ad)]:
    -   @vercel/cervel@0.0.12
    -   @vercel/node@5.5.28

## @vercel/fs-detectors@5.7.20

### Patch Changes

- Added experimental services support in the CLI new project flow. When
`VERCEL_USE_EXPERIMENTAL_SERVICES=1` is set and a project's
`vercel.json` contains `experimentalServices`, the CLI will detect and
display the configured services during project setup, automatically
selecting the "services" framework preset.
([#14776](#14776))

## @vercel/functions@3.4.1

### Patch Changes

- Fix InMemoryCache to use JSON serialization for consistency with
RuntimeCache ([#14751](#14751))

InMemoryCache now serializes values with `JSON.stringify()` on set and
deserializes with `JSON.parse()` on get, matching the behavior of
RuntimeCache. This ensures consistent behavior when switching between
cache implementations (e.g., in-memory for development, remote for
production), particularly for types that don't survive JSON round-trips
like `Date`, `Map`, `Set`, and `undefined`.

## @vercel/introspection@0.0.11

### Patch Changes

- Updated dependencies
\[[`d36c1ad3ddaf9303041e61a0a41d973b02007988`](d36c1ad)]:
    -   @vercel/backends@0.0.25

## @vercel/next@4.15.21

### Patch Changes

- Strip routes-manifest.json for determinism
([#14783](#14783))

- Update Next.js adapter version
([#14801](#14801))

## @vercel/remix-builder@5.5.10

### Patch Changes

- [remix] Prevent 404 responses from being cached with immutable headers
([#14828](#14828))

## @vercel/python-runtime@0.3.0

### Minor Changes

- vendor Python runtime dependencies
([#14827](#14827))

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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