Skip to content

Conversation

@magaylor
Copy link
Contributor

Changes in this pull request

This PR sets up file logging in the bindings code so that bindings can utilize and configure the Rust logs

Checklist

  • [ X] This PR represents a single feature, fix, or change.
  • [X ] All applicable changes have been documented.
  • [X ] Any TO DO items (or similar) have been entered as GitHub issues and the link to that issue has been included in a comment.

@magaylor magaylor changed the title feat(sdk): Introduce new API to for file logging in the bindings feat(sdk): Introduce new API for file logging in the bindings Oct 29, 2025
@gpeacock
Copy link
Collaborator

Great suggestion! What if we provided this functionality via a field in settings? I'm trying to keep the C_api as minimal as possible for stability. If we did provide a function for this, I'd more likely go for a stream so this can go anywhere you want it.

@magaylor
Copy link
Contributor Author

magaylor commented Oct 31, 2025

I like that idea too!

When I wrote this, I assumed there was a better place for it than C_API, as logging to a file (or stream) should not be restricted to the clients consuming the bindings. If you want to reject this and plan to add it to the settings, that works for me.

My team may just use a forked build in the meantime so asking me to debug the Rust isn't the only way to figure out what's happening in the .NET layer. I would be happy to make the contribution myself, but with recent changes to the Settings, I figured this may want to be more planned.

My goal with these recent PRs to the C_API has been to bring its functionality up to match the CLI in areas my team found it was behind. I believe that you can configure console logging from the CLI. That is why I added a PR for Certificate Retrieval from the reader as well, our validator tool has to consume the CLI to retrieve the certificates without a method in the C_API.

@gpeacock
Copy link
Collaborator

I'll file an issue to add this functionality to settings and link it to this issue. I like the exercise of finding any c2patool functionality that cannot be accessed via the c_api. Please keep us updated on what you find!

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.

2 participants