OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_LOG_UTILS_H_ | 5 #ifndef V8_LOG_UTILS_H_ |
6 #define V8_LOG_UTILS_H_ | 6 #define V8_LOG_UTILS_H_ |
7 | 7 |
8 #include <stdio.h> | 8 #include <stdio.h> |
9 | 9 |
10 #include <cstdarg> | 10 #include <cstdarg> |
11 | 11 |
12 #include "src/allocation.h" | 12 #include "src/allocation.h" |
13 #include "src/base/compiler-specific.h" | |
14 #include "src/base/platform/mutex.h" | 13 #include "src/base/platform/mutex.h" |
15 #include "src/flags.h" | 14 #include "src/flags.h" |
16 | 15 |
17 namespace v8 { | 16 namespace v8 { |
18 namespace internal { | 17 namespace internal { |
19 | 18 |
20 class Logger; | 19 class Logger; |
21 | 20 |
22 // Functions and data for performing output of log messages. | 21 // Functions and data for performing output of log messages. |
23 class Log { | 22 class Log { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // Utility class for formatting log messages. It fills the message into the | 55 // Utility class for formatting log messages. It fills the message into the |
57 // static buffer in Log. | 56 // static buffer in Log. |
58 class MessageBuilder BASE_EMBEDDED { | 57 class MessageBuilder BASE_EMBEDDED { |
59 public: | 58 public: |
60 // Create a message builder starting from position 0. | 59 // Create a message builder starting from position 0. |
61 // This acquires the mutex in the log as well. | 60 // This acquires the mutex in the log as well. |
62 explicit MessageBuilder(Log* log); | 61 explicit MessageBuilder(Log* log); |
63 ~MessageBuilder() { } | 62 ~MessageBuilder() { } |
64 | 63 |
65 // Append string data to the log message. | 64 // Append string data to the log message. |
66 void PRINTF_FORMAT(2, 3) Append(const char* format, ...); | 65 void Append(const char* format, ...); |
67 | 66 |
68 // Append string data to the log message. | 67 // Append string data to the log message. |
69 void PRINTF_FORMAT(2, 0) AppendVA(const char* format, va_list args); | 68 void AppendVA(const char* format, va_list args); |
70 | 69 |
71 // Append a character to the log message. | 70 // Append a character to the log message. |
72 void Append(const char c); | 71 void Append(const char c); |
73 | 72 |
74 // Append double quoted string to the log message. | 73 // Append double quoted string to the log message. |
75 void AppendDoubleQuotedString(const char* string); | 74 void AppendDoubleQuotedString(const char* string); |
76 | 75 |
77 // Append a heap string. | 76 // Append a heap string. |
78 void Append(String* str); | 77 void Append(String* str); |
79 | 78 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 Logger* logger_; | 135 Logger* logger_; |
137 | 136 |
138 friend class Logger; | 137 friend class Logger; |
139 }; | 138 }; |
140 | 139 |
141 | 140 |
142 } // namespace internal | 141 } // namespace internal |
143 } // namespace v8 | 142 } // namespace v8 |
144 | 143 |
145 #endif // V8_LOG_UTILS_H_ | 144 #endif // V8_LOG_UTILS_H_ |
OLD | NEW |