choojs / choo-devtools

💼 - Expose a choo instance on the window
MIT License
53 stars 17 forks source link

why do we always log `use { count: 0 }` on startup? #38

Closed ungoldman closed 4 years ago

ungoldman commented 4 years ago

I've been scratching my head for a long time trying to figure out why we're doing this:

  hooks.on('use', function (count, duration) {
    logger('debug')('use', { count: count }, duration + 'ms')
  })

The code come from /lib/logger.js#L32-L34, and is tied to this other piece here:

if (usesListener) usesListener(self.buffer.use.length, duration)

choo-hooks/index.js#L134

All it ever seems to do for me is cause a log event on every startup with the exact same content, something more or less like this:

 16:41:15 🐛 choo use 0ms  { count: 0 }

As far as I can tell this is junk logging that's not contributing much other than cluttering the console. Does anyone know what it's supposed to be communicating?

goto-bus-stop commented 4 years ago

I think it may have been intended to show the amount of stores that you are app.use()ing? It likely broke in one of the store ordering changes in 6.x…

ungoldman commented 4 years ago

If it's broken / not reporting any useful information I vote we remove it unless someone's strongly motivated to add a working use count (perhaps with a more descriptive message)

goto-bus-stop commented 4 years ago

that seems fair!