16#ifndef SIMICS_SYSTEMC_AWARENESS_LOG_H
17#define SIMICS_SYSTEMC_AWARENESS_LOG_H
19#include <simics/cc-api.h>
29template<log_type_t Type = Sim_Log_Info,
36 : std::ostream(&str_buf_), str_buf_(log_obj) {}
38 if (tellp() != std::streampos(0)) {
44 class StrBuf :
public std::stringbuf {
46 explicit StrBuf(ConfObjectRef log_obj)
47 : std::stringbuf(ios_base::out),
48 log_obj_(log_obj.object()) {}
52 std::string msg = str();
54 std::string::size_type pos = msg.find_last_not_of(
" \t\n");
55 if (pos != msg.length() - 1) {
56 if (pos == std::string::npos) {
62 VT_log_message(log_obj_, Level, Groups, Type, msg.c_str());
65 return std::stringbuf::sync();
68 conf_object_t *log_obj_;
Output stream class using the Simics log API.
Definition: log.h:32
~LogStream()
Definition: log.h:37
LogStream(ConfObjectRef log_obj)
Definition: log.h:34
Definition: pci_bus_interface.h:24