| Index: talk/examples/objc/AppRTCDemo/common/ARDLogging.h
|
| diff --git a/talk/examples/objc/AppRTCDemo/ARDSDPUtils.h b/talk/examples/objc/AppRTCDemo/common/ARDLogging.h
|
| similarity index 60%
|
| copy from talk/examples/objc/AppRTCDemo/ARDSDPUtils.h
|
| copy to talk/examples/objc/AppRTCDemo/common/ARDLogging.h
|
| index 2f14e6dec0b40b77b1f6d03be0ef639387b4d0db..32955d57e8e45b7c01981ded98f39d4e1cd730a2 100644
|
| --- a/talk/examples/objc/AppRTCDemo/ARDSDPUtils.h
|
| +++ b/talk/examples/objc/AppRTCDemo/common/ARDLogging.h
|
| @@ -27,15 +27,28 @@
|
|
|
| #import <Foundation/Foundation.h>
|
|
|
| -@class RTCSessionDescription;
|
| +#if defined(__cplusplus)
|
| +extern "C" void ARDLogToWebRTCLogger(NSString *logString);
|
| +extern "C" NSString *ARDFileName(const char *filePath);
|
| +#else
|
| +extern void ARDLogToWebRTCLogger(NSString *logString);
|
| +extern NSString *ARDFileName(const char *filePath);
|
| +#endif
|
|
|
| -@interface ARDSDPUtils : NSObject
|
| +#define ARDLogString(format, ...) \
|
| + [NSString stringWithFormat:@"(%s %@:%d): " format, __PRETTY_FUNCTION__, ARDFileName(__FILE__), \
|
| + __LINE__, ##__VA_ARGS__]
|
|
|
| -// Updates the original SDP description to instead prefer the specified video
|
| -// codec. We do this by placing the specified codec at the beginning of the
|
| -// codec list if it exists in the sdp.
|
| -+ (RTCSessionDescription *)
|
| - descriptionForDescription:(RTCSessionDescription *)description
|
| - preferredVideoCodec:(NSString *)codec;
|
| +#define ARDLog(format, ...) \
|
| + do { \
|
| + NSString *logString = ARDLogString(format, ##__VA_ARGS__); \
|
| + ARDLogToWebRTCLogger(logString); \
|
| + } while (false)
|
|
|
| -@end
|
| +#ifdef DEBUG
|
| +#define ARDLogDebug(format, ...) ARDLog(format, ##__VA_ARGS__)
|
| +#else
|
| +#define ARDLogDebug(format, ...) \
|
| + do { \
|
| + } while (false)
|
| +#endif
|
|
|