OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 rtc::LogMessage::LogThreads(true); | 102 rtc::LogMessage::LogThreads(true); |
103 rtc::LogMessage::LogTimestamps(true); | 103 rtc::LogMessage::LogTimestamps(true); |
104 rtc::LogMessage::AddLogToStream(_logSink.get(), [self rtcSeverity]); | 104 rtc::LogMessage::AddLogToStream(_logSink.get(), [self rtcSeverity]); |
105 _hasStarted = YES; | 105 _hasStarted = YES; |
106 } | 106 } |
107 | 107 |
108 - (void)stop { | 108 - (void)stop { |
109 if (!_hasStarted) { | 109 if (!_hasStarted) { |
110 return; | 110 return; |
111 } | 111 } |
112 DCHECK(_logSink); | 112 RTC_DCHECK(_logSink); |
113 rtc::LogMessage::RemoveLogToStream(_logSink.get()); | 113 rtc::LogMessage::RemoveLogToStream(_logSink.get()); |
114 _hasStarted = NO; | 114 _hasStarted = NO; |
115 _logSink.reset(); | 115 _logSink.reset(); |
116 } | 116 } |
117 | 117 |
118 - (NSData *)logData { | 118 - (NSData *)logData { |
119 if (_hasStarted) { | 119 if (_hasStarted) { |
120 return nil; | 120 return nil; |
121 } | 121 } |
122 NSMutableData* logData = [NSMutableData data]; | 122 NSMutableData* logData = [NSMutableData data]; |
(...skipping 25 matching lines...) Expand all Loading... |
148 case kRTCFileLoggerSeverityInfo: | 148 case kRTCFileLoggerSeverityInfo: |
149 return rtc::LS_INFO; | 149 return rtc::LS_INFO; |
150 case kRTCFileLoggerSeverityWarning: | 150 case kRTCFileLoggerSeverityWarning: |
151 return rtc::LS_WARNING; | 151 return rtc::LS_WARNING; |
152 case kRTCFileLoggerSeverityError: | 152 case kRTCFileLoggerSeverityError: |
153 return rtc::LS_ERROR; | 153 return rtc::LS_ERROR; |
154 } | 154 } |
155 } | 155 } |
156 | 156 |
157 @end | 157 @end |
OLD | NEW |