| 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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 } | 79 } |
| 80 | 80 |
| 81 bool open_log_file = FLAG_log || FLAG_log_runtime || FLAG_log_api | 81 bool open_log_file = FLAG_log || FLAG_log_runtime || FLAG_log_api |
| 82 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect | 82 || FLAG_log_code || FLAG_log_gc || FLAG_log_handles || FLAG_log_suspect |
| 83 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof; | 83 || FLAG_log_regexp || FLAG_log_state_changes || FLAG_ll_prof; |
| 84 | 84 |
| 85 // If we're logging anything, we need to open the log file. | 85 // If we're logging anything, we need to open the log file. |
| 86 if (open_log_file) { | 86 if (open_log_file) { |
| 87 if (strcmp(FLAG_logfile, "-") == 0) { | 87 if (strcmp(FLAG_logfile, "-") == 0) { |
| 88 OpenStdout(); | 88 OpenStdout(); |
| 89 } else if (strcmp(FLAG_logfile, "*") == 0) { | |
| 90 // Does nothing for now. Will be removed. | |
| 91 } else if (strcmp(FLAG_logfile, kLogToTemporaryFile) == 0) { | 89 } else if (strcmp(FLAG_logfile, kLogToTemporaryFile) == 0) { |
| 92 OpenTemporaryFile(); | 90 OpenTemporaryFile(); |
| 93 } else { | 91 } else { |
| 94 if (strchr(FLAG_logfile, '%') != NULL || | 92 if (strchr(FLAG_logfile, '%') != NULL || |
| 95 !Isolate::Current()->IsDefaultIsolate()) { | 93 !Isolate::Current()->IsDefaultIsolate()) { |
| 96 // If there's a '%' in the log file name we have to expand | 94 // If there's a '%' in the log file name we have to expand |
| 97 // placeholders. | 95 // placeholders. |
| 98 HeapStringAllocator allocator; | 96 HeapStringAllocator allocator; |
| 99 StringStream stream(&allocator); | 97 StringStream stream(&allocator); |
| 100 AddIsolateIdIfNeeded(&stream); | 98 AddIsolateIdIfNeeded(&stream); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 ASSERT(pos_ <= Log::kMessageBufferSize); | 301 ASSERT(pos_ <= Log::kMessageBufferSize); |
| 304 const int written = log_->WriteToFile(log_->message_buffer_, pos_); | 302 const int written = log_->WriteToFile(log_->message_buffer_, pos_); |
| 305 if (written != pos_) { | 303 if (written != pos_) { |
| 306 log_->stop(); | 304 log_->stop(); |
| 307 log_->logger_->LogFailure(); | 305 log_->logger_->LogFailure(); |
| 308 } | 306 } |
| 309 } | 307 } |
| 310 | 308 |
| 311 | 309 |
| 312 } } // namespace v8::internal | 310 } } // namespace v8::internal |
| OLD | NEW |