12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- #import <Foundation/Foundation.h>
- #import "RTCMacros.h"
- typedef NS_ENUM(NSInteger, RTCLoggingSeverity) {
- RTCLoggingSeverityVerbose,
- RTCLoggingSeverityInfo,
- RTCLoggingSeverityWarning,
- RTCLoggingSeverityError,
- RTCLoggingSeverityNone,
- };
- RTC_EXTERN void RTCLogEx(RTCLoggingSeverity severity, NSString* log_string);
- RTC_EXTERN void RTCSetMinDebugLogLevel(RTCLoggingSeverity severity);
- RTC_EXTERN NSString* RTCFileName(const char* filePath);
- #define RTCLogString(format, ...) \
- [NSString stringWithFormat:@"(%@:%d %s): " format, RTCFileName(__FILE__), \
- __LINE__, __FUNCTION__, ##__VA_ARGS__]
- #define RTCLogFormat(severity, format, ...) \
- do { \
- NSString* log_string = RTCLogString(format, ##__VA_ARGS__); \
- RTCLogEx(severity, log_string); \
- } while (false)
- #define RTCLogVerbose(format, ...) \
- RTCLogFormat(RTCLoggingSeverityVerbose, format, ##__VA_ARGS__)
- #define RTCLogInfo(format, ...) \
- RTCLogFormat(RTCLoggingSeverityInfo, format, ##__VA_ARGS__)
- #define RTCLogWarning(format, ...) \
- RTCLogFormat(RTCLoggingSeverityWarning, format, ##__VA_ARGS__)
- #define RTCLogError(format, ...) \
- RTCLogFormat(RTCLoggingSeverityError, format, ##__VA_ARGS__)
- #if !defined(NDEBUG)
- #define RTCLogDebug(format, ...) RTCLogInfo(format, ##__VA_ARGS__)
- #else
- #define RTCLogDebug(format, ...) \
- do { \
- } while (false)
- #endif
- #define RTCLog(format, ...) RTCLogInfo(format, ##__VA_ARGS__)
|