-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom logger not working #553
Comments
Hello @rtojagic, thanks for using EmbedIO! Your logger is not working because its On a side note, if you don't need to dispose your logger just make public class ServerLogger : Swan.Logging.ILogger
{
public Swan.Logging.LogLevel LogLevel => Swan.Logging.LogLevel.Trace;
public void Dispose()
{
}
public void Log(Swan.Logging.LogMessageReceivedEventArgs logEvent)
{
Debug.Log("<color=yellow>Called logger</color>");
ImGuiLogger.Instance.Log("Calling log from custom logger.");
ImGuiLogger.Instance.Log(logEvent.Message);
}
} Regarding the SSL connection error, if your program runs under Windows you probably need to register your certificate with the OS security subsystem. EmbedIO can do it for you: string url = "https://127.0.0.1:6060/";
string certPath = $"File://{Application.streamingAssetsPath}/cert.pfx";
var cert = new X509Certificate2(new X509Certificate(certPath));
_server = new WebServer(o =>
o.WithUrlPrefix(url)
.WithMode(HttpListenerMode.EmbedIO)
.WithCertificate(cert)
.WithAutoRegisterCertificate() // <-- Add this
).WithLocalSessionManager()
.WithWebApi("/THLinkAPI", (m) => m.WithController<THLinkApiController>());
Swan.Logging.Logger.RegisterLogger<ServerLogger>(); |
@rdeago Hey thanks a lot for the fast reply! :) I've set the log level to Trace and I can see logs now which is awesome. Btw, now when I add the And, btw, certificate is already installed: If I omit the |
I tried implementing a custom logger:
and then I tried to register it
But I am not able to see any outputs.
Log
method is never called. Am I missing something?Using this from Unity 2020 on .NET 2.0 standard.
BTW, it's on running on Unitys Mono, and I am having SSL connection error which I am trying to debug, is why I need custom logger, cause I can't see any logs from Unity. If possibly I did something wrong here with setting up SSL you can help me correct that, then I wouldn't care about logs further unless I have another issue at some point.
The text was updated successfully, but these errors were encountered: