(minified 532 bytes, gzipped ~ 330 bytes)įunction anylogger ( name, options ) => logger Wouldn't it be much better and easier? Download Plug in any framework of our choice and all libraries will automatically ~ 330 bytes shared between all libraries doing this, we can Or just abandoning logging altogether, choose anylogger and for just Or forcing the choice for a certain logging framework on your users, Instead of building in your own library specific configuration mechanism, Library to support logging, while at the same time allowing applicationĭevelopers to plug in any logging framework they choose. Introducing anyloggerĪ tiny ~ 330 bytes logging facade that you can include in your So what we need is a simple and small logging facade and a bunch of adaptersįor popular loggers. In our application we back theįacade object by the actual logging framework with an Our library log to a simple facade object. In the context of our logging problem, we can have Which loggerĭo we pick? Should we make this configurable? Should we just not log? Use theĬonsole directly? How do we deal with this complexity?īehind a simple interface. Of logging libraries around and we library authors face a challenge. We, the Javascript community, really need a logging facade. Log4js anylogger-log4js Add to entry point index.js import "anylogger-log4js" Use import anylogger from 'anylogger' Ulog Add to entry point index.js import "ulog" Use import anylogger from 'anylogger' Loglevel anylogger-loglevel Add to entry point index.js import "anylogger-loglevel" Use import anylogger from 'anylogger' Install npm i -P anylogger Use import anylogger from 'anylogger'ĭebug anylogger-debug Add to entry point index.js import "anylogger-debug" Use import anylogger from 'anylogger' Logging framework the application developer selected. Logging framework on the application developer. When we want to do logging from a library, we don't want to force the choice of
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |