TCAdapterConfig.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. //
  2. // TCAdapterConfig.h
  3. // TCShow
  4. //
  5. // Created by AlexiChen on 16/6/2.
  6. // Copyright © 2016年 AlexiChen. All rights reserved.
  7. //
  8. #ifndef TCAdapterConfig_h
  9. #define TCAdapterConfig_h
  10. //================================以下是项目状态控制宏==================================================
  11. // BetaVersation配置
  12. #if DEBUG
  13. #ifndef kBetaVersion
  14. #define kBetaVersion 1
  15. #endif
  16. #else
  17. #if kAppStoreVersion
  18. #ifndef kBetaVersion
  19. #define kBetaVersion 0
  20. #endif
  21. #else
  22. #ifndef kBetaVersion
  23. #define kBetaVersion 1
  24. #endif
  25. #endif
  26. #endif
  27. //==================================================================================
  28. // 为方便测试同事进行日志查看
  29. #if kBetaVersion
  30. #define TIMLog(fmt, ...) [[TIMManager sharedInstance] log:TIM_LOG_INFO tag:@"TIMLog" msg:[NSString stringWithFormat:@"[%s Line %d]" fmt, __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__]];
  31. #else
  32. #if DEBUG
  33. #define TIMLog(fmt, ...) NSLog((@"[%s Line %d]" fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
  34. #else
  35. #define TIMLog(fmt, ...) //NSLog((@"[%s Line %d]" fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__)
  36. #endif
  37. #endif
  38. //==================================================================================
  39. // 是否支持消息缓存,而不是立即显示,主要是看大消息量时,立即显示会导致界面卡顿
  40. // 因不清楚各App的消息种类,以及消息类型(是否支持IM等),故放到业务层去处理,各App可依照此处逻辑
  41. // 为0时,立即显示
  42. // 为1时,会按固定频率刷新
  43. #ifndef kSupportIMMsgCache
  44. #define kSupportIMMsgCache 1
  45. #endif
  46. //==================================================================================
  47. // 用于真机时,测试获取日志
  48. static NSDateFormatter *kTCAVIMLogDateFormatter = nil;
  49. #if DEBUG
  50. // 主要用于腾讯测试同事,获取获取进行统计进房间时间,以及第一帧画面时间,外部用户使用时可改为0
  51. #ifndef kSupportTimeStatistics
  52. #define kSupportTimeStatistics 1
  53. #endif
  54. #define TCAVIMLog(fmt, ...) {\
  55. if (!kTCAVIMLogDateFormatter) \
  56. {\
  57. kTCAVIMLogDateFormatter = [[NSDateFormatter alloc] init];\
  58. [kTCAVIMLogDateFormatter setDateStyle:NSDateFormatterMediumStyle];\
  59. [kTCAVIMLogDateFormatter setTimeStyle:NSDateFormatterShortStyle];\
  60. [kTCAVIMLogDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];\
  61. }\
  62. NSLog((ASLocalizedString(@"TCAdapter时间统计 时间点:%@ [%s Line %d] ------->>>>>>\n")fmt), [kTCAVIMLogDateFormatter stringFromDate:[NSDate date]], __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);\
  63. }
  64. #else
  65. #if kAppStoreVersion
  66. // AppStore版本不统计
  67. #ifndef kSupportTimeStatistics
  68. #define kSupportTimeStatistics 0
  69. #endif
  70. // 用于release时,真机下面获取App关键路径日志日志
  71. #define TCAVIMLog(fmt, ...) /**/
  72. #else
  73. // 主要用于腾讯测试同事,获取获取进行统计进房间时间,以及第一帧画面时间,外部用户使用时可改为0
  74. #ifndef kSupportTimeStatistics
  75. #define kSupportTimeStatistics 1
  76. #endif
  77. // 用于release时,真机下面获取App关键路径日志日志
  78. #define TCAVIMLog(fmt, ...) {\
  79. if (!kTCAVIMLogDateFormatter) \
  80. { \
  81. kTCAVIMLogDateFormatter = [[NSDateFormatter alloc] init];\
  82. [kTCAVIMLogDateFormatter setDateStyle:NSDateFormatterMediumStyle];\
  83. [kTCAVIMLogDateFormatter setTimeStyle:NSDateFormatterShortStyle];\
  84. [kTCAVIMLogDateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];\
  85. }\
  86. [[TIMManager sharedInstance] log:TIM_LOG_INFO tag:ASLocalizedString(@"TCAdapter时间统计")msg:[NSString stringWithFormat:(ASLocalizedString(@"时间点:%@ [%s Line %d] ------->>>>>>")fmt), [kTCAVIMLogDateFormatter stringFromDate:[NSDate date]], __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__]];\
  87. }
  88. #endif
  89. #endif
  90. //==================================================================================
  91. #if DEBUG
  92. // 调试状态下
  93. // 是否使用AVChatRoom创建直播聊天室
  94. // 使用聊天室主要来验证性能,直正直播时,使用AVChatRoom
  95. #ifndef kSupportAVChatRoom
  96. #define kSupportAVChatRoom 1
  97. #endif
  98. #ifndef kSupportFixLiveChatRoomID
  99. // 是否因定群ID
  100. #define kSupportFixLiveChatRoomID 0
  101. #endif
  102. #if kSupportAVChatRoom
  103. #ifndef kAVChatRoomType
  104. #define kAVChatRoomType @"AVChatRoom"
  105. #endif
  106. #else
  107. #ifndef kAVChatRoomType
  108. #define kAVChatRoomType @"ChatRoom"
  109. #endif
  110. #endif
  111. #else
  112. #ifndef kSupportAVChatRoom
  113. // Release下
  114. #define kSupportAVChatRoom 1
  115. #endif
  116. #ifndef kAVChatRoomType
  117. #define kAVChatRoomType @"AVChatRoom"
  118. #endif
  119. #endif
  120. #endif /* TCAdapterConfig_h */