Skip to content

Custom log support via callback #51

Description

@jakobhu

Is there a way to capture log information from the internal Clarabel solver?
It seems that the rust backend is reporting via std::io::Result<()> - not sure how to capture that from C++.

That is - I would like to acquire the iteration information (pres, dres, etc.) - with the intention of displaying it myself. A callback with a string is how many third-party packages support that.

I've tried to tie with 'stdout' - but that is not very robust, and especially problematic on Windows.

Activity

  1. goulart-paul commented on Feb 6, 2025

    @goulart-paul
    Member

    Does #55 do what you want?

    It's not straightforward to enable very general callback functions or configuration of streams across the C++/Rust boundary, or at least I don't know how to do so. The PR in #55 allows configuration of the solver to direct output to either stdout, a file, or an internal buffer which can then be recovered as a string. Examples here and here.

    Internally in rust (oxfordcontrol/Clarabel.rs#160) I also implemented redirects to more general streams (e.g. TcpSocket would probably work), but without associated wrappers here.

  2. goulart-paul commented on Mar 6, 2025

    @goulart-paul
    Member

    Closing since #55 has been merged and I think addresses the issue. Please reopen if not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions