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