UNPKG

2.18 kBMarkdownView Raw
1apeman-commons-logging
2===========
3
4
5[![Build Status][my_travis_badge_url]][my_travis_url]
6[![Code Climate][my_codeclimate_badge_url]][my_codeclimate_url]
7[![Code Coverage][my_codeclimate_coverage_badge_url]][my_codeclimate_url]
8[![npm version][my_npm_budge_url]][my_npm_url]
9
10apeman common module for logging.
11
12
13Installation
14------------
15
16Install module via [npm][npm_url].
17
18```bash
19# Install as local module.
20$ npm install apeman-commons-logging --save
21```
22
23Usage
24-----
25
26### Console Logger
27
28Create an instance and emit ansi-colored log to stdout/stderr.
29
30```javascript
31/**
32 * This is an example to use console logger.
33 * @see https://www.npmjs.com/package/colorprint
34 */
35
36"use strict";
37
38
39var ConsoleLogger = require('apeman-logging/lib/console_logger');
40
41var logger = new ConsoleLogger({
42 indent: 3 // Indent size for each line.
43});
44
45logger.notice('This is NOTICE message.');
46logger.info('This is INFO message.');
47logger.debug('This is DEBUG message.');
48logger.trace('This is TRACE message.');
49logger.error('This is ERROR message.');
50logger.fatal('This is FATAL message.');
51```
52
53License
54-------
55
56This software is released under the [MIT License][my_license_url].
57
58
59Links
60-----
61
62+ [apeman][apeman_url]
63+ [colorprint](https://www.npmjs.com/package/colorprint)
64
65[npm_url]: https://www.npmjs.com/
66[apeman_url]: https://github.com/apeman-repo/apeman
67[my_repo_url]: https://github.com/apeman-repo/apeman-commons-logging
68[my_travis_url]: http://travis-ci.org/apeman-repo/apeman-commons-logging
69[my_travis_badge_url]: http://img.shields.io/travis/apeman-repo/apeman-commons-logging.svg?style=flat
70[my_license_url]: https://github.com/apeman-repo/apeman-commons-logging/blob/master/LICENSE
71[my_codeclimate_url]: http://codeclimate.com/github/apeman-repo/apeman-commons-logging
72[my_codeclimate_badge_url]: http://img.shields.io/codeclimate/github/apeman-repo/apeman-commons-logging.svg?style=flat
73[my_codeclimate_coverage_badge_url]: http://img.shields.io/codeclimate/coverage/github/apeman-repo/apeman-commons-logging.svg?style=flat
74[my_npm_url]: http://www.npmjs.org/package/apeman-commons-logging
75[my_npm_budge_url]: http://img.shields.io/npm/v/apeman-commons-logging.svg?style=flat
\No newline at end of file