OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 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 #include "src/log-utils.h" | 5 #include "src/log-utils.h" |
6 | 6 |
7 #include "src/assert-scope.h" | 7 #include "src/assert-scope.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/objects-inl.h" | 9 #include "src/objects-inl.h" |
10 #include "src/string-stream.h" | 10 #include "src/string-stream.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 void Log::Initialize(const char* log_file_name) { | 30 void Log::Initialize(const char* log_file_name) { |
31 message_buffer_ = NewArray<char>(kMessageBufferSize); | 31 message_buffer_ = NewArray<char>(kMessageBufferSize); |
32 | 32 |
33 // --log-all enables all the log flags. | 33 // --log-all enables all the log flags. |
34 if (FLAG_log_all) { | 34 if (FLAG_log_all) { |
35 FLAG_log_api = true; | 35 FLAG_log_api = true; |
36 FLAG_log_code = true; | 36 FLAG_log_code = true; |
37 FLAG_log_gc = true; | 37 FLAG_log_gc = true; |
38 FLAG_log_suspect = true; | 38 FLAG_log_suspect = true; |
39 FLAG_log_handles = true; | 39 FLAG_log_handles = true; |
40 FLAG_log_regexp = true; | |
41 FLAG_log_internal_timer_events = true; | 40 FLAG_log_internal_timer_events = true; |
42 } | 41 } |
43 | 42 |
44 // --prof implies --log-code. | 43 // --prof implies --log-code. |
45 if (FLAG_prof) FLAG_log_code = true; | 44 if (FLAG_prof) FLAG_log_code = true; |
46 | 45 |
47 // If we're logging anything, we need to open the log file. | 46 // If we're logging anything, we need to open the log file. |
48 if (Log::InitLogAtStart()) { | 47 if (Log::InitLogAtStart()) { |
49 if (strcmp(log_file_name, kLogToConsole) == 0) { | 48 if (strcmp(log_file_name, kLogToConsole) == 0) { |
50 OpenStdout(); | 49 OpenStdout(); |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 const int written = log_->WriteToFile(log_->message_buffer_, pos_); | 235 const int written = log_->WriteToFile(log_->message_buffer_, pos_); |
237 if (written != pos_) { | 236 if (written != pos_) { |
238 log_->stop(); | 237 log_->stop(); |
239 log_->logger_->LogFailure(); | 238 log_->logger_->LogFailure(); |
240 } | 239 } |
241 } | 240 } |
242 | 241 |
243 | 242 |
244 } // namespace internal | 243 } // namespace internal |
245 } // namespace v8 | 244 } // namespace v8 |
OLD | NEW |