| Index: runtime/vm/log.cc
|
| diff --git a/runtime/vm/log.cc b/runtime/vm/log.cc
|
| index 28db12c77a1cbb5f540536225c596b5bf8f5f276..9e941e3ef765f138f48a4f756495a24f383759b7 100644
|
| --- a/runtime/vm/log.cc
|
| +++ b/runtime/vm/log.cc
|
| @@ -22,13 +22,11 @@ DEFINE_FLAG(charp,
|
| Log::Log(LogPrinter printer)
|
| : printer_(printer), manual_flush_(0), buffer_(0) {}
|
|
|
| -
|
| Log::~Log() {
|
| // Did someone enable manual flushing and then forgot to Flush?
|
| ASSERT(cursor() == 0);
|
| }
|
|
|
| -
|
| Log* Log::Current() {
|
| Thread* thread = Thread::Current();
|
| if (thread == NULL) {
|
| @@ -46,7 +44,6 @@ Log* Log::Current() {
|
| }
|
| }
|
|
|
| -
|
| void Log::Print(const char* format, ...) {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -58,7 +55,6 @@ void Log::Print(const char* format, ...) {
|
| va_end(args);
|
| }
|
|
|
| -
|
| void Log::VPrint(const char* format, va_list args) {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -89,7 +85,6 @@ void Log::VPrint(const char* format, va_list args) {
|
| }
|
| }
|
|
|
| -
|
| void Log::Flush(const intptr_t cursor) {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -107,7 +102,6 @@ void Log::Flush(const intptr_t cursor) {
|
| buffer_.TruncateTo(cursor);
|
| }
|
|
|
| -
|
| void Log::Clear() {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -115,12 +109,10 @@ void Log::Clear() {
|
| buffer_.TruncateTo(0);
|
| }
|
|
|
| -
|
| intptr_t Log::cursor() const {
|
| return buffer_.length();
|
| }
|
|
|
| -
|
| bool Log::ShouldLogForIsolate(const Isolate* isolate) {
|
| if (FLAG_isolate_log_filter == NULL) {
|
| if (isolate->is_service_isolate()) {
|
| @@ -138,13 +130,11 @@ bool Log::ShouldLogForIsolate(const Isolate* isolate) {
|
| return true;
|
| }
|
|
|
| -
|
| Log Log::noop_log_;
|
| Log* Log::NoOpLog() {
|
| return &noop_log_;
|
| }
|
|
|
| -
|
| void Log::TerminateString() {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -152,7 +142,6 @@ void Log::TerminateString() {
|
| buffer_.Add('\0');
|
| }
|
|
|
| -
|
| void Log::EnableManualFlush() {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -160,7 +149,6 @@ void Log::EnableManualFlush() {
|
| manual_flush_++;
|
| }
|
|
|
| -
|
| void Log::DisableManualFlush() {
|
| if (this == NoOpLog()) {
|
| return;
|
| @@ -173,12 +161,10 @@ void Log::DisableManualFlush() {
|
| }
|
| }
|
|
|
| -
|
| void LogBlock::Initialize() {
|
| log_->EnableManualFlush();
|
| }
|
|
|
| -
|
| LogBlock::~LogBlock() {
|
| log_->Flush(cursor_);
|
| log_->DisableManualFlush();
|
|
|