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

Unified Diff: runtime/vm/os_macos.cc

Issue 1415573004: Direct OS:Print[Err] to syslog on iOS. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/os_macos.cc
diff --git a/runtime/vm/os_macos.cc b/runtime/vm/os_macos.cc
index 362ad0165764684b56b3b708d2a4dac9c60679ed..a7d3ee672364ef5fedf66fbb956ddf1a5bd1e546 100644
--- a/runtime/vm/os_macos.cc
+++ b/runtime/vm/os_macos.cc
@@ -16,7 +16,8 @@
#include <sys/resource.h> // NOLINT
#include <unistd.h> // NOLINT
#if TARGET_OS_IOS
-#include <sys/sysctl.h>
+#include <sys/sysctl.h> // NOLINT
+#include <syslog.h> // NOLINT
#endif
#include "platform/utils.h"
@@ -143,7 +144,7 @@ void OS::AlignedFree(void* ptr) {
intptr_t OS::ActivationFrameAlignment() {
#if TARGET_OS_IOS
#if TARGET_ARCH_ARM
- // Even if we generate code that maintains a strong alignment, we cannot
+ // Even if we generate code that maintains a stronger alignment, we cannot
// assert the stronger stack alignment because C++ code will not maintain it.
return 8;
#elif TARGET_ARCH_ARM64
@@ -234,10 +235,17 @@ char* OS::StrNDup(const char* s, intptr_t n) {
void OS::Print(const char* format, ...) {
+#if TARGET_OS_IOS
+ va_list args;
+ va_start(args, format);
+ vsyslog(LOG_INFO, format, args);
+ va_end(args);
+#else
va_list args;
va_start(args, format);
VFPrint(stdout, format, args);
va_end(args);
+#endif
}
@@ -322,10 +330,17 @@ void OS::RegisterCodeObservers() {
void OS::PrintErr(const char* format, ...) {
+#if TARGET_OS_IOS
+ va_list args;
+ va_start(args, format);
+ vsyslog(LOG_ERR, format, args);
+ va_end(args);
+#else
va_list args;
va_start(args, format);
VFPrint(stderr, format, args);
va_end(args);
+#endif
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698