| Index: src/log-utils.cc
|
| diff --git a/src/log-utils.cc b/src/log-utils.cc
|
| index a6fa6be42a1cfcc031b765146f99e1869b474a43..d8d8f5934f72e65a0cc6e9ed2a4c76d5269923c9 100644
|
| --- a/src/log-utils.cc
|
| +++ b/src/log-utils.cc
|
| @@ -125,15 +125,15 @@ FILE* Log::Close() {
|
| }
|
|
|
|
|
| -LogMessageBuilder::LogMessageBuilder(Logger* logger)
|
| - : log_(logger->log_),
|
| +Log::MessageBuilder::MessageBuilder(Log* log)
|
| + : log_(log),
|
| sl(log_->mutex_),
|
| pos_(0) {
|
| ASSERT(log_->message_buffer_ != NULL);
|
| }
|
|
|
|
|
| -void LogMessageBuilder::Append(const char* format, ...) {
|
| +void Log::MessageBuilder::Append(const char* format, ...) {
|
| Vector<char> buf(log_->message_buffer_ + pos_,
|
| Log::kMessageBufferSize - pos_);
|
| va_list args;
|
| @@ -144,7 +144,7 @@ void LogMessageBuilder::Append(const char* format, ...) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::AppendVA(const char* format, va_list args) {
|
| +void Log::MessageBuilder::AppendVA(const char* format, va_list args) {
|
| Vector<char> buf(log_->message_buffer_ + pos_,
|
| Log::kMessageBufferSize - pos_);
|
| int result = v8::internal::OS::VSNPrintF(buf, format, args);
|
| @@ -159,7 +159,7 @@ void LogMessageBuilder::AppendVA(const char* format, va_list args) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::Append(const char c) {
|
| +void Log::MessageBuilder::Append(const char c) {
|
| if (pos_ < Log::kMessageBufferSize) {
|
| log_->message_buffer_[pos_++] = c;
|
| }
|
| @@ -167,7 +167,7 @@ void LogMessageBuilder::Append(const char c) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::AppendDoubleQuotedString(const char* string) {
|
| +void Log::MessageBuilder::AppendDoubleQuotedString(const char* string) {
|
| Append('"');
|
| for (const char* p = string; *p != '\0'; p++) {
|
| if (*p == '"') {
|
| @@ -179,7 +179,7 @@ void LogMessageBuilder::AppendDoubleQuotedString(const char* string) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::Append(String* str) {
|
| +void Log::MessageBuilder::Append(String* str) {
|
| DisallowHeapAllocation no_gc; // Ensure string stay valid.
|
| int length = str->length();
|
| for (int i = 0; i < length; i++) {
|
| @@ -188,12 +188,24 @@ void LogMessageBuilder::Append(String* str) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::AppendAddress(Address addr) {
|
| +void Log::MessageBuilder::AppendAddress(Address addr) {
|
| Append("0x%" V8PRIxPTR, addr);
|
| }
|
|
|
|
|
| -void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) {
|
| +void Log::MessageBuilder::AppendSymbolName(Symbol* symbol) {
|
| + ASSERT(symbol);
|
| + Append("symbol(");
|
| + if (!symbol->name()->IsUndefined()) {
|
| + Append("\"");
|
| + AppendDetailed(String::cast(symbol->name()), false);
|
| + Append("\" ");
|
| + }
|
| + Append("hash %x)", symbol->Hash());
|
| +}
|
| +
|
| +
|
| +void Log::MessageBuilder::AppendDetailed(String* str, bool show_impl_info) {
|
| if (str == NULL) return;
|
| DisallowHeapAllocation no_gc; // Ensure string stay valid.
|
| int len = str->length();
|
| @@ -226,7 +238,7 @@ void LogMessageBuilder::AppendDetailed(String* str, bool show_impl_info) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::AppendStringPart(const char* str, int len) {
|
| +void Log::MessageBuilder::AppendStringPart(const char* str, int len) {
|
| if (pos_ + len > Log::kMessageBufferSize) {
|
| len = Log::kMessageBufferSize - pos_;
|
| ASSERT(len >= 0);
|
| @@ -240,7 +252,7 @@ void LogMessageBuilder::AppendStringPart(const char* str, int len) {
|
| }
|
|
|
|
|
| -void LogMessageBuilder::WriteToLogFile() {
|
| +void Log::MessageBuilder::WriteToLogFile() {
|
| ASSERT(pos_ <= Log::kMessageBufferSize);
|
| const int written = log_->WriteToFile(log_->message_buffer_, pos_);
|
| if (written != pos_) {
|
|
|