×

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

Bi-monthly release with minor bug fixes and improvements

How to log

  • Posts: 3
  • Thank you received: 0

How to log was created by Nathan

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
3 months 1 week ago #98142

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

Replied by Jasem Mutlaq on topic How to log

You control debugging in Ekos main window --> Logs
3 months 1 week ago #98144

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

  • Posts: 3
  • Thank you received: 0

Replied by Nathan on topic How to log

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
3 months 1 week ago #98164

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

Replied by Jasem Mutlaq on topic How to log

1. addDebugControl() is already called by the base class, so you don't need to call explicitly.
2. That's normal, don't delete folder when KStars is already running :-)
3. Odd, check driver and check that "Driver Debug" is checked.

The following user(s) said Thank You: Nathan
3 months 1 week ago #98165
Attachments:

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

  • Posts: 3
  • Thank you received: 0

Replied by Nathan on topic How to log

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
3 months 1 week ago #98216

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

Time to create page: 0.575 seconds