sbgECom Library
5.2.590-stable
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, ...) |
Log an error with its associated message. | |
#define | SBG_LOG_WARNING_CALL(errorCode, format, ...) |
Log a warning with its associated message. | |
#define | SBG_LOG_INFO_CALL(format, ...) |
Log an information message. | |
#define | SBG_LOG_DEBUG_CALL(format, ...) |
Log a a debug message. | |
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, | |||
... ) |
Log an error with its associated message.
This macro logs an error message along with the specified error code. The message can include formatted text similar to printf.
[in] | errorCode | The error code that triggered this error. |
[in] | format | The string literal for the associated error message, supporting printf-like formatting. |
[in] | ... | Additional arguments for the format string. |
#define SBG_LOG_WARNING_CALL | ( | errorCode, | |
format, | |||
... ) |
Log a warning with its associated message.
This macro logs a warning message along with the specified error code. The message can include formatted text similar to printf.
[in] | errorCode | The error code that triggered this warning. |
[in] | format | The string literal for the associated error message, supporting printf-like formatting. |
[in] | ... | Additional arguments for the format string. |
#define SBG_LOG_INFO_CALL | ( | format, | |
... ) |
Log an information message.
This macro logs an information message. The message can include formatted text similar to printf.
[in] | format | The string literal for the associated information message, supporting printf-like formatting. |
[in] | ... | Additional arguments for the format string. |
#define SBG_LOG_DEBUG_CALL | ( | format, | |
... ) |
Log a a debug message.
This macro logs a debug message, which is only output when compiled in debug mode. The message can include formatted text similar to printf.
[in] | format | The string literal for the associated debug message, supporting printf-like formatting. |
[in] | ... | Additional arguments for the format string. |
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, SBG_DEBUG_LOG_TYPE_WARNING, and SBG_INLINE.
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. |