Macros | Typedefs | Enumerations | Functions
sbgDebug.h File Reference

Define and handle error logging for the SBG Systems common C library. More...

#include "sbgDefines.h"
Include dependency graph for sbgDebug.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SBG_DEBUG_LOG_CATEGORY   ("None")
 
#define SBG_LOG_DEBUG(format, ...)   ((void)sizeof(SBG_LOG_DEBUG_CALL(format, ## __VA_ARGS__)))
 
#define SBG_LOG_DEBUG_CALL(format, ...)   sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__)
 
#define SBG_LOG_ERROR(format, ...)   ((void)sizeof(SBG_LOG_ERROR_CALL(format, ## __VA_ARGS__)))
 
#define SBG_LOG_ERROR_CALL(errorCode, format, ...)   sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__)
 
#define SBG_LOG_INFO(format, ...)   ((void)sizeof(SBG_LOG_INFO_CALL(format, ## __VA_ARGS__)))
 
#define SBG_LOG_INFO_CALL(format, ...)   sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__)
 
#define SBG_LOG_WARNING(format, ...)   ((void)sizeof(SBG_LOG_WARNING_CALL(format, ## __VA_ARGS__)))
 
#define SBG_LOG_WARNING_CALL(errorCode, format, ...)   sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, 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)
 

Detailed Description

Define and handle error logging for the SBG Systems common C library.

Author
SBG Systems (Raphael Siryani)
Date
17 March 2015

The methods defined here should be implemented in sbgPlatform.h/sbgPlatform.c according to your platform and needs.

Copyright Notice

Copyright (C) 2007-2015, SBG Systems SAS. All rights reserved.

This source code is intended for use only by SBG Systems SAS and those that have explicit written permission to use it from SBG Systems SAS.

THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.

Definition in file sbgDebug.h.

Macro Definition Documentation

#define SBG_DEBUG_LOG_CATEGORY   ("None")

Definition at line 30 of file sbgDebug.h.

#define SBG_LOG_DEBUG (   format,
  ... 
)    ((void)sizeof(SBG_LOG_DEBUG_CALL(format, ## __VA_ARGS__)))

Definition at line 99 of file sbgDebug.h.

#define SBG_LOG_DEBUG_CALL (   format,
  ... 
)    sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_DEBUG, SBG_NO_ERROR, format, ##__VA_ARGS__)

Log an information message only in debug mode

Parameters
[in]formatString litteral for the information message (you can use printf like string formating).

Definition at line 94 of file sbgDebug.h.

#define SBG_LOG_ERROR (   format,
  ... 
)    ((void)sizeof(SBG_LOG_ERROR_CALL(format, ## __VA_ARGS__)))

Definition at line 62 of file sbgDebug.h.

#define SBG_LOG_ERROR_CALL (   errorCode,
  format,
  ... 
)    sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_ERROR, errorCode, format, ##__VA_ARGS__)

Log an error with its associated message.

Parameters
[in]errorCodeThe error code that has thrown this error.
[in]formatString litteral for the associated error message (you can use printf like string formating).

Definition at line 57 of file sbgDebug.h.

#define SBG_LOG_INFO (   format,
  ... 
)    ((void)sizeof(SBG_LOG_INFO_CALL(format, ## __VA_ARGS__)))

Definition at line 87 of file sbgDebug.h.

#define SBG_LOG_INFO_CALL (   format,
  ... 
)    sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_INFO, SBG_NO_ERROR, format, ##__VA_ARGS__)

Log an information message.

Parameters
[in]formatString litteral for the information message (you can use printf like string formating).

Definition at line 82 of file sbgDebug.h.

#define SBG_LOG_WARNING (   format,
  ... 
)    ((void)sizeof(SBG_LOG_WARNING_CALL(format, ## __VA_ARGS__)))

Definition at line 75 of file sbgDebug.h.

#define SBG_LOG_WARNING_CALL (   errorCode,
  format,
  ... 
)    sbgPlatformDebugLogMsg((const char*)__BASE_FILE__, (const char*)__FUNCTION__, __LINE__, SBG_DEBUG_LOG_CATEGORY, SBG_DEBUG_LOG_TYPE_WARNING, errorCode, format, ##__VA_ARGS__)

Log a warning with its associated message.

Parameters
[in]errorCodeThe error code that has thrown this warning.
[in]formatString litteral for the associated warning message (you can use printf like string formating).

Definition at line 70 of file sbgDebug.h.

Typedef Documentation

Enum that identify the type of error / warning that has been thrown.

Enumeration Type Documentation

Enum that identify the type of error / warning that has been thrown.

Enumerator
SBG_DEBUG_LOG_TYPE_ERROR 

The message to log is an error.

SBG_DEBUG_LOG_TYPE_WARNING 

The message to log is a warning.

SBG_DEBUG_LOG_TYPE_INFO 

The message to log is an information.

SBG_DEBUG_LOG_TYPE_DEBUG 

The message to log is a debug information.

Definition at line 40 of file sbgDebug.h.

Function Documentation

SBG_INLINE const char* sbgDebugLogTypeToStr ( SbgDebugLogType  logType)

Convert a log type into a string representation.

Parameters
[in]logTypeLog type.
Returns
String representation for the given log type.

Definition at line 112 of file sbgDebug.h.



sbg_driver
Author(s): SBG Systems
autogenerated on Thu Oct 22 2020 03:47:22