rohc_debug

Asked by Friedrich on 2014-04-01

Hi,

I am wondering if there is a setting that can make rohc_debug print to a file (e.g., my_trace.txt) rather than print on the screen? What's more, is there a way to turn off the debug print? I tried to play with it but no luck.
typedef enum
{
 ROHC_TRACE_DEBUG = 0,
 ROHC_TRACE_INFO = 1,
 ROHC_TRACE_WARNING = 2,
 ROHC_TRACE_ERROR = 3,
 ROHC_TRACE_LEVEL_MAX
} rohc_trace_level_t

Thanks!

Question information

Language:
English Edit question
Status:
Answered
For:
rohc Edit question
Assignee:
No assignee Edit question
Last query:
2014-06-30
Last reply:
2014-06-30

Hello,

Use the rohc_comp_set_traces_cb() function to define a function callback that will handle the traces of the ROHC compressor.
Use the rohc_decomp_set_traces_cb() function to define a function callback that will handle the traces of the ROHC decompressor.

doc for rohc_comp_set_traces_cb():
https://rohc-lib.org/support/documentation/API/rohc-doc-1.6.1/rohc__comp_8h.html#affa6d3ce4976d53b13dc1193d6d4c66d

doc for rohc_decomp_set_traces_cb():
https://rohc-lib.org/support/documentation/API/rohc-doc-1.6.1/rohc__decomp_8h.html#a6fb60f5bcaa453af00047d048b750b07

Example of usage:
http://bazaar.launchpad.net/~didier-barvaux/rohc/1.6.x/view/head:/test/non_regression/test_non_regression.c#L1019
http://bazaar.launchpad.net/~didier-barvaux/rohc/1.6.x/view/head:/test/non_regression/test_non_regression.c#L1455

Regards,
Didier

Friedrich (hitlbs) said : #3

Hi Didier,

Thanks for your message. I remember that there is a macro definition in version 1.3 like this:
/* Debug level for ROHC library */
/* levels 0,1,2,3 -1 to disable */
#define ROHC_DEBUG_LEVEL -1

So that one could easily turn on/off the debug prints.

Can you please make the switch available for the latest version such as version 1.6.1?

Thanks a lot!
Friedrich

Hi,

> Can you please make the switch available for the latest version such as version 1.6.1?

Sorry, I won't. Since the ROHC library version 1.6.0, the verbosity of the ROHC library is not configurable at compile any more. It was not dynamic enough. The verbosity is now entirely configurable at runtime. When you create a ROHC compressor or decompressor, you specify a callback function. This function will be able to print the traces or to not print them depending on many factors: the verbosity level of your program, the trace severity, the (de)compression profile, and so on...

Regards,
Didier

Can you help with this problem?

Provide an answer of your own, or ask Friedrich for more information if necessary.

To post a message you must log in.