|
30 | 30 |
|
31 | 31 | #if defined(OS_ANDROID) |
32 | 32 | #include <android/log.h> |
33 | | -#elif defined(OS_MACOSX) |
34 | | -#include <os/log.h> |
| 33 | +#elif defined(OS_IOS) |
35 | 34 | extern "C" { |
36 | 35 | // Cannot import the syslog.h header directly because of macro collision. |
37 | 36 | extern void syslog(int, const char*, ...); |
@@ -200,29 +199,19 @@ void Logger_PrintString(Dart_NativeArguments args) { |
200 | 199 | // Write to the logcat on Android. |
201 | 200 | __android_log_print(ANDROID_LOG_INFO, logger_prefix.c_str(), "%.*s", |
202 | 201 | (int)length, chars); |
203 | | -#elif defined(OS_MACOSX) |
| 202 | +#elif defined(OS_IOS) |
| 203 | + // Write to syslog on iOS. |
| 204 | + // |
204 | 205 | // TODO(cbracken): replace with dedicated communication channel and bypass |
205 | 206 | // iOS logging APIs altogether. |
206 | | - // |
207 | | - // Unified logging (os_log) became available in iOS 9.0 and syslog stopped |
208 | | - // working in iOS 13.0. idevicesyslog made device syslog available on the |
209 | | - // connected host, but there is no known API to view device unified logging |
210 | | - // on the host. Flutter tool will continue to observe syslog on devices |
211 | | - // older than iOS 13.0 since it provides more logging context, particularly |
212 | | - // for application crashes. |
213 | | - if (__builtin_available(iOS 13.0, macOS 10.11, *)) { |
214 | | - os_log_t dart_log = os_log_create("io.flutter", "dart"); |
215 | | - os_log(dart_log, "%.*s", static_cast<int>(length), chars); |
216 | | - } else { |
217 | | - syslog(1 /* LOG_ALERT */, "%.*s", static_cast<int>(length), chars); |
218 | | - } |
| 207 | + syslog(1 /* LOG_ALERT */, "%.*s", (int)length, chars); |
219 | 208 | #else |
220 | 209 | std::cout << log_string << std::endl; |
221 | 210 | #endif |
222 | 211 | } |
223 | 212 |
|
224 | 213 | if (dart::bin::ShouldCaptureStdout()) { |
225 | | - // Report print output on the Stdout stream. |
| 214 | + // For now we report print output on the Stdout stream. |
226 | 215 | uint8_t newline[] = {'\n'}; |
227 | 216 | Dart_ServiceSendDataEvent("Stdout", "WriteEvent", |
228 | 217 | reinterpret_cast<const uint8_t*>(chars), length); |
|
0 commit comments