
#import <Foundation/Foundation.h>

#ifdef __cplusplus
extern "C" {
#endif

NS_ASSUME_NONNULL_BEGIN

#define COMMON_PRINTF(format, ...)   IOT_LoggerPrintf("RTCXIOT-Common", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)
#define HTTP_PRINTF(format, ...)   IOT_LoggerPrintf("RTCXIOT-HTTP", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)
#define PLAYER_PRINTF(format, ...)   IOT_LoggerPrintf("RTCXIOT-Player", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)
#define SESSION_PRINTF(format, ...)   IOT_LoggerPrintf("RTCXIOT-Session", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)
#define SMARTLINK_PRINTF(format, ...)   IOT_LoggerPrintf("RTCXIOT-SmartLink", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)

#ifdef DEBUG
#define NSLOG_PRINTF(format, ...)              IOT_LoggerPrintf("RTCXIOT-NSLog", 0, __FILE__, __FUNCTION__, __LINE__, format, ## __VA_ARGS__)
#else
#define NSLOG_PRINTF(format, ...)
#endif

extern void IOT_LoggerSwitch(bool on);
extern void IOT_LoggerPrintSwitch(bool isPrintf);
extern void IOT_LoggerCallbackSwitch(bool isCallback);

extern void IOT_LoggerPrintf(const char* module, int npid, const char* file, const char* function, int line, NSString *format,...);

typedef void (^RTCXIOTLOGCALLBACK)(NSString *logMsg);

void LoggerCallback(RTCXIOTLOGCALLBACK callback);

NS_ASSUME_NONNULL_END

#ifdef __cplusplus
};
#endif
