Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pajaydev/log-cli
✨ Logger module for node cli's.
https://github.com/pajaydev/log-cli
chalk cli-logging log log-cli logging-library node-logger ora
Last synced: about 1 month ago
JSON representation
✨ Logger module for node cli's.
- Host: GitHub
- URL: https://github.com/pajaydev/log-cli
- Owner: pajaydev
- Created: 2020-05-29T05:00:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-26T23:06:26.000Z (over 2 years ago)
- Last Synced: 2023-03-01T11:06:56.586Z (almost 2 years ago)
- Topics: chalk, cli-logging, log, log-cli, logging-library, node-logger, ora
- Language: JavaScript
- Homepage:
- Size: 436 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# log-cli
[![Build Status](https://travis-ci.org/pajaydev/log-cli.svg?branch=master)](https://travis-ci.org/github/pajaydev/log-cli)A simple logger for node cli, it wraps around chalk and ora package.
## Installation
```shell
npm install log-cli
```
or```shell
yarn add log-cli
```## Usage:
```javascript
const Logger = require('log-cli')const logger = new Logger();
logger.log('this is normal message');
// prints the success message in green color
logger.success('this is success message');
// prints the message with the default prefix
logger.success('this is success message', true);
```
## Examples
- [click here](https://github.com/pajaydev/log-cli/blob/master/example.js)## Methods
```
warn, success, error, log, info, bold, spin, spinStart, spinStop
```### Change the default colors of logging
Default color mapping
```json
{
"error": "red",
"info": "cyan",
"warn": "yellow",
"success": "green"
}
```You can override colors using the `setColor` method like below
```javascript
logger.setColor({info: 'grey'});
```## credits.
- [Chalk](https://www.npmjs.com/package/chalk)
- [Ora](https://www.npmjs.com/package/ora)