Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(229)

Unified Diff: talk/app/webrtc/objc/RTCLogging.mm

Issue 1241283004: iOS: Move AppRTC logging methods to public headers. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: talk/app/webrtc/objc/RTCLogging.mm
diff --git a/talk/examples/objc/AppRTCDemo/common/ARDLogging.mm b/talk/app/webrtc/objc/RTCLogging.mm
similarity index 67%
rename from talk/examples/objc/AppRTCDemo/common/ARDLogging.mm
rename to talk/app/webrtc/objc/RTCLogging.mm
index 7bd773d770553fa65f855c98619c8d9eca3ad8ff..fab358422cf6a950b3e5ba98d885f6b294cdb8ed 100644
--- a/talk/examples/objc/AppRTCDemo/common/ARDLogging.mm
+++ b/talk/app/webrtc/objc/RTCLogging.mm
@@ -25,44 +25,40 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "ARDLogging.h"
+#import "RTCLogging.h"
#include "webrtc/base/logging.h"
-void ARDLogInit() {
-#ifndef _DEBUG
- // In debug builds the default level is LS_INFO and in non-debug builds it is
- // disabled. Continue to log to console in non-debug builds, but only
- // warnings and errors.
- rtc::LogMessage::LogToDebug(rtc::LS_WARNING);
-#endif
+rtc::LoggingSeverity RTCGetNativeLoggingSeverity(RTCLoggingSeverity severity) {
+ switch (severity) {
+ case kRTCLoggingSeverityVerbose:
+ return rtc::LS_VERBOSE;
+ case kRTCLoggingSeverityInfo:
+ return rtc::LS_INFO;
+ case kRTCLoggingSeverityWarning:
+ return rtc::LS_WARNING;
+ case kRTCLoggingSeverityError:
+ return rtc::LS_ERROR;
+ }
}
-void ARDLogToWebRTCLogger(ARDLogSeverity severity, NSString *logString) {
+void RTCLogEx(RTCLoggingSeverity severity, NSString* logString) {
if (logString.length) {
const char* utf8String = logString.UTF8String;
- switch (severity) {
- case kARDLogSeverityVerbose:
- LOG(LS_VERBOSE) << utf8String;
- break;
- case kARDLogSeverityInfo:
- LOG(LS_INFO) << utf8String;
- break;
- case kARDLogSeverityWarning:
- LOG(LS_WARNING) << utf8String;
- break;
- case kARDLogSeverityError:
- LOG(LS_ERROR) << utf8String;
- break;
- }
+ LOG_V(RTCGetNativeLoggingSeverity(severity)) << utf8String;
}
}
-NSString *ARDFileName(const char *filePath) {
- NSString *nsFilePath =
- [[NSString alloc] initWithBytesNoCopy:const_cast<char *>(filePath)
+void RTCSetMinDebugLogLevel(RTCLoggingSeverity severity) {
+ rtc::LogMessage::LogToDebug(RTCGetNativeLoggingSeverity(severity));
+}
+
+NSString* RTCFileName(const char* filePath) {
+ NSString* nsFilePath =
+ [[NSString alloc] initWithBytesNoCopy:const_cast<char*>(filePath)
length:strlen(filePath)
encoding:NSUTF8StringEncoding
freeWhenDone:NO];
return nsFilePath.lastPathComponent;
}
+
« no previous file with comments | « no previous file | talk/app/webrtc/objc/public/RTCLogging.h » ('j') | talk/examples/objc/AppRTCDemo/ARDSignalingMessage.m » ('J')

Powered by Google App Engine
This is Rietveld 408576698