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 { |
(...skipping 14 matching lines...) Expand all Loading... |
25 Log::~Log() { | 25 Log::~Log() { |
26 // Did someone enable manual flushing and then forgot to Flush? | 26 // Did someone enable manual flushing and then forgot to Flush? |
27 ASSERT(cursor() == 0); | 27 ASSERT(cursor() == 0); |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 Log* Log::Current() { | 31 Log* Log::Current() { |
32 Thread* thread = Thread::Current(); | 32 Thread* thread = Thread::Current(); |
33 Isolate* isolate = thread->isolate(); | 33 Isolate* isolate = thread->isolate(); |
34 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) { | 34 if (isolate != NULL && Log::ShouldLogForIsolate(isolate)) { |
35 return thread->log(); | 35 OSThread* os_thread = thread->os_thread(); |
| 36 ASSERT(os_thread != NULL); |
| 37 return os_thread->log(); |
36 } else { | 38 } else { |
37 return Log::NoOpLog(); | 39 return Log::NoOpLog(); |
38 } | 40 } |
39 } | 41 } |
40 | 42 |
41 | 43 |
42 void Log::Print(const char* format, ...) { | 44 void Log::Print(const char* format, ...) { |
43 if (this == NoOpLog()) { | 45 if (this == NoOpLog()) { |
44 return; | 46 return; |
45 } | 47 } |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 log_->EnableManualFlush(); | 162 log_->EnableManualFlush(); |
161 } | 163 } |
162 | 164 |
163 | 165 |
164 LogBlock::~LogBlock() { | 166 LogBlock::~LogBlock() { |
165 log_->Flush(cursor_); | 167 log_->Flush(cursor_); |
166 log_->DisableManualFlush(); | 168 log_->DisableManualFlush(); |
167 } | 169 } |
168 | 170 |
169 } // namespace dart | 171 } // namespace dart |
OLD | NEW |