logwriter.js
v1.0.0
Published
Write beautiful log to your terminal or to your browser console. Keep it simple.
Downloads
1
Readme
Log Writer
Write beautiful logs to your terminal or to your browser.
Write logs for Node.js
Install Log Writer by using npm or any other package managers.
npm i -S logwriter.js
Require the module
const Logger = require('logwriter.js');
Enable or disable debugging, debugging by default is set to true. That debugging is set to true means that any message posted to the terminal or to the browser with debug
will appear, when debugging is disabled it won't appear. This can be changed anytime in the process.
Logger.doDebug(true);
Do some logging.
Logger.log('Hello World');
Or even in chains.
Logger
.log('It\'s actually possible to chain methods!')
.success('WHAAAAT!?');
Write logs in the Browser
The Logger class ataches itself to the window object by the name Logger
, therefor there is no need to import it, nor do you need to make any instances of it, it's already there!
The Browser version has the exact same documentation as for node.js version, so if you didn't already read how to use this for node.js, go up and read it :)
However, you can't use CommonJS (unless implemented yourself), so here's a link for the script. https://cdn.rawgit.com/ihack2712/logwriter.js/master/bin/index.js