Skip to content

feat: better I.grab logging in live interactive mode #4986

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

Merged
merged 3 commits into from
May 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/pause.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,12 @@ async function parseInput(cmd) {
output.print(output.styles.success(' OK '), cmd)
}
if (cmd?.startsWith('I.grab')) {
output.print(output.styles.debug(val))
try {
Copy link
Preview

Copilot AI May 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment here to explain that JSON.stringify is applied to handle various output types for improved readability.

Suggested change
try {
try {
// Use JSON.stringify to format the output for improved readability, especially for complex objects.

Copilot uses AI. Check for mistakes.

output.print(output.styles.debug(JSON.stringify(val, null, 2)))
} catch (err) {
output.print(output.styles.error(' ERROR '), 'Failed to stringify result:', err.message)
output.print(output.styles.error(' RAW VALUE '), String(val))
}
}

history.push(cmd) // add command to history when successful
Expand Down
Loading