Hi,
I'm trying to implement my own IChannel implementation for eventually routing ProfilerMessages through a DiagnosticSource.
But it's not being called, why .. do we have to enable something?
We're using
LLBLGen 5.10.2 and Interceptor 2.0.7
Our very basic (for now) Channel
public class MyChannel : IChannel
{
// private DiagnosticSource _source = new DiagnosticListener("LLBLGen");
public void Send(ProfilerMessage message)
{
Debug.WriteLine(message.GetType(), nameof(LLBLGenDiagnosticsChannel));
//switch (message)
//{
// case CommandExecutionStartedMessage msg:
// _source.Write("QueryStart", null);
// break;
// case CommandExecutionEndedMessage msg:
// _source.Write("QueryEnd", null);
// break;
//}
}
public void Flush() { }
public void DisableMessageSending()
{
/* ignore, it should always keep running */
}
public void EnableMessageSending()
{
/* ignore, it will always be running */
}
}
Initialization
InterceptorCore.Initialize("MyApplicationName");
InterceptorCore.RegisterChannel(new MyChannel());
InterceptorCore.EnableMessageSending();
// Disable all channels (as we can't remove them), our own channel will not be listening to this instruction
// eventually we will replace/create the factories using ProfilerDbProviderFactory<T> ourselves to prevent
// the NamedPipeChannel+threads to be registered ... or LLBLGen should provide a way of unregistering channels
// InterceptorCore.DisableMessageSending();
Using DbProviderFactories.GetFactoryClasses() I can see all factories have correctly be replaced by the ProfilerDbProviderFactory.
Kind regards,
Alexander