A semantic logger module, that colors / formats automatically
semlog is a simple logger utiltiy that automatically colors and formats the logging messages and objects, according to their content. It'll use a global object to store the config and the log history, so it can be easily used thoughout a project.
The semlog approach might not be for anyone, it's a lazy mans logging utility :)
$ npm install --save semlog
var semlog = ;var log = semloglog; // Optional shortcut for logging
// Pretty log an error object;// Pretty log an object (no circular object supported, sorry);// Log strings;;;;;;;;;
// Returns an array with the latest log messages (depending on the config.var logArchive = semlog;// Get current logger configvar config = semlog;// Change default options:// This will only update the option that are actually givensemlog;
Helper Functions and more examples
semlog has some built in helper functions like returning nicely formatted dates.
For a complete API Doc, please view the API docs.
More example can be found in the unit test file.
MIT © Simon Heimler