Skip to content

feat(log): enable info level logs for production#3798

Closed
TheodoreSpeaks wants to merge 1 commit intostagingfrom
feat/info-logging
Closed

feat(log): enable info level logs for production#3798
TheodoreSpeaks wants to merge 1 commit intostagingfrom
feat/info-logging

Conversation

@TheodoreSpeaks
Copy link
Collaborator

Summary

Currently we only log errors. This makes it hard to tell happy-path cases or trace specific requests that don't emit errors.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

Validated that server-side logs are not being sent to the frontend.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • [ x] No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel
Copy link

vercel bot commented Mar 27, 2026

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

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Mar 27, 2026 1:17am

Request Review

@TheodoreSpeaks
Copy link
Collaborator Author

@cursor @greptile review

@cursor
Copy link

cursor bot commented Mar 27, 2026

CI failure was related to this PR, and it’s now fixed.

What failed

@sim/logger#lint:check in CI failed on packages/logger/src/index.test.ts due to Biome rules:

  • lint/suspicious/noPrototypeBuiltins
  • lint/performance/noDelete

Fix applied

Updated the new test code to comply with Biome:

  • Replaced Object.prototype.hasOwnProperty.call(...) with Object.hasOwn(...)
  • Replaced delete ... usages with ... = undefined assignments in test env cleanup/setup paths

Validation run locally

In packages/logger:

  • bun run lint:check
  • bun test ./src/index.test.ts ✅ (21 pass, 0 fail)

Git updates

Also, because this run required installing Bun/dependencies in the cloud environment, you may want to run an env setup agent so future agents don’t repeat setup work.

Suggested prompt for env setup agent:

“Update our cloud agent environment so Bun 1.3.11 is preinstalled and repository dependencies are prewarmed for this monorepo (/workspace, bun.lock), ensuring bun run lint:check and package-level tests can run immediately without bootstrap.”

Open in Web Open in Cursor 

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 27, 2026

Greptile Summary

This PR changes the default production log level in packages/logger/src/index.ts from ERROR to INFO, enabling INFO, WARN, and ERROR logs in production while continuing to suppress DEBUG logs. The motivation is improved observability on the happy path without relying solely on error events.\n\nKey details:\n- Only getMinLogLevel() is modified; all other logger logic is unchanged.\n- The existing guard in shouldLog() (typeof window !== 'undefined' check) already prevents any logs from reaching the browser in production, so there is no client-side log-exposure risk.\n- The LOG_LEVEL environment variable override still works, allowing operators to dial down to ERROR-only or up to DEBUG without a code change.\n- The comment in getMinLogLevel() is correctly updated to match the new default.

Confidence Score: 5/5

Safe to merge — a one-line behavioural change with clear intent, correct implementation, and no client-side exposure risk.

The change is minimal and well-understood: it raises the production minimum log level from ERROR to INFO. The client-side guard (window !== undefined) already existed and prevents leaking logs to the browser. No new logic paths are introduced, and the LOG_LEVEL env var escape hatch is preserved. No issues found.

No files require special attention.

Important Files Changed

Filename Overview
packages/logger/src/index.ts Changes production default log level from ERROR to INFO; existing window-check guard already prevents client-side logs in production

Reviews (2): Last reviewed commit: "feat(log): enable info level logs for pr..." | Re-trigger Greptile

@TheodoreSpeaks TheodoreSpeaks marked this pull request as ready for review March 27, 2026 02:03
@cursor
Copy link

cursor bot commented Mar 27, 2026

PR Summary

Low Risk
Low risk: changes only the default production logging threshold, which may increase log volume but doesn’t affect control flow or security-sensitive logic.

Overview
Production logging in @sim/logger now defaults to INFO (instead of ERROR), so info/warn messages are emitted in production unless overridden via LOG_LEVEL.

Written by Cursor Bugbot for commit 2852fca. This will update automatically on new commits. Configure here.

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