X2 Standard  Version 1.24
Public Member Functions | List of all members
LoggerInterface Class Referenceabstract

The LoggerInterface is a cross-platform logging utility passed to X2 implementors to show real-time, driver logging information in TheSkyX.
More...

#include <loggerinterface.h>

Public Member Functions

virtual int out (const char *szLogThis)=0
 
virtual void packetsRetriesFailuresChanged (const int &p, const int &r, const int &f)=0
 

Detailed Description

The LoggerInterface is a cross-platform logging utility passed to X2 implementors to show real-time, driver logging information in TheSkyX.

This interface is probably most useful while developing and debugging an x2 driver. To a lesser extent it can also be used to help customers troubleshoot driver related issues, but only when absolutely necessary. In other words, x2 drivers should work out-of-the-box and customers should not to have enabling logging and or wade through logs to help find and fix issues, although in rare circumstances, this might be necessary.

To enable logging, an x2 driver must respond appropriately to queryAbstraction() when queried for logger interface. Please see the x2dome example for sample code on how to respond to queryAbstraction:

int X2Dome::queryAbstraction(const char* pszName, void** ppVal)
{

...

//Add support for the optional LoggerInterface
if (!strcmp(pszName, LoggerInterface_Name))
*ppVal = GetLogger();

...

}

where GetLogger() returns a pointer to the LoggerInterface passed in the constructor;

and how to send output to the TheSkyX's logging window:

int X2Dome::dapiGetAzEl(double* pdAz, double* pdEl)
{
X2DomeMutexLocker ml(m_pIOMutex);
if (GetLogger())
GetLogger()->out("X2Dome::dapiGetAzEl");

An x2 implementor might choose to only support the logger interface in debug or special builds and not for release builds. In any case, it is acceptable to leave in your code all the logger output calls as they are very efficient and don't actively do something unless 1) queryAbstraction enables logging and 2) the customer has displayed the corresponding logging window in TheSkyX.

TheSkyX's user interface will not give an option to show a logging window unless the underlining x2 driver responds to queryAbstraction() appropriately above.

This interface is optional.

Dome logging requires TheSkyX build 4767 and later (mount logging has been present since TheSkyX's inception).

See TheSkyXFacadeForDriversInterface::build() to determine the build of TheSky in use an act accordingly based on your requirements.

Tested and works on Windows, Mac, Ubuntu Linux.

Member Function Documentation

◆ out()

virtual int LoggerInterface::out ( const char *  szLogThis)
pure virtual

Have a string logged in TheSkyX's Communication Log window.

◆ packetsRetriesFailuresChanged()

virtual void LoggerInterface::packetsRetriesFailuresChanged ( const int &  p,
const int &  r,
const int &  f 
)
pure virtual

Return the number of packets, retries and failures associated with device io if appropriate.


The documentation for this class was generated from the following file:
X2Dome::queryAbstraction
virtual int queryAbstraction(const char *pszName, void **ppVal)
Definition: x2dome.cpp:350
X2DomeMutexLocker
Definition: x2dome.cpp:16
X2Dome::dapiGetAzEl
virtual int dapiGetAzEl(double *pdAz, double *pdEl)
Definition: x2dome.cpp:150
X2 Examples
(C) Software Bisque, Inc. All rights reserved.