Skip to content

Refactor log level parsing using UnmarshalText#5989

Open
evildao wants to merge 1 commit into
usememos:mainfrom
evildao:main
Open

Refactor log level parsing using UnmarshalText#5989
evildao wants to merge 1 commit into
usememos:mainfrom
evildao:main

Conversation

@evildao

@evildao evildao commented May 29, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@evildao evildao requested a review from a team as a code owner May 29, 2026 05:45
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f67938a6-5dfa-42af-8857-af077c4a8926

📥 Commits

Reviewing files that changed from the base of the PR and between 7c3bff4 and 28c2720.

📒 Files selected for processing (1)
  • cmd/memos/log.go

📝 Walkthrough

Walkthrough

The PR refactors parseSlogLevel to use slog.Level.UnmarshalText for parsing log level strings instead of implementing manual parsing with strings.ToLower and a switch statement. The strings import was removed as it is no longer needed.

Changes

Log level parsing refactoring

Layer / File(s) Summary
Standard library log level parsing
cmd/memos/log.go
parseSlogLevel now delegates to slog.Level.UnmarshalText for validation, with error handling using errors.Errorf, and the unused strings import was removed.
🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning No pull request description was provided by the author, which fails the requirement for related documentation of the changeset. Add a pull request description explaining the motivation for the refactor, such as improved maintainability or adherence to standard library patterns.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: refactoring log level parsing to use UnmarshalText instead of manual string parsing.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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