anylogger-console 1.0.0
Anylogger adapter for the console
.
What is this?
This is an anylogger adapter for the console.
This package is meant for application projects that are using libraries using
anylogger
. By including this adapter in your project, all libraries using
anylogger
will automatically start to use the browser console as their logging framework.
Download
- anylogger-console.js (fully commented source ~5kB)
- anylogger-console.min.js (minified 177 bytes, gzipped ~148 bytes)
CDN
index.html
Install
Install anylogger
and this adapter:
npm install --save anylogger anylogger-console
Include in your application project
This package is meant for application projects. If you are writing a library to
be NPM installed into some other project, most likely you should not include
any adapter, but instead just use anylogger
directly.
The anylogger-console
adapter will modify the anylogger
factory in such a
way that the loggers it creates will be logging to the console.
To activate the adapter, include it in your application entry point.
Require
main.js
Import
main.js
Logging in the application project
In your application module code, only use anylogger to stay framework independent:
my-module.js
const log =
This is helpful if you ever decide to factor out the application module into a separate library.
Issues
Add an issue in this project's issue tracker to let me know of any problems you find, or questions you may have.
Copyright
© 2020 by Stijn de Witt. Some rights reserved.
License
Licensed under the MIT Open Source license.
gzip-size
The GZIP algorithm is available in different flavours and with different possible compression settings. The sizes quoted in this README have been measured using gzip-size by Sindre Sorhus, your mileage may vary.