emiago / diago

Short of Dialog + GO. Library/Framework for building VOIP solutions in GO
Mozilla Public License 2.0
108 stars 14 forks source link

sipgo.Client should inherit logger from Diago in Diago{}.InviteBridge #30

Open matthew-nichols opened 9 hours ago

matthew-nichols commented 9 hours ago

I assume the call to sipgo.NewClient in diago.getClient needs to be updated to pass the logger from Diago{} to it.

Also, there are a couple places where the logger doesn't inherit properly or is difficult to set (sipgo.NewUA doesn't inherit the logger in the TransportLayer or the TransactionLayer)

emiago commented 6 hours ago

Hi @matthew-nichols

There is not yet really locality of logger everywhere. I agree. Lot of is just using global zerolog logger. I think I just do not give this too much attention, as normally I keep same logger everywhere.

Client, last time I checked had no logging (maybe something slipped), so I guess this is probably more on transport/transaction layer. Anyway thanks for bringing this up. Lets maybe start with sipgo. Also if you explain your use case (although I may guess) just to have here as reference.

matthew-nichols commented 5 hours ago

Automated test calls for our customers' phone numbers on our platform, and yeah, it looks like transport stuff ("Resolving DNS" and the like). It would be good to have the logs match with our existing trace IDs.

I was able to hack it by only allowing one call per process at a time and replacing the global logger each time, but I'm not the biggest fan of that solution.