-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(formatter): Add newline between log events when format string is empty (fixes #136). #137
Conversation
WalkthroughThe changes made in the Changes
Assessment against linked issues
Warning Rate limit exceeded@davemarco has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 9 minutes and 35 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
src/services/formatters/YscopeFormatter/index.ts (1)
43-43
: Add missing semicolon to maintain consistency, ehThe linter detected a missing semicolon at the end of the line.
- return `${jsonValueToString(logEvent.fields)}\n` + return `${jsonValueToString(logEvent.fields)}\n`;🧰 Tools
🪛 eslint
[error] 43-44: Missing semicolon.
(@stylistic/js/semi)
🪛 GitHub Check: lint-check
[failure] 43-43:
Missing semicolon
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
src/services/formatters/YscopeFormatter/index.ts
(1 hunks)
🧰 Additional context used
🪛 eslint
src/services/formatters/YscopeFormatter/index.ts
[error] 43-44: Missing semicolon.
(@stylistic/js/semi)
🪛 GitHub Check: lint-check
src/services/formatters/YscopeFormatter/index.ts
[failure] 43-43:
Missing semicolon
🔇 Additional comments (1)
src/services/formatters/YscopeFormatter/index.ts (1)
43-43
: The fix looks good, eh!
The addition of the newline character effectively resolves the issue of concatenated JSON events. The implementation is consistent with how newlines are handled elsewhere in the formatter.
Let's verify the fix with a test file:
✅ Verification successful
Beauty of a fix, eh! All checks are passing
The implementation looks solid as a rock. The jsonValueToString
function is properly imported and used consistently across the codebase. The newline character addition ensures proper event separation, and the function handles JSON formatting appropriately. No issues found with the implementation.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Create a test file with multiple JSON events and verify newline separation
echo '{"event": "test1", "level": "info"}' > test.jsonl
echo '{"event": "test2", "level": "warn"}' >> test.jsonl
cat test.jsonl
Length of output: 178
Script:
#!/bin/bash
# Let's verify the actual implementation of jsonValueToString and its usage
ast-grep --pattern 'function jsonValueToString'
# Also check for any other usage of jsonValueToString
rg "jsonValueToString" -A 2
Length of output: 1821
🧰 Tools
🪛 eslint
[error] 43-44: Missing semicolon.
(@stylistic/js/semi)
🪛 GitHub Check: lint-check
[failure] 43-43:
Missing semicolon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry for missing this in the previous PR. i validated with customer log files and can confirm now the syntax highlighting is back working together with the log event index lookup.
Description
Fixes #136 - all json events were concatenated together when format string is empty.
Missed during testing as test case was too narrow.
Validation performed
Tested with large jsonl file and logs were seperated by newline.
Summary by CodeRabbit