Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shakyshane/eazy-logger
easy cli logger
https://github.com/shakyshane/eazy-logger
Last synced: about 2 months ago
JSON representation
easy cli logger
- Host: GitHub
- URL: https://github.com/shakyshane/eazy-logger
- Owner: shakyShane
- License: apache-2.0
- Created: 2014-09-16T07:48:51.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-21T11:32:05.000Z (about 1 year ago)
- Last Synced: 2024-04-14T21:53:25.789Z (9 months ago)
- Language: JavaScript
- Size: 165 KB
- Stars: 14
- Watchers: 2
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
##eazy-logger [![Build Status](https://travis-ci.org/shakyShane/easy-logger.svg?branch=master)](https://travis-ci.org/shakyShane/easy-logger) [![Coverage Status](https://img.shields.io/coveralls/shakyShane/easy-logger.svg)](https://coveralls.io/r/shakyShane/easy-logger?branch=master)
[tFunk](https://github.com/shakyShane/tfunk) + [String Substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data)
![preview](http://cl.ly/image/3K2E2d111l15/Screen%20Shot%202014-09-17%20at%2020.49.17.png)
##Install
```
$ npm install eazy-logger --save
```##Usage
```js
var logger = require("eazy-logger").Logger({
prefix: "{blue:[}{magenta:easy-logger}{blue:] }",
useLevelPrefixes: true
});
``````js
/**
* Standard loggers + prefixes
*/
logger.debug("Debugging Msg");
logger.info("Info statement");
logger.warn("A little warning with string %s", "substitution");
logger.error("an error occurred in file: {red:%s}", "/users/awesomedev/file.js");
``````js
/**
* Use string substitution + colours
*/
logger.log("error", "Use {green:built-in} %s", "String substitution");
``````js
/**
* Set an option for the next log statement only
*/
logger.setOnce("useLevelPrefixes", true).warn("Use {green:built-in} %s", "String substitution");
```