| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 for (int i = 0; i < len; i++) { | 376 for (int i = 0; i < len; i++) { |
| 377 uc32 c = str->Get(i); | 377 uc32 c = str->Get(i); |
| 378 if (c > 0xff) { | 378 if (c > 0xff) { |
| 379 Append("\\u%04x", c); | 379 Append("\\u%04x", c); |
| 380 } else if (c < 32 || c > 126) { | 380 } else if (c < 32 || c > 126) { |
| 381 Append("\\x%02x", c); | 381 Append("\\x%02x", c); |
| 382 } else if (c == ',') { | 382 } else if (c == ',') { |
| 383 Append("\\,"); | 383 Append("\\,"); |
| 384 } else if (c == '\\') { | 384 } else if (c == '\\') { |
| 385 Append("\\\\"); | 385 Append("\\\\"); |
| 386 } else if (c == '\"') { |
| 387 Append("\"\""); |
| 386 } else { | 388 } else { |
| 387 Append("%lc", c); | 389 Append("%lc", c); |
| 388 } | 390 } |
| 389 } | 391 } |
| 390 } | 392 } |
| 391 | 393 |
| 392 | 394 |
| 393 void LogMessageBuilder::AppendStringPart(const char* str, int len) { | 395 void LogMessageBuilder::AppendStringPart(const char* str, int len) { |
| 394 if (pos_ + len > Log::kMessageBufferSize) { | 396 if (pos_ + len > Log::kMessageBufferSize) { |
| 395 len = Log::kMessageBufferSize - pos_; | 397 len = Log::kMessageBufferSize - pos_; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 412 if (written != pos_) { | 414 if (written != pos_) { |
| 413 log_->stop(); | 415 log_->stop(); |
| 414 log_->logger_->LogFailure(); | 416 log_->logger_->LogFailure(); |
| 415 } | 417 } |
| 416 } | 418 } |
| 417 | 419 |
| 418 | 420 |
| 419 #endif // ENABLE_LOGGING_AND_PROFILING | 421 #endif // ENABLE_LOGGING_AND_PROFILING |
| 420 | 422 |
| 421 } } // namespace v8::internal | 423 } } // namespace v8::internal |
| OLD | NEW |