OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "platform/globals.h" | 5 #include "platform/globals.h" |
6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
7 | 7 |
8 #include "bin/log.h" | 8 #include "bin/log.h" |
9 | 9 |
10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
11 #include <stdio.h> // NOLINT | 11 #include <stdio.h> // NOLINT |
12 | 12 |
13 namespace dart { | 13 namespace dart { |
14 namespace bin { | 14 namespace bin { |
15 | 15 |
16 // TODO(gram): We should be buffering the data and only outputting | 16 // TODO(gram): We should be buffering the data and only outputting |
17 // it when we see a '\n'. | 17 // it when we see a '\n'. |
18 | 18 |
19 void Log::VPrint(const char* format, va_list args) { | 19 void Log::VPrint(const char* format, va_list args) { |
Bill Hesse
2016/04/27 12:22:31
Add a comment explaining this
kustermann
2016/04/27 13:25:08
Done.
| |
20 vprintf(format, args); | |
20 __android_log_vprint(ANDROID_LOG_INFO, "Dart", format, args); | 21 __android_log_vprint(ANDROID_LOG_INFO, "Dart", format, args); |
21 } | 22 } |
22 | 23 |
23 void Log::VPrintErr(const char* format, va_list args) { | 24 void Log::VPrintErr(const char* format, va_list args) { |
25 vfprintf(stderr, format, args); | |
24 __android_log_vprint(ANDROID_LOG_ERROR, "Dart", format, args); | 26 __android_log_vprint(ANDROID_LOG_ERROR, "Dart", format, args); |
25 } | 27 } |
26 | 28 |
27 } // namespace bin | 29 } // namespace bin |
28 } // namespace dart | 30 } // namespace dart |
29 | 31 |
30 #endif // defined(TARGET_OS_ANDROID) | 32 #endif // defined(TARGET_OS_ANDROID) |
OLD | NEW |