@emersonbraun/pretty-log
Version:
Get beautiful consoles easily
123 lines (107 loc) • 3.03 kB
Markdown
# Pretty Log
Get beautiful consoles easily










### Prerequisites
* [NPM](https://www.npmjs.com/)
or
* [YARN](https://yarnpkg.com/)
### Installing
Using NPM
```
npm i @emersonbraun/pretty-log
```
OR Yarn
```
yarn add @emersonbraun/pretty-log
```
### Usage
import package
```
import PrettyLog from '@emersonbraun/pretty-log' //es6
var PrettyLog = require('@emersonbraun/pretty-log').default // old form
```
Type Info
```
PrettyLog.info('test info')
```
Output: 
Type Info (with var)
```
const hello = 'hello word'
PrettyLog.info('test info', hello)
```
Output: 
Type success
```
PrettyLog.success('teste success')
```
Output: 
Type success (with var)
```
const hello = 'hello word'
PrettyLog.success('teste success', hello)
```
Output: 
Type warn
```
PrettyLog.warn('teste warn')
```
Output: 
Type warn (with var)
```
const hello = 'hello word'
PrettyLog.warn('teste warn', hello)
```
Output: 
Type error
```
PrettyLog.error('teste error')
```
Output: 
Type error (with var)
```
const hello = 'hello word'
PrettyLog.error('teste error', hello)
```
Output: 
Type custom
pass options
| Name | Value | Obs |
| --------- | :------------------: | :---------------------------------------------: |
| icon | 'cross', 'tick', ... | Options in [figures](https://www.npmjs.com/package/figures)|
| iconColor | 'red', 'blue', ... | Options in [chalk](https://www.npmjs.com/package/chalk)|
| title | string | Any text |
| titleColor| 'red', 'blue', ... | Options in [chalk](https://www.npmjs.com/package/chalk)|
```
PrettyLog.custom('teste custom', null, {
iconColor: 'white',
icon: 'bullet',
})
```
Output

Type custom (with var)
```
const hello = 'hello word'
PrettyLog.custom('teste custom', hello, {
iconColor: 'white',
icon: 'bullet',
})
```
Output: 
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/EmersonBraun/pretty-log/tags).
## Author
* **emersonbraun** - *Initial work* - [EmersonBraun](https://github.com/EmersonBraun)
See also the list of [contributors](https://github.com/EmersonBraun/pretty-log/contributors) who participated in this project.
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details