| 845 | } |
| 846 | |
| 847 | void LoggerBackend::EnqueueEntryToBacktrace(std::uint64_t timestamp, const void* functionName, const void* content, std::uint32_t contentLength) noexcept |
| 848 | { |
| 849 | using namespace Implementation; |
| 850 | |
| 851 | if (_backtraceStorage != nullptr) { |
| 852 | StringView threadId; |
| 853 | char buffer[16]; |
| 854 | if (std::uint32_t tid = GetNativeThreadId()) { |
| 855 | std::int32_t length = snprintf(buffer, sizeof(buffer), "%u", tid); |
| 856 | threadId = StringView{buffer, static_cast<std::size_t>(length)}; |
| 857 | } |
| 858 | |
| 859 | TransitEvent transitEvent; |
| 860 | transitEvent.Timestamp = timestamp; |
| 861 | transitEvent.FunctionName = static_cast<const char*>(functionName); |
| 862 | transitEvent.Message.resize(contentLength); |
| 863 | transitEvent.Level = TraceLevel::Deferred; |
| 864 | std::memcpy(&transitEvent.Message[0], content, contentLength); |
| 865 | |
| 866 | _backtraceStorage->Store(Death::move(transitEvent), threadId); |
| 867 | } else { |
| 868 | DispatchEntryToSinks(TraceLevel::Deferred, timestamp, functionName, content, contentLength, {}); |
| 869 | } |
| 870 | } |
| 871 | #endif |
| 872 | |
| 873 | void Logger::AttachSink(ITraceSink* sink) |
no test coverage detected