kutuluk / loglevel-plugin-remote

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

Error: You can assign a plugin only one time #42

Open sb-cecilialiu opened 2 years ago

sb-cecilialiu commented 2 years ago

I needed to do login and logout logging, and I'm using the same custom logging:

export const customLog = (input, level, url) => { if (input != null ) {
const customJSON = log => ({ msg: {input}, level: {level}, }); remoteLogin.apply(log, { format: customJSON, url: ${url} }); log.enableAll(); log.info(input); } };

but I got this error:

Error: You can assign a plugin only one time at Object.apply (loglevel-plugin-remote.js:258:1)

Please help! Thanks so much!

mahendra-virtueinfo commented 2 years ago

Any update on the same?

sb-cecilialiu commented 2 years ago

No I got the same error.

sureshHARDIYA commented 2 years ago

I got the same issue, any update on this one?

sureshHARDIYA commented 2 years ago

I was initiating remote.apply inside useEffect. I moved outside the Functional component and it fixed it.