1.0.0 • Published 6 years ago

logwriter.js v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Log Writer

Write beautiful logs to your terminal or to your browser.

Write logs for Node.js

alt text

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

alt text

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