kutuluk / loglevel-plugin-remote

A loglevel plugin for sending browser logs to a server
MIT License
102 stars 36 forks source link

Do we need a onMessageDropped handler? #9

Closed kutuluk closed 6 years ago

kutuluk commented 6 years ago

@Looooopy

2.1 Add ability to do something with dropped messages in a callback function, e.g) (msg) => console.log(msg)

console.log(msg) will be called in any case by the loglevel. Is it really necessary to have an onMessageDropped handler? I just do not want to complicate the API without the urgent need.

Looooopy commented 6 years ago

No its not necessary for me, I was using it for convenient way of seeing that the processing was done correctly. I thought that it could be useful for some people to see that a particular message was dropped and may have some alternative server to send those messages .

If we start using a test framework soon we not need things like this to test that we are thinking correctly :)

kristofferahl commented 6 years ago

I vote drop it for now. If we need it later, we add it.

kutuluk commented 6 years ago

If we start using a test framework soon we not need things like this to test that we are thinking correctly :)

Test will be possible without this functionality. We know inbound messages on the client and received messages at the server. It is easy to determine which messages have been dropped.