如何调试肉桂小程序?

2024-03-29

我想写一个肉桂小程序。这些都是基于 JavaScript 的。我希望编写的代码更改服务(打开和关闭它们,类似于WebDeveloper菜单小程序 https://bitbucket.org/infiniteshroom/cinnamon-webdevelopermenuapplet/src/e254b5bbd25b57864d9e04efb9ead9a1599dd2e1/web-developer-menu%40infiniteshroom/applet.js?at=master)。我不希望服务启动/停止/重新启动的调试起作用,但我想知道如何调试菜单项和对函数的调用。我还希望编写一个配置小程序,其中涉及一些更复杂的编码或对外部服务器的调用。

是否可以将其加载到网络浏览器中,或者是否有更好的方法来调试它?我不知道导入命令在哪里,所以我不知道如何在网络浏览器中复制它。

目前使用 IntelliJ IDEA 作为 IDE,但很愿意为这个项目切换到任何东西。


这里最好的选择是向终端打印消息的老技巧。使用global.log(...)为此,这些行被发送到~/.cinnamon/glass.log文件,观看他们所做的事情:

tail -f ~/.cinnamon/glass.log 

Also, as stated by @elParaguayo https://stackoverflow.com/users/3087339/elparaguayo, type Alt+F2 to bring the Cinnamon prompt, type in lg and press ENTER to show the Looking Glass Debugger topmost dialog, there you can evaluate expressions by typing them in the Exec: input box and watching the results listed in the Results tab.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何调试肉桂小程序? 的相关文章

随机推荐