2.0.2 • Published 8 years ago

console-x v2.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
8 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

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago