gorilog
Version:
A simple regex-categorized colorful console logger.
56 lines (45 loc) • 1.25 kB
Markdown
[](https://www.npmjs.com/package/gorilog)
[![MIT License][license-image]][license-url]
A simple regex-categorized colorful console logger.
```
yarn add gorilog
```
test.js
```js
const gl = require('gorilog')
const obj = { foo: 'foo', bar: 'bar' }
const arr = [ 0, 1, 2, 3, obj ]
function doAll(logger) {
console.log(logger.category, logger.level)
logger.fatal('fatal msg', arr)
logger.error('error msg', arr)
logger.warn ('warn msg' , arr)
logger.info ('info msg' , arr)
logger.debug('debug msg', arr)
logger.trace('trace msg', arr)
}
doAll(gl())
doAll(gl('test'))
doAll(gl('model/DB'))
doAll(gl('model/Mail'))
doAll(gl('csev1'))
doAll(gl('csev2'))
doAll(gl('csev3'))
```
```
$ yarn test
```

```
$ yarn test2
```

Hideyuki Hirauchi
gorilog is freely distributable under the terms of the [MIT license][license-url].
[]: http://img.shields.io/badge/license-MIT-blue.svg?style=flat
[]: LICENSE