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?

1
  • try this Commented Mar 27, 2019 at 13:31

1 Answer 1

3

Try to use Vue.$log.info.

Notice the extra $ before log.

Sign up to request clarification or add additional context in comments.

1 Comment

That works! Thank you! (and why didn't I think if trying that...?)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.