-
-
Notifications
You must be signed in to change notification settings - Fork 368
Add more debug log info for query #3509
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
Conversation
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.
Pull Request Overview
This PR adds additional debug logging in the query processing workflow to help trace query handling and plugin operations.
- Added debug logs to mark the start of a query and to log query details, including text, action keyword, and raw query.
- Included logging for valid plugins, plugin querying wait times, and updating the query results.
- Added logging to indicate when old query results are cleared.
Comments suppressed due to low confidence (1)
Flow.Launcher/ViewModel/MainViewModel.cs:1262
- [nitpick] While the use of angle brackets around plugin names helps emphasize the values, ensure that a consistent and clear log format is maintained throughout all log messages for better readability.
var validPluginNames = plugins.Select(x => $"<{x.Metadata.Name}>");
This comment has been minimized.
This comment has been minimized.
🥷 Code experts: onesounds Jack251970, onesounds have most 👩💻 activity in the files. See details
Activity based on git-commit:
Knowledge based on git-blame: To learn more about /:\ gitStream - Visit our Docs |
Be a legend 🏆 by adding a before and after screenshot of the changes you made, especially if they are around UI/UX. |
📝 WalkthroughWalkthroughThis change adds comprehensive debug logging to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant MainViewModel
participant App.API
participant Plugins
User->>MainViewModel: Initiate query
MainViewModel->>App.API: LogDebug (start query)
alt Query is null
MainViewModel->>App.API: LogDebug (clear results)
MainViewModel->>MainViewModel: Clear results
else
MainViewModel->>App.API: LogDebug (start with action keyword)
MainViewModel->>Plugins: Identify valid plugins
MainViewModel->>App.API: LogDebug (valid plugin count and names)
loop For each plugin
MainViewModel->>App.API: LogDebug (waiting for plugin)
MainViewModel->>Plugins: Query plugin
MainViewModel->>App.API: LogDebug (update results)
end
MainViewModel->>App.API: LogDebug (remove old results if needed)
end
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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 (
|
@check-spelling-bot Report🔴 Please reviewSee the 📂 files view, the 📜action log, or 📝 job summary for details.
See ❌ Event descriptions for more information. If the flagged items are 🤯 false positivesIf items relate to a ...
|
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
♻️ Duplicate comments (2)
Flow.Launcher/ViewModel/MainViewModel.cs (2)
1333-1333
: Assess log noise in per-plugin wait messages.Repeated logs like
Wait for querying plugin <{plugin.Metadata.Name}>
in tight loops can generate excessive output under heavy query loads. Consider toggling this level to Trace or gating it behind a verbose flag.
[past_review_comments]
1373-1373
: Evaluate necessity of per-plugin update logs.
App.API.LogDebug(ClassName, $"Update results for plugin <{plugin.Metadata.Name}>")
may flood logs when many plugins return results. You might merge this with the earlier plugin list log or demote the level if fine-grained tracing isn’t always required.
[past_review_comments]
🧹 Nitpick comments (5)
Flow.Launcher/ViewModel/MainViewModel.cs (5)
1218-1218
: Guard debug log interpolation to avoid unnecessary overhead.The call
App.API.LogDebug(ClassName, $"Start query with text: <{QueryText}>")
unconditionally performs string interpolation even when debug level logging is disabled. To reduce runtime overhead in high-frequency code paths, consider wrapping this in a log-level check or using a lazy/log-friendly API that defers message formatting.
1244-1244
: Consolidate null-query logs for clarity.Logging
"Clear query results"
here duplicates part of the query lifecycle and may be streamlined. Consider combining this message with the earlier null-check log or enhancing it to include context (e.g., reason for null), so you avoid multiple disjointed debug entries.
1240-1240
: Avoid redundant start-query logs.You now log both the raw query text and then immediately log the
ActionKeyword
andRawQuery
. These could be merged into a single log statement:App.API.LogDebug(ClassName, $"Begin query: ActionKeyword={query.ActionKeyword}, RawQuery={query.RawQuery}");
This reduces log volume and simplifies trace reading.
1262-1263
: Refine plugin count log formatting.The message
Valid <{plugins.Count}> plugins: {string.Join(" ", validPluginNames)}
includes angle brackets around the count, which may confuse readers. A clearer format might be:App.API.LogDebug(ClassName, $"Valid plugins ({plugins.Count}): {string.Join(", ", plugins.Select(p => p.Metadata.Name))}");This improves readability of debug outputs.
1464-1464
: Enhance old-results removal logging with context.The log
Remove old results
doesn’t indicate whichActionKeyword
changed. To aid troubleshooting, include both the previous and new keywords, e.g.:-App.API.LogDebug(ClassName, "Remove old results"); +App.API.LogDebug(ClassName, + $"Removed old results; ActionKeyword changed from '{_lastQuery?.ActionKeyword}' to '{query.ActionKeyword}'");This additional context improves traceability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
Flow.Launcher/ViewModel/MainViewModel.cs
(6 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
- GitHub Check: gitStream workflow automation
- GitHub Check: gitStream.cm
- GitHub Check: gitStream.cm
- GitHub Check: build
When querying with
e
, we will get more debug info.This can help us resolve #3508, etc.