probil / vue-socket.io-extended

:v::zap: Socket.io bindings for Vue.js and Vuex (inspired by Vue-Socket.io)
MIT License
629 stars 38 forks source link

Enable debug #307

Open brunopiaui opened 5 years ago

brunopiaui commented 5 years ago

Hi,

How can I set debug enable on start config?

import Vue from 'vue'
import VueSocketIO from 'vue-socket.io-extended'
import io from 'socket.io-client'

const socket = io('http://localhost:4000')

Vue.use(VueSocketIO, socket)

Thanks

probil commented 5 years ago

Hi, @brunopiaui Which kind of debug do you mean?

Socket.io debug can be enabled by typing this line of code in DevTools console or directly in your code.

localStorage.debug = '*';

More info here: https://socket.io/docs/logging-and-debugging/

brunopiaui commented 5 years ago

Hi @probil, In MetinSeylan/Vue-Socket.io we can set that way:

Vue.use(new VueSocketIO({
  debug: true,
  connection: 'http://metinseylan.com:1992'
}))

Is there something similar??

I tried but returned an error..

probil commented 5 years ago

We don't support such logging right now. Can you tell me why it's useful? I will be glad to implement it

hardmagnett commented 5 years ago

MetinSeylan/Vue-Socket.io shows in debug what action/mutation in what vuex-module is triggered. Sometimes this feature is very useful.

localStorage.debug = '*' and localStorage.debug = 'socket.io-client:socket' don't do it.

probil commented 5 years ago

Thanks @flamytwista I'll check it out.

BTW, add :+1: to the first message if you'd like to see a feature in future versions