mp2heel
v1.0.8
Published
client2 for wechat mp
Downloads
8
Readme
Marlog
项目介绍
一个网页页面显示控制台打印日志,并格式化显示的js库.
很多页面效果和js逻辑,在电脑开发时,正常显示与正常运行,但是到很多手机上就无法支持,开发人员又无法获取报错信息,给移动开发带来了极大的不便.有了Mlog,网页开发可以不用F12, 就可以直接查看控制台打印的日志,大大方便了前端开发和调试,尤其是在无法查看控制台的移动端,微信端.
预览网址:https://mlog.nongshiye.com
软件架构
软件采用es6开发,gulp 打包
安装教程
- 暂时只支持html页面直接引入js文件,后续会增加npm,bower等包管理平台
- 引入很简单,只需3步即可
①引入js文件 ②初始化Mlog window.onload=function(){ var mlog = new Mlog(); } ③在需要显示调试器时调用mlog.show()方法或者getMlog().show()即可 window.onload=function(){ var mlog = new Mlog(); mlog.show() }
使用说明
Mlog只会初始化一次,重置执行new Mlog();只会实例化一次
Mlog实例化之后,可以动过getMlog()方法获得Mlog实例
请尽量避免生产环境使用Mlog打印敏感信息,以防信息泄露;同时,提高.show()方法调用的门槛,防止用户误触发
Mlog实例化后提供几个简单API可用调用
①window.getMlog()
返回Mlog实例
②show()
显示调试器
③close()
关闭调试器