Skip to content

Use tslog LogLevel for frontend logging - #112

Open
iloveitaly wants to merge 2 commits into
masterfrom
cursor/tslog-default-log-levels-212d
Open

iloveitaly wants to merge 2 commits into
masterfrom
cursor/tslog-default-log-levels-212d

Conversation

@iloveitaly

Copy link
Copy Markdown
Owner

Motivation

tslog now exports its default log levels (DefaultLogLevels in 4.11.0 / PR #308, LogLevel in v5). We were still maintaining a local numeric map and a TODO for that PR.

Description

  • Configure the frontend logger with LogLevel.WARN / LogLevel.INFO instead of a copied LOG_LEVEL_MAP.
  • Apply VITE_LOG_LEVEL through setMinLevel(), which resolves names case-insensitively.
  • Implement isDebugEnabled() with isLevelEnabled(LogLevel.DEBUG).
  • Move prettyLogTemplate / hideLogPositionForProduction onto the v5 pretty and stack groups so those settings actually apply on tslog 5.

Screenshots / Test

Unit tests in web/app/configuration/logging.test.ts.

Links

Open in Web Open in Cursor 

cursoragent and others added 2 commits September 5, 2026 13:46
tslog now exports default levels (PR #308, LogLevel in v5). Drive minLevel,
VITE_LOG_LEVEL, and isDebugEnabled through that API, and move the pretty
template onto the v5 settings group so it actually applies.

Co-authored-by: Michael Bianco <mike@mikebian.co>
Uppercase the env value before setMinLevel so it matches the exported
level names, and keep prettier import order consistent.

Co-authored-by: Michael Bianco <mike@mikebian.co>
@iloveitaly
iloveitaly marked this pull request as ready for review September 5, 2026 13:48
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.

2 participants