U8, U16, U32 data type changes
[o-du/l2.git] / src / rlog / rl_interface.h
index 925ab5f..b60b397 100755 (executable)
@@ -43,7 +43,7 @@ void rlSetLogPath(const char* logDir);
 // This API needs to be called after configuring all the required parameters 
 // by using below APIs. This API initializes logging framework.  
 // Log MACRO's should be used  only after calling this API.
-void rlInitLog(U8 type); 
+void rlInitLog(uint8_t type); 
 
 ///////////////////////////////////////////////////////////////////////////////
 // This initializes log file name.  Log file name should be exclusive of 
@@ -57,7 +57,7 @@ void rlSetLogFile(const char* fileName);
 // This API is used to set remote logging port, where post-processor application 
 // (rlogapp) is used to connect on this port in order to receive live binary logs. 
 // This API can be used only during initialization time.
-void rlSetLogPort(U32 port);
+void rlSetLogPort(uint32_t port);
 
 ///////////////////////////////////////////////////////////////////////////////
 // Use this API to set log level. This API supports run time modification of
@@ -68,22 +68,22 @@ void rlSetLogLevel(R_LOG_LEVEL logLevel);
 // This API toggles the module mask. If logging for this module is already 
 // enabled, it will be disabled. If it's not enabled, it will enable. Zero 
 // input will disable logging mask for all modules.
-void rlSetModuleMask(U32 modMask);
+void rlSetModuleMask(uint32_t modMask);
 
 ///////////////////////////////////////////////////////////////////////////////
 // This API is used to set log file size limit for single file.
-void rlSetLogFileSizeLimit(U32 maxFileSize);
+void rlSetLogFileSizeLimit(uint32_t maxFileSize);
 
 ///////////////////////////////////////////////////////////////////////////////
 // This API sets the limit of number of log files  that can be created by 
 // logging framework.
-void rlSetNumOfLogFiles(U8 nMaxFiles);
+void rlSetNumOfLogFiles(uint8_t nMaxFiles);
 
 ///////////////////////////////////////////////////////////////////////////////
 // This API is used to set circular buffer size for each thread. Based on the 
 // number of threads in the system this size needs to be chosen. Recommended 
 // minimum 100Kb buffer size.
-void rlSetCircularBufferSize(U32 bufSize);
+void rlSetCircularBufferSize(uint32_t bufSize);
 
 ///////////////////////////////////////////////////////////////////////////////
 // This API enables or disables remote logging application connection to see 
@@ -132,6 +132,8 @@ extern void rlStopLogCountLimit(void);
 
 #else
 
+#if defined(RLOG_ENABLE_TEXT_LOGGING) 
+
 #define FMTSTR "[%d-%d-%d %d:%d:%d.%03d][%s]%s:%d\n%s:"
 #define FMTSTR_S "[%d-%d-%d %d:%d:%d.%03d][%s]%s:%d\n%s:%s:%ld:"
 
@@ -165,6 +167,33 @@ if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
 #define RLOG3(_level, _lstr, _arg1, _arg2, _arg3)      LOG_ARGN(3, _level, _lstr, _arg1, _arg2, _arg3)
 #define RLOG4(_level, _lstr, _arg1, _arg2, _arg3, _arg4)LOG_ARGN(4, _level, _lstr, _arg1, _arg2, _arg3, _arg4)
 
+#else /* BINARY LOGGING */
+
+#define LOG_ARG0(_level, _fmtStr) \
+if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
+{ \
+       logLev0(_LOGID, _level, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
+}
+
+#define LOG_ARGN(_N, _level, _fmtStr, ...) \
+if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
+{ \
+       logLev##_N(_LOGID, _level, ##__VA_ARGS__, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
+}
+
+#define LOG_SPL(_level, _splenum, _splArg, _fmtStr, ...) \
+if( _level < g_logLevel || g_modMask & RLOG_MODULE_ID)\
+{ \
+       logLevE(_LOGID,_level,_splenum, _splArg, ##__VA_ARGS__, __FILE__,__LINE__, _fmtStr, RLOG_FILE_ID, RLOG_MODULE_NAME); \
+}
+
+#define RLOG0(_level, _lstr)                           LOG_ARG0(_level, _lstr)
+#define RLOG1(_level, _lstr, _arg1)                    LOG_ARGN(1, _level, _lstr, _arg1)
+#define RLOG2(_level, _lstr, _arg1, _arg2)             LOG_ARGN(2, _level, _lstr, _arg1, _arg2)
+#define RLOG3(_level, _lstr, _arg1, _arg2, _arg3)      LOG_ARGN(3, _level, _lstr, _arg1, _arg2, _arg3)
+#define RLOG4(_level, _lstr, _arg1, _arg2, _arg3, _arg4)LOG_ARGN(4, _level, _lstr, _arg1, _arg2, _arg3, _arg4)
+
+#endif /* if defined(RLOG_ENABLE_TEXT_LOGGING) */
 
 #define RLOG_STR(_level, _lstr, _strarg)                                       LOG_ARGN(S, _level, _lstr, _strarg)
 #define RLOG_HEX(_level, _lstr, _hexdata, _hexlen)             LOG_ARGN(H, _level, _lstr, _hexdata, _hexlen)