Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: src/log-utils.cc

Issue 2619213002: [build] Introduce an embedder version string (Closed)
Patch Set: rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « include/v8-version-string.h ('k') | src/version.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 if (strcmp(log_file_name, kLogToConsole) == 0) { 48 if (strcmp(log_file_name, kLogToConsole) == 0) {
49 OpenStdout(); 49 OpenStdout();
50 } else if (strcmp(log_file_name, kLogToTemporaryFile) == 0) { 50 } else if (strcmp(log_file_name, kLogToTemporaryFile) == 0) {
51 OpenTemporaryFile(); 51 OpenTemporaryFile();
52 } else { 52 } else {
53 OpenFile(log_file_name); 53 OpenFile(log_file_name);
54 } 54 }
55 55
56 if (output_handle_ != nullptr) { 56 if (output_handle_ != nullptr) {
57 Log::MessageBuilder msg(this); 57 Log::MessageBuilder msg(this);
58 msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(), 58 if (strlen(Version::GetEmbedder()) == 0) {
59 Version::GetMinor(), Version::GetBuild(), Version::GetPatch(), 59 msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
60 Version::IsCandidate()); 60 Version::GetMinor(), Version::GetBuild(),
61 Version::GetPatch(), Version::IsCandidate());
62 } else {
63 msg.Append("v8-version,%d,%d,%d,%d,%s,%d", Version::GetMajor(),
64 Version::GetMinor(), Version::GetBuild(),
65 Version::GetPatch(), Version::GetEmbedder(),
66 Version::IsCandidate());
67 }
61 msg.WriteToLogFile(); 68 msg.WriteToLogFile();
62 } 69 }
63 } 70 }
64 } 71 }
65 72
66 73
67 void Log::OpenStdout() { 74 void Log::OpenStdout() {
68 DCHECK(!IsEnabled()); 75 DCHECK(!IsEnabled());
69 output_handle_ = stdout; 76 output_handle_ = stdout;
70 } 77 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 const int written = log_->WriteToFile(log_->message_buffer_, pos_); 242 const int written = log_->WriteToFile(log_->message_buffer_, pos_);
236 if (written != pos_) { 243 if (written != pos_) {
237 log_->stop(); 244 log_->stop();
238 log_->logger_->LogFailure(); 245 log_->logger_->LogFailure();
239 } 246 }
240 } 247 }
241 248
242 249
243 } // namespace internal 250 } // namespace internal
244 } // namespace v8 251 } // namespace v8
OLDNEW
« no previous file with comments | « include/v8-version-string.h ('k') | src/version.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698