sbgECom Library
4.0.1987-stable
C library to interface SBG Systems IMU/AHRS/INS
|
Define and handle error logging for the SBG Systems common C library. More...
#include <sbgDefines.h>
Go to the source code of this file.
Macros | |
#define | SBG_LOG_ERROR_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__) |
#define | SBG_LOG_WARNING_CALL(errorCode, format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, format, ##__VA_ARGS__) |
#define | SBG_LOG_INFO_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__) |
#define | SBG_LOG_DEBUG_CALL(format, ...) sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__) |
Typedefs | |
typedef enum _SbgDebugLogType | SbgDebugLogType |
Enumerations | |
enum | _SbgDebugLogType { SBG_DEBUG_LOG_TYPE_ERROR , SBG_DEBUG_LOG_TYPE_WARNING , SBG_DEBUG_LOG_TYPE_INFO , SBG_DEBUG_LOG_TYPE_DEBUG } |
Functions | |
SBG_INLINE const char * | sbgDebugLogTypeToStr (SbgDebugLogType logType) |
void | sbgDebugHexDump (const char *pPrefix, const void *pBuffer, size_t size) |
Define and handle error logging for the SBG Systems common C library.
The methods defined here should be implemented in sbgPlatform.h/sbgPlatform.c according to your platform and needs.
The MIT license
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SBG_LOG_ERROR_CALL | ( | errorCode, | |
format, | |||
... | |||
) | sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__) |
Log an error with its associated message.
[in] | errorCode | The error code that has thrown this error. |
[in] | format | String litteral for the associated error message (you can use printf like string formating). |
#define SBG_LOG_WARNING_CALL | ( | errorCode, | |
format, | |||
... | |||
) | sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, format, ##__VA_ARGS__) |
Log a warning with its associated message.
[in] | errorCode | The error code that has thrown this warning. |
[in] | format | String litteral for the associated warning message (you can use printf like string formating). |
#define SBG_LOG_INFO_CALL | ( | format, | |
... | |||
) | sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__) |
Log an information message.
[in] | format | String litteral for the information message (you can use printf like string formating). |
#define SBG_LOG_DEBUG_CALL | ( | format, | |
... | |||
) | sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__func__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__) |
Log an information message only in debug mode
[in] | format | String litteral for the information message (you can use printf like string formating). |
typedef enum _SbgDebugLogType SbgDebugLogType |
Enum that identify the type of error / warning that has been thrown.
enum _SbgDebugLogType |
Enum that identify the type of error / warning that has been thrown.
SBG_INLINE const char* sbgDebugLogTypeToStr | ( | SbgDebugLogType | logType | ) |
Convert a log type into a string representation.
[in] | logType | Log type. |
References SBG_DEBUG_LOG_TYPE_DEBUG, SBG_DEBUG_LOG_TYPE_ERROR, SBG_DEBUG_LOG_TYPE_INFO, and SBG_DEBUG_LOG_TYPE_WARNING.
void sbgDebugHexDump | ( | const char * | pPrefix, |
const void * | pBuffer, | ||
size_t | size | ||
) |
Produce a text dump of a buffer.
[in] | pPrefix | Prefix string before each line. |
[in] | pBuffer | Data buffer, may be NULL. |
[in] | size | Data size, in bytes. |