MCPcopy Create free account
hub / github.com/Samsung/rlottie / stringify

Method stringify

src/vector/vdebug.cpp:141–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139VDebug::~VDebug() = default;
140
141void VDebug::stringify(std::ostream& os)
142{
143 char* b = !m_heap_buffer ? m_stack_buffer : m_heap_buffer.get();
144 char const* const end = b + m_bytes_used;
145 uint64_t timestamp = *reinterpret_cast<uint64_t*>(b);
146 b += sizeof(uint64_t);
147 std::thread::id threadid = *reinterpret_cast<std::thread::id*>(b);
148 b += sizeof(std::thread::id);
149 string_literal_t file = *reinterpret_cast<string_literal_t*>(b);
150 b += sizeof(string_literal_t);
151 string_literal_t function = *reinterpret_cast<string_literal_t*>(b);
152 b += sizeof(string_literal_t);
153 uint32_t line = *reinterpret_cast<uint32_t*>(b);
154 b += sizeof(uint32_t);
155 LogLevel loglevel = *reinterpret_cast<LogLevel*>(b);
156 b += sizeof(LogLevel);
157 if (m_logAll) {
158 format_timestamp(os, timestamp);
159
160 os << '[' << to_string(loglevel) << ']' << '[' << threadid << ']' << '['
161 << file.m_s << ':' << function.m_s << ':' << line << "] ";
162 }
163
164 stringify(os, b, end);
165 os << std::endl;
166
167 if (loglevel >= LogLevel::CRIT) os.flush();
168}
169
170template <typename Arg>
171char* decode(std::ostream& os, char* b, Arg* /*dummy*/)

Callers 1

writeMethod · 0.80

Calls 4

format_timestampFunction · 0.85
to_stringFunction · 0.85
decodeFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected