2.0.2 • Published 9 years ago

console-x v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

consoleX.js

Enhanced console logging functionality

Features

  • Different colors for message levels: log, notify, warn, err. These colors can be customized.
  • Messages specified in the form of a summary (which is colored) and content (which retains default color), so that color is used judiciously, making messages clearer
  • Option to add a semicolon after message summary
  • Option to specify a prefix function that generates a consistent prefix (displayed in gray) for messages

API

consoleX(options).configure(options)

consoleX(options).log(summary,description)

consoleX(options).notify(summary,description)

consoleX(options).warn(summary,description)

consoleX(options).err(summary,description)

Example

const consoleX = require('console-x').configure({
	separator: "\n", // appended after each individual log to screen; default is newline
	summaryColon: true, // whether to append colon after summary; default is true
	getPrefix: function() { return "Test Message>>" }, // prefix function; default is timestamp; pass null to disable
	colors: {
		log: "white", // default
		notify: "green", //default
		warn: "yellow", //default
		err: "red" //default
	}
});

consoleX.log ("Eureka", "I have found it")
consoleX.notify ("Eureka", "I have found it")
consoleX.warn ("Eureka", "I have found it")
consoleX.err ("Eureka", "I have found it")

Install

npm install console-x --save

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

0.1.8

9 years ago

0.1.7

10 years ago

0.1.6

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago