| 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 #ifndef BIN_LOG_H_ | 5 #ifndef BIN_LOG_H_ |
| 6 #define BIN_LOG_H_ | 6 #define BIN_LOG_H_ |
| 7 | 7 |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 | 9 |
| 10 #include "platform/globals.h" | 10 #include "platform/globals.h" |
| 11 | 11 |
| 12 | |
| 13 namespace dart { | 12 namespace dart { |
| 14 namespace bin { | 13 namespace bin { |
| 15 | 14 |
| 16 class Log { | 15 class Log { |
| 17 public: | 16 public: |
| 18 // Print formatted output for debugging. | 17 // Print formatted output for debugging. |
| 19 static void Print(const char* format, ...) PRINTF_ATTRIBUTE(1, 2) { | 18 static void Print(const char* format, ...) PRINTF_ATTRIBUTE(1, 2) { |
| 20 va_list args; | 19 va_list args; |
| 21 va_start(args, format); | 20 va_start(args, format); |
| 22 VPrint(format, args); | 21 VPrint(format, args); |
| 23 va_end(args); | 22 va_end(args); |
| 24 } | 23 } |
| 25 | 24 |
| 26 static void VPrint(const char* format, va_list args); | 25 static void VPrint(const char* format, va_list args); |
| 27 | 26 |
| 28 static void PrintErr(const char* format, ...) PRINTF_ATTRIBUTE(1, 2) { | 27 static void PrintErr(const char* format, ...) PRINTF_ATTRIBUTE(1, 2) { |
| 29 va_list args; | 28 va_list args; |
| 30 va_start(args, format); | 29 va_start(args, format); |
| 31 VPrintErr(format, args); | 30 VPrintErr(format, args); |
| 32 va_end(args); | 31 va_end(args); |
| 33 } | 32 } |
| 34 | 33 |
| 35 static void VPrintErr(const char* format, va_list args); | 34 static void VPrintErr(const char* format, va_list args); |
| 36 | 35 |
| 36 private: |
| 37 DISALLOW_ALLOCATION(); | 37 DISALLOW_ALLOCATION(); |
| 38 DISALLOW_IMPLICIT_CONSTRUCTORS(Log); | 38 DISALLOW_IMPLICIT_CONSTRUCTORS(Log); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace bin | 41 } // namespace bin |
| 42 } // namespace dart | 42 } // namespace dart |
| 43 | 43 |
| 44 #endif // BIN_LOG_H_ | 44 #endif // BIN_LOG_H_ |
| OLD | NEW |