Commit 5f5b8f29 authored by Alireza Mohammadi's avatar Alireza Mohammadi Committed by Robert Schmidt

Fix for ASN1 logging: change name from ASN to ASN1

There is a conflict with some E2AP definitions that put ASN as a
preprocessor definition. To avoid this conflict, and since ASN1 is more
descriptive than ASN, we change the logging mechanism name from ASN to
ASN1.
parent 578fbfb9
...@@ -268,7 +268,7 @@ add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp) ...@@ -268,7 +268,7 @@ add_library(ITTI ${OCP_ITTI}/intertask_interface.cpp)
target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs) target_link_libraries(ITTI PRIVATE asn1_lte_rrc_hdrs asn1_nr_rrc_hdrs)
# asn1c skeletons have hardcoded this flag to make customized debug logs # asn1c skeletons have hardcoded this flag to make customized debug logs
# OAI uses this feature to re-use OAI LOG_I(ASN, ...) # OAI uses this feature to re-use OAI LOG_I(ASN1, ...)
if (DEBUG_ASN1C) if (DEBUG_ASN1C)
add_definitions(-DHAVE_CONFIG_H) add_definitions(-DHAVE_CONFIG_H)
endif() endif()
......
...@@ -487,7 +487,7 @@ int logInit (void) ...@@ -487,7 +487,7 @@ int logInit (void)
register_log_component("SCTP","",SCTP); register_log_component("SCTP","",SCTP);
register_log_component("X2AP","",X2AP); register_log_component("X2AP","",X2AP);
register_log_component("LOADER","log",LOADER); register_log_component("LOADER","log",LOADER);
register_log_component("ASN","log",ASN); register_log_component("ASN1","log",ASN1);
register_log_component("NFAPI_VNF","log",NFAPI_VNF); register_log_component("NFAPI_VNF","log",NFAPI_VNF);
register_log_component("NFAPI_PNF","log",NFAPI_PNF); register_log_component("NFAPI_PNF","log",NFAPI_PNF);
register_log_component("GNB_APP","log",GNB_APP); register_log_component("GNB_APP","log",GNB_APP);
......
...@@ -240,7 +240,7 @@ typedef enum { ...@@ -240,7 +240,7 @@ typedef enum {
NR_MAC, NR_MAC,
NR_PHY, NR_PHY,
LOADER, LOADER,
ASN, ASN1,
NFAPI_VNF, NFAPI_VNF,
NFAPI_PNF, NFAPI_PNF,
ITTI, ITTI,
......
...@@ -27,28 +27,28 @@ ...@@ -27,28 +27,28 @@
/* /*
* This file "config.h" will be used by asn1c if HAVE_CONFIG_H_ is defined and * This file "config.h" will be used by asn1c if HAVE_CONFIG_H_ is defined and
* included. This logs asn1c encoder and decoder traces at execution time using * included. This logs asn1c encoder and decoder traces at execution time using
* the regular OAI logging system, i.e., LOG_I(ASN...); * the regular OAI logging system, i.e., LOG_I(ASN1...);
* *
* As it is very verbose, note that you can change the log level per module in * As it is very verbose, note that you can change the log level per module in
* source or in gdb, e.g., to only activate it for a short time. * source or in gdb, e.g., to only activate it for a short time.
* *
* In code: * In code:
* ``` * ```
* set_log(ASN, OAI_INFO); // enable logging * set_log(ASN1, OAI_INFO); // enable logging
* // do your encoding here * // do your encoding here
* set_log(ASN, OAI_ERR); // disable logging * set_log(ASN1, OAI_ERR); // disable logging
* ``` * ```
* *
* in gdb: * in gdb:
* ``` * ```
* gdb> p set_log(ASN, 1) // disable log, 1 == OAI_ERR * gdb> p set_log(ASN1, 1) // disable log, 1 == OAI_ERR
* gdb> p set_log(ASN, 5) // enable log, 5 == OAI_INFO * gdb> p set_log(ASN1, 5) // enable log, 5 == OAI_INFO
* ``` * ```
*/ */
#include "common/utils/LOG/log.h" #include "common/utils/LOG/log.h"
#if DEBUG_ASN1C #if DEBUG_ASN1C
#define ASN_DEBUG(x...) do{ LOG_I(ASN,x);LOG_I(ASN,"\n"); } while(false) #define ASN_DEBUG(x...) do{ LOG_I(ASN1,x);LOG_I(ASN1,"\n"); } while(false)
#else #else
#define ASN_DEBUG(x...) #define ASN_DEBUG(x...)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment