# Log

日志

## 用法

设置过滤
  ```
  // 只显示 List 和 GridTree 的日志
  VueLogger.allowGadgets(['List', 'GridTree'])
  ```

清除过滤

  ```
  VueLogger.allowGadgets([])
  VueLogger.allowGadgets()
  ```

在组件内使用

    this.$error('this.$error(\'hello world\')')
    this.$log('this.$log(\'hello world\')')
    this.$warn('this.$warn(\'hello world\')')
    this.$info('this.$debug(\'hello world\')')

在组件外函数中使用 

    Vue.console.error('Vue.console.error(\'hello world\')', 'aname')
    Vue.console.log('Vue.console.log(\'hello world\')', 'aname')
    Vue.console.warn('Vue.console.warn(\'hello world\')', 'aname')
    Vue.console.info('Vue.console.debug(\'hello world\')', 'aname')

例如
```
    function log () {
        Vue.console.error('Vue.console.error(\'hello world\')', 'aname')
        Vue.console.log('Vue.console.log(\'hello world\')', 'aname')
        Vue.console.warn('Vue.console.warn(\'hello world\')', 'aname')
        Vue.console.info('Vue.console.debug(\'hello world\')', 'aname')
    }

    export default {
      methods: {
          log2 () {
            this.$error('this.$error(\'hello world\')')
            this.$log('this.$log(\'hello world\')')
            this.$warn('this.$warn(\'hello world\')')
            this.$info('this.$debug(\'hello world\')')
          }
      },
      ready () {
        VueLogger.allowGadgets("app")
        this.log2()
        log()
        VueLogger.allowGadgets()
        this.log2()
        log()
      },
    }

```

