deepgram-dotnet-sdk icon indicating copy to clipboard operation
deepgram-dotnet-sdk copied to clipboard

Have the Ability for a User Provided Logger, Also Provide a Default

Open davidvonthenen opened this issue 1 year ago • 2 comments
trafficstars

Proposed changes

Context

Possible Implementation

Other information

davidvonthenen avatar Jun 12 '24 02:06 davidvonthenen

Hello, it's not documented. But I examined the code to figure out you can do the following:

Define a class like: public class DeepgramLogger : Serilog.ILogger { public void Write(LogEvent logEvent) { .. Add your code here for custom logging } }

And pass this to the Library with the following:

Deepgram.Logger.Log.Initialize(new DeepgramLogger());

sgodin avatar Sep 24 '24 20:09 sgodin

Yea, the other objective to this issue is to define an interface for the logger within the SDK here. It isn't explicitly called out here, but that's one of the other intents

davidvonthenen avatar Sep 24 '24 20:09 davidvonthenen