Skip to content
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

Is there a corresponding log c++API provided for cyclonedds cxx #2015

Open
usstmiracle opened this issue May 30, 2024 · 1 comment
Open

Is there a corresponding log c++API provided for cyclonedds cxx #2015

usstmiracle opened this issue May 30, 2024 · 1 comment

Comments

@usstmiracle
Copy link

As for cyclonedds-cxx
Is there a similar log API and how should it be used?
Is there an example of how to use the C++version log


struct dds_log_data {
  uint32_t priority;
  const char *file;
  uint32_t line;
  const char *function;
  const char *message;
};

typedef struct dds_log_data dds_log_data_t;

dds_return_t dds_set_log_sink(dds_log_write_fn_t *, const void *);
dds_return_t dds_set_trace_sink(dds_log_write_fn_t *, const void *);```
@eboasson
Copy link
Contributor

Hi @usstmiracle, there is no such API for C++. It is also not really part of the Cyclone Application Programming Interface, but we did decide to make it publicly visible because it can come in really handy sometimes.

You should be able to do #include "dds/ddsrt/log.h" from C++ (the extern "C" bits are in place) and then you can use it just fine directly from C++.

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

No branches or pull requests

2 participants