×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

How to get if a specific DEBUG Level is active?

  • Posts: 72
  • Thank you received: 21
I would like to have a specific debug level to use within my drivers.
First one I use addDebugLevel() successfully;
I can check with isDebug() if Debug is active or not, good
But How could I check to know if a specific Debug level is active? like the new I create.

In my drivers I would like to be able to activate TTY Debug with the function "tty_set_debug(true)" but only if the Debug level I've created is (DBG_TTY) is active.
Something like :
//ctor
int DBG_TTY = addDebugLevel("TTY Verbose", "TTY");
....
::connect()
{
tty_set-debug(DBG_TTY);
....
How to do that? How to take the checkbox status?
Philippe Besson
Skywatcher HEQ5, Televue 101-IS, Takahashi FS-60CB
Focus Boss II with OptecInc TCF-S focuser and Starlight Instruments HSM20 handy stepper motor
Guiding camera ZWO ASI120MM
Filterwheel OptecInc IFW
Camera not set yet
Switzerland
7 years 6 months ago #10526

Please Log in or Create an account to join the conversation.

Write your debug statements as usual, and if DBG_TTY is not active, then nothing is written for it. Same thing for WARNING, DEBUG..etc, I could be writng DBG_DEBUG but if it is not active, then nothing is displayed or logged to the file.
7 years 6 months ago #10527

Please Log in or Create an account to join the conversation.

  • Posts: 72
  • Thank you received: 21
Thanks Jasem for your quick answer, but I wouldn't like write a statment but take a different action in my code, depend of the debug level. As in my example, I would set the tty_set-debug actif or not fron the user selection.
Kind regards.
Philippe Besson
Skywatcher HEQ5, Televue 101-IS, Takahashi FS-60CB
Focus Boss II with OptecInc TCF-S focuser and Starlight Instruments HSM20 handy stepper motor
Guiding camera ZWO ASI120MM
Filterwheel OptecInc IFW
Camera not set yet
Switzerland
7 years 6 months ago #10528

Please Log in or Create an account to join the conversation.

Time to create page: 0.825 seconds