1

I cannot get vue-logger to work in my Vuex store file(s)

I would like to use vue-logger in my Vuex store file (and modules). However, I keep getting the error: "TypeError: Cannot read property 'info' of undefined" when I execute a statement like "Vue.log.info(....)".

I had a similar problem with using "this.$http.get" in the store file, but that works now by using the "Vue.http.get" (as explained in this StackOverflow Answer). However, "this.$log.info" does not work (for reasons obvious to me now, as in the store I am outside of the vue instance), but neither does "Vue.log.info".

How can I use vue-logger in the store?

Onkar Musale
  • 909
  • 10
  • 25
bjorn_h
  • 139
  • 3
  • 12

1 Answers1

3

Try to use Vue.$log.info.

Notice the extra $ before log.

Radu Diță
  • 13,476
  • 2
  • 30
  • 34