Skip to content

Conversation

@andylokandy
Copy link
Collaborator

@andylokandy andylokandy commented Dec 11, 2025

Closes #18

@andylokandy andylokandy changed the title feat: output format feat: customize output format Dec 11, 2025
Copy link

Copilot AI left a 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 support for customizing the output format of logged return values through a new output parameter in the #[logcall] macro. Users can now specify custom format strings for return values or suppress them entirely by providing an empty string. The implementation follows the same patterns as the existing input parameter for customizing input formatting.

Key changes:

  • Added output_format field to all Args enum variants and associated parsing logic
  • Modified gen_log function to conditionally include return value based on format string content
  • Changed default log level from "info" to "debug" (unrelated to output formatting feature)

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/lib.rs Core implementation: added output_format parameter handling, updated gen_log to support custom output formats, changed default log level to "debug"
tests/ui/ok/output.rs Added compilation tests for custom output format (" output = {}") and suppressed output ("")
examples/main.rs Added examples demonstrating custom output format (": {:?}") and omitted output ("")
README.md Updated documentation with new output customization examples and refreshed sample output with current timestamps

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

} else {
Ok(Args::Simple {
level: simple_level.unwrap_or_else(|| "info".to_string()),
level: simple_level.unwrap_or_else(|| "debug".to_string()),
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

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

The default log level has been changed from "info" to "debug". While this change is reflected in the documentation, it represents a behavioral change that is not directly related to the stated purpose of this PR (customizing output format). This could be a breaking change for users who rely on the default "info" level. Consider either reverting this change and making it part of a separate PR, or explicitly documenting this breaking change in the PR description.

Suggested change
level: simple_level.unwrap_or_else(|| "debug".to_string()),
level: simple_level.unwrap_or_else(|| "info".to_string()),

Copilot uses AI. Check for mistakes.
@andylokandy andylokandy merged commit 762407c into fast:main Dec 11, 2025
11 checks passed
@andylokandy andylokandy deleted the issue-18 branch December 11, 2025 15:25
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.

[Feature request] Allow skipping arguments and return values

1 participant