Nathan replied to the topic 'How to log' in the forum. 3 months ago

I'm building a driver using the DefaultDevice class and if I don't include addDebugControl(), I don't get the options you highlighted. After including it, I was able to get the options and successfully able to get the debug output. Thanks for your help.

Nathan

Read More...

Nathan replied to the topic 'How to log' in the forum. 3 months ago

Hi Jasem. Thank you for replying. So to clarify, that means it is no longer necessary to add addDebugControl()?

I've discovered the issue though, not sure if you want to make a change.

When I initially start KStars and Ekos, this creates a log folder with the current date and within that, it creates a .txt file with the current time. If I delete the log file and restart Ekos, it creates a new .txt file. However, if I delete the current date folder, it no longer creates log files, nor does it recreate the date folder. You have to close KStars and restart the whole program for it to create a new date folder before logs will start showing back up.

The second log issue I'm having is regarding the actual logging. This is what's in my code:
LOG_DEBUG("Sending Command and recording with LOG_DEBUG");
LOG_INFO("Sending command and recording with LOG_INFO");
LOGF_DEBUG("CMD <%s>", command);

Even though I have Verbose logging enabled, only the INFO is being recorded. Here's the output in my log file:
[2024-01-17T07:18:20.796 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:21.656 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:21.664 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:22.671 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:22.678 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:23.685 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "
[2024-01-17T07:18:23.693 EST INFO ][ org.kde.kstars.indi] - DarkLight Cover/Calibrator : "[INFO] Sending command and recording with LOG_INFO "

Why is DEBUG not being recorded?

Thanks,
Nathan

Read More...

Nathan created a new topic ' How to log' in the forum. 3 months ago

I cannot for the life of me figure out what's going on. I've attempted to follow the Logging in INDI Drivers within the INDI Technical Documentation, which states to call addDebugControl() from within the initProperties(). However, after doing so, when I build the driver and attempt to run, any time I click on Enable Debug, in the INDI message status bar it states Debug is enabled and then immediately Debug is disabled. Now, after searching the forums, it appears logging is handled by Ekos. So does that mean addDebugControl() is no longer needed. When I click on Logs and whether I choose Verbose or Regular and Default or File, I'm not getting log files. Additionally when I was somehow able to create log files, even when set on Verbose, I wasn't seeing the LOGF_DEBUG being written to the file.

Can someone please explain what the right steps are? How do I reliably enable logging?

Thanks,
Nathan

Read More...