是否有可能在角设置在运行时的调试日志级别? [英] is it possible in angular to set the debug log level at runtime?
问题描述
是否有可能切换 $ logProvider.debugEnabled([国旗]);
在运行时
Is it possible to switch the $logProvider.debugEnabled([flag]);
at runtime?
目前的情况:
从运行阶段服务器角客户端负载设置。取决于设置,我想设置方法 $ logProvider.debugEnabled([国旗])
。
The angular client load settings from the server at the run phase. Depends on the settings I would like to set the method $logProvider.debugEnabled([flag])
.
由于提前,斯特沃
推荐答案
这个简短的回答是:不,不是真的
The short answer for this is: no, not really.
一旦您的申请已哈斯通过的.config()
块配置,无需更多的配置可以发生在应用程序自举了。
Once your application hass been configured through your .config()
block, no further configuration can take place after the application has bootstrapped.
这是由于供应商的方式工作;他们只能在配置时间。有可能是一种强制的配置,然后手动重新注入新的 $日志
服务于所有的控制器,但如果有一种方法可以做到这一点,我不知道怎么样。
This is due to the way providers work; they're only available at configuration time. There might be a way to force the configuration, and then manually re-inject the new $log
service into all of your controllers, but if there is a way to do that, I'm not sure how.
这篇关于是否有可能在角设置在运行时的调试日志级别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!