[英]What's the best way to log in Single Page Application
Just want some insight on this. 只想对此有所了解。
Currently I'm using console log in an Angular SPA. 目前,我在Angular SPA中使用控制台日志。 but obviously this log is only viewable when I develop it. 但是很明显,只有在我开发该日志时,该日志才可见。 When it is out there in other people's browse, I have no way to see and check. 当它在其他人的浏览中显示时,我无法查看和检查。
What library/tools I can use to have this sort of runtime information when the SPA is in beta test, or even in production? 当SPA处于beta测试甚至处于生产状态时,我可以使用哪些库/工具来获得此类运行时信息?
As you're using AngularJS, your best option is to use the $log service (which you have to inject into your own controllers, etc.) 在使用AngularJS时,最好的选择是使用$ log服务(必须将其注入到自己的控制器中,等等)。
Then, there are a few options to get the relevant bits out: 然后,有一些选项可用于删除相关位:
I think you should take a look a services like: 我认为您应该看看类似的服务:
and others like them, and see what you think fits your scenario best. 和其他喜欢它们的人,看看您认为最适合您的情况的是。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.