- vue@^2.3.0
- 中文文档(建设中)
- English(working)
1.in project path:
npm install vue-mobile-log
2.import:
import Vlog from 'vue-mobile-log'
Vue.use(Vlog);
//or
Vue.use(Vlog,options)
options:
Parameter | Type | Default | Description |
---|---|---|---|
env | string |
development | when production does not open the console |
level | string |
debug | debug,info,warn,error |
3.print log:
//global call:
Vue.$vlog.debug(logMsg);
Vue.$vlog.info(logMsg);
Vue.$vlog.warn(logMsg);
Vue.$vlog.error(logMsg);
//in component:
this.$vlog.debug(logMsg);
this.$vlog.info(logMsg);
this.$vlog.warn(logMsg);
this.$vlog.error(logMsg);
- in production,log is saved to the client,and sent to the server at some point
- execute code like browser debug console
- more Tag with log for filter
- and more...
MIT