<commit_before>
/******************************************************************************
* File       : debug.h
* Function   : debug control.
* description: To be done.          
* Version    : V1.00
* Author     : Ian
* Date       : 24th May 2016
* History    :  No.  When           Who           What
*               1    24/May/2016    Ian           Create
******************************************************************************/

#ifndef _DEBUG_H_
#define _DEBUG_H_

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __DEBUG_NONE
#define __DEBUG_NONE                0      /* No need to printf                                */
#define __DEBUG_BASIC_INFO          1      /* Provide basic printf function                    */
#define __DEBUG_FILE_LINE_INFO      2      /* Provide file and line information with printf    */
#define __DEBUG_FUNC_LINE_INFO      3      /* Provide function and line info with printf       */
#define __DEBUG_FILE_LINE_FUNC_INFO 4      /* Provode file, line and function info with printf */
#endif

#ifndef __DEBUG_MODE
#define __DEBUG_MODE       __DEBUG_BASIC_INFO//__DEBUG_FUNC_LINE_INFO
#endif

#if (__DEBUG_MODE  == __DEBUG_FILE_LINE_FUNC_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs file name, function name, line number and desired info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf("FILE: "__FILE__", FUNC : %s, LINE: %d -- \n "x" \n", __func__ , __LINE__, ##__VA_ARGS__)

#elif (__DEBUG_MODE  == __DEBUG_FILE_LINE_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs file name, line number and desired info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf("FILE: "__FILE__",  LINE: %d -- \n "x" \n", __LINE__, ##__VA_ARGS__)

#elif (__DEBUG_MODE  == __DEBUG_FUNC_LINE_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs function name, line number and desired info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf("FUNC : %s, LINE: %d -- \n "x" \n", __func__ , __LINE__, ##__VA_ARGS__)

#elif (__DEBUG_MODE == __DEBUG_BASIC_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs desired basic info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf(x, ##__VA_ARGS__)

#else
    #ifdef IAR
        #pragma message("*** Debug printf is DISABLED!! ***")
    #endif
    #define DBG_PRINT(x,...)
#endif

/* Assert Macros */
#ifdef __DEBUG_MODE<commit_msg>Update debug.h<commit_after>
/******************************************************************************
* File       : debug.h
* Function   : debug control.
* description: To be done.          
* Version    : V1.00
* Author     : Ian
* Date       : 24th May 2016
* History    :  No.  When           Who           What
*               1    24/May/2016    Ian           Create
******************************************************************************/

#ifndef _DEBUG_H_
#define _DEBUG_H_

#ifdef __cplusplus
extern "C" {
#endif

#ifndef __DEBUG_NONE
#define __DEBUG_NONE                0      /* No need to printf                                */
#define __DEBUG_BASIC_INFO          1      /* Provide basic printf function                    */
#define __DEBUG_FILE_LINE_INFO      2      /* Provide file and line information with printf    */
#define __DEBUG_FUNC_LINE_INFO      3      /* Provide function and line info with printf       */
#define __DEBUG_FILE_LINE_FUNC_INFO 4      /* Provode file, line and function info with printf */
#endif

#ifndef __DEBUG_MODE
#define __DEBUG_MODE       __DEBUG_BASIC_INFO//__DEBUG_FUNC_LINE_INFO
#endif

#ifdef IAR
#if (__DEBUG_MODE  == __DEBUG_FILE_LINE_FUNC_INFO)
    #pragma message("*** Debug printf outputs file name, function name, line number and desired info!! ***")
    #define DBG_PRINT(x,...)        printf("FILE: "__FILE__", FUNC : %s, LINE: %d -- \n "x" \n", __func__ , __LINE__, ##__VA_ARGS__)

#elif (__DEBUG_MODE  == __DEBUG_FUNC_LINE_INFO)
    #pragma message("*** Debug printf outputs function name, line number and desired info!! ***")
    #define DBG_PRINT(x,...)        printf("FUNC : %s, LINE: %d -- \n "x" \n", __func__ , __LINE__, ##__VA_ARGS__)
#endif


#elif (__DEBUG_MODE  == __DEBUG_FILE_LINE_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs file name, line number and desired info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf("FILE: "__FILE__",  LINE: %d -- \n "x" \n", __LINE__, ##__VA_ARGS__)

#elif (__DEBUG_MODE == __DEBUG_BASIC_INFO)
    #ifdef IAR
        #pragma message("*** Debug printf outputs desired basic info!! ***")
    #endif
    #define DBG_PRINT(x,...)        printf(x, ##__VA_ARGS__)

#else
    #ifdef IAR
        #pragma message("*** Debug printf is DISABLED!! ***")
    #endif
    #define DBG_PRINT(x,...)
#endif

/* Assert Macros */
#ifdef __DEBUG_MODE
{'fraction_non_alphanumeric': 0.17916321458160728, 'fraction_numerical': 0.008699254349627174, 'mean_word_length': 2.700383141762452, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2035356', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1421, 'n_words': 433}