@@ -71,11 +71,45 @@ void TraceTx(Logging::ILoggerInternal* logger, const Core::IServiceEndpoint* add
7171 }
7272}
7373
74+ // targeted messages
75+ template <class SilKitMessageT >
76+ void TraceTx (Logging::ILoggerInternal* logger, const Core::IServiceEndpoint* addr, const std::string_view target, const SilKitMessageT& msg)
77+ {
78+ if (logger->GetLogLevel () == Logging::Level::Trace)
79+ {
80+ Logging::LoggerMessage lm{logger, Logging::Level::Trace};
81+ lm.SetMessage (" Send message" );
82+ lm.SetKeyValue (addr->GetServiceDescriptor ());
83+ lm.FormatKeyValue (Logging::Keys::msg, " {}" , msg);
84+ lm.FormatKeyValue (Logging::Keys::to, " {}" , target);
85+
86+ auto virtualTimeStamp = GetTimestamp (msg);
87+ if (virtualTimeStamp != std::chrono::nanoseconds::duration::min ())
88+ {
89+ lm.FormatKeyValue (Logging::Keys::virtualTimeNS, " {}" , virtualTimeStamp.count ());
90+ }
91+ lm.Dispatch ();
92+ }
93+ }
7494// Don't trace LogMessages - this could cause cycles!
75- inline void TraceRx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , const Logging::LogMsg& /* msg*/ ) {}
76- inline void TraceTx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , const Logging::LogMsg& /* msg*/ ) {}
95+ inline void TraceRx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ ,
96+ const Logging::LogMsg& /* msg*/ )
97+ {
98+ }
99+ inline void TraceTx (Logging::ILoggerInternal* /* logger*/ , const Core::IServiceEndpoint* /* addr*/ ,
100+ const std::string_view /* target*/ , const Logging::LogMsg& /* msg*/ )
101+ {
102+ }
103+ inline void TraceTx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ ,
104+ const Logging::LogMsg& /* msg*/ )
105+ {
106+ }
77107
78- inline void TraceRx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , Logging::LogMsg&& /* msg*/ ) {}
79- inline void TraceTx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , Logging::LogMsg&& /* msg*/ ) {}
108+ inline void TraceRx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , Logging::LogMsg&& /* msg*/ )
109+ {
110+ }
111+ inline void TraceTx (Logging::ILoggerInternal* /* logger*/ , Core::IServiceEndpoint* /* addr*/ , Logging::LogMsg&& /* msg*/ )
112+ {
113+ }
80114} // namespace Services
81115} // namespace SilKit
0 commit comments