| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/log.h" | 5 #include "vm/log.h" |
| 6 | 6 |
| 7 #include "vm/flags.h" | 7 #include "vm/flags.h" |
| 8 #include "vm/thread.h" | 8 #include "vm/thread.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| 11 | 11 |
| 12 DEFINE_FLAG(bool, force_log_flush, false, "Always flush log messages."); | 12 DEFINE_FLAG(bool, force_log_flush, false, "Always flush log messages."); |
| 13 | 13 |
| 14 DEFINE_FLAG(charp, isolate_log_filter, NULL, | 14 DEFINE_FLAG(charp, isolate_log_filter, NULL, |
| 15 "Log isolates whose name include the filter. " | 15 "Log isolates whose name include the filter. " |
| 16 "Default: service isolate log messages are suppressed."); | 16 "Default: service isolate log messages are suppressed " |
| 17 "(specify 'vm-service' to log them)."); |
| 17 | 18 |
| 18 Log::Log(LogPrinter printer) | 19 Log::Log(LogPrinter printer) |
| 19 : printer_(printer), | 20 : printer_(printer), |
| 20 manual_flush_(0), | 21 manual_flush_(0), |
| 21 buffer_(0) { | 22 buffer_(0) { |
| 22 } | 23 } |
| 23 | 24 |
| 24 | 25 |
| 25 Log::~Log() { | 26 Log::~Log() { |
| 26 // Did someone enable manual flushing and then forgot to Flush? | 27 // Did someone enable manual flushing and then forgot to Flush? |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 log_->EnableManualFlush(); | 163 log_->EnableManualFlush(); |
| 163 } | 164 } |
| 164 | 165 |
| 165 | 166 |
| 166 LogBlock::~LogBlock() { | 167 LogBlock::~LogBlock() { |
| 167 log_->Flush(cursor_); | 168 log_->Flush(cursor_); |
| 168 log_->DisableManualFlush(); | 169 log_->DisableManualFlush(); |
| 169 } | 170 } |
| 170 | 171 |
| 171 } // namespace dart | 172 } // namespace dart |
| OLD | NEW |