cozy / cozy-libs

Libraries used to build Cozy products and tools.
MIT License
7 stars 12 forks source link

cozy-logger: should we refactor cozy-logger? #1399

Open Ldoppea opened 2 years ago

Ldoppea commented 2 years ago

Current cozy-logger implementation may be troublesome for future maintainers. Here are some questions/remarks I had in my head when reading the code:

What do you think about this?

I would suggest to refactor this code, but as it is used in a lot of places and as it is stable code (not edited during last 3 years) this choice may be discutable.

trollepierre commented 2 years ago

Moreover I think the log method has 4 required parameters, but we notice 2 to 3 parameters filled for most of its usage. I suggest to make explicit the required parameters, document their use with JSDoc, and add one example in the README

And I don't see the minilog website working but it got mention in our documentation: https://docs.cozy.io/en/cozy-client/logging/ .