@@ -148,21 +148,28 @@ func (c *logger) Request(tag string, request any, err error) {
148148 c .sendTraceInternal (msg , lvl )
149149}
150150
151- func (c * logger ) Response (tag string , response any , returnCode types.ResponseCode , err error ) {
152- c .logger .Response (tag , response , int (returnCode ), returnCode .String (), err )
151+ func (c * logger ) Response (tag string , response any , returnCode types.ResponseCode , properties any , err error ) {
152+ c .logger .Response (tag , response , int (returnCode ), returnCode .String (), properties , err )
153153 if c .th == nil || c .disableTraceLogging {
154154 return
155155 }
156156 var msg string
157157 lvl := ai .InfoLevel
158+
159+ // Create a string for properties if they exist
160+ props := ""
161+ if properties != nil {
162+ props = fmt .Sprintf (" Properties: %+v" , properties )
163+ }
164+
158165 switch {
159166 case err == nil && returnCode == 0 :
160- msg = fmt .Sprintf ("[%s] Sent %T %+v." , tag , response , response )
167+ msg = fmt .Sprintf ("[%s] Sent %T %+v.%s " , tag , response , response , props )
161168 case err != nil :
162- msg = fmt .Sprintf ("[%s] Code:%s, %+v %s." , tag , returnCode .String (), response , err .Error ())
169+ msg = fmt .Sprintf ("[%s] Code:%s, %+v %s.%s " , tag , returnCode .String (), response , err .Error (), props )
163170 lvl = ai .ErrorLevel
164171 default :
165- msg = fmt .Sprintf ("[%s] Code:%s, %+v." , tag , returnCode .String (), response )
172+ msg = fmt .Sprintf ("[%s] Code:%s, %+v.%s " , tag , returnCode .String (), response , props )
166173 }
167174 c .sendTraceInternal (msg , lvl )
168175}
0 commit comments