Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/llafuente/noboxout-log
Loggin into console with colors, filename/line and timestamp.
https://github.com/llafuente/noboxout-log
Last synced: 1 day ago
JSON representation
Loggin into console with colors, filename/line and timestamp.
- Host: GitHub
- URL: https://github.com/llafuente/noboxout-log
- Owner: llafuente
- Created: 2014-02-05T10:42:12.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-03-21T13:55:01.000Z (almost 11 years ago)
- Last Synced: 2024-11-07T06:43:09.689Z (about 2 months ago)
- Language: JavaScript
- Size: 172 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
README
# noboxout-log [![Build Status](https://secure.travis-ci.org/llafuente/noboxout-log.png?branch=master)](http://travis-ci.org/llafuente/noboxout-log)
![NPM](https://nodei.co/npm/noboxout-log.png?compact=true)
## Introduction
Basic log with: timestamps, colors and traces to stdout/stderr.
Perfect for small aplications.
Modify console.log/info adding trace parameter.## Example
```
2014-02-07 23:10:05[vrb]test.js:5 verbose
2014-02-07 23:10:05[dbg]test.js:6 debug
2014-02-07 23:10:05[log]test.js:7 log
2014-02-07 23:10:05[inf]test.js:8 info
2014-02-07 23:10:05[wrn]test.js:9 warning
2014-02-07 23:10:05[err]test.js:10 error
```### Log levels
To edit level use: log.logLevel = <integer>
* verbose - stdout (6)
* debug - stdout (5)
* log - stdout (4)
* info - stdout (3)
* warning - stderr (2)
* error - stderr (1)### Mute log
```js
log.logMute = true;
```### Traces
How many stack item should be displayed ?
```js
log.logTraces = Number
```### Add to literal
Use it to add some text after header. like:
```js
// before
// 2014-02-07 23:10:05[vrb]test.js:5 verboselog.logLiteral = "[xxx]";
// after
// 2014-02-07 23:10:05[vrb]test.js:5[xxx] verbose
```## Install
With [npm](http://npmjs.org) do:
```
npm install noboxout-log```
## test (travis-ci ready!)
```
npm test
// or
node test.js
```## license
MIT.