1 // Copyright 2020 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef V8_LOGGING_LOCAL_LOGGER_H_ 6 #define V8_LOGGING_LOCAL_LOGGER_H_ 7 8 #include "src/base/logging.h" 9 #include "src/logging/log.h" 10 11 namespace v8 { 12 namespace internal { 13 14 // TODO(leszeks): Add support for logging from off-thread. 15 class LocalLogger { 16 public: 17 explicit LocalLogger(Isolate* isolate); 18 is_logging()19 bool is_logging() const { return is_logging_; } is_listening_to_code_events()20 bool is_listening_to_code_events() const { 21 return is_listening_to_code_events_; 22 } 23 void ScriptDetails(Script script); 24 void ScriptEvent(Logger::ScriptEventType type, int script_id); 25 void CodeLinePosInfoRecordEvent(Address code_start, 26 ByteArray source_position_table); 27 28 private: 29 Logger* logger_; 30 bool is_logging_; 31 bool is_listening_to_code_events_; 32 }; 33 34 } // namespace internal 35 } // namespace v8 36 37 #endif // V8_LOGGING_LOCAL_LOGGER_H_ 38