Logging not working in Angular application #5338
Unanswered
christian3042
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the socket.io-client lib in my Angular project and so far it everything works. I was using ngx-socket-io as a layer between Angular and socket-io, but checking the example angular-todomvc from the socket.io repository, I could also make it run without it.
I checked the documentation for logging and it seems, it is meant for running on a node server but there is also some documentation for browser.
Checking further, I figured out, that socket.io-client is using debug-js and to enable it, the value must be set as follows in the browser:
localStorage.setItem('debug', '*');
This works also for my own logging statements generated with debug(), but I cannot see any output from the socket.io-client.
I have created a sample Angular app to demonstrate the issue: https://github.com/christian3042/socketio-logging
I'm not sure, if I have configured something wrong or if it's even possible, to log the debug statements of the socket.io-client, when it's executed within an Angular environment. Further documentation, on how to specifically enable it on an Angular environment would be really helpful, as I think this is a quite common use case.
The reason for why I need the logs is to troubleshoot some issues with a Socket IO server implementation, but without having the client output, it is not possible to troubleshoot.
Beta Was this translation helpful? Give feedback.
All reactions