1 | apeman-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 |
|
10 | apeman common module for logging.
|
11 |
|
12 |
|
13 | Installation
|
14 | ------------
|
15 |
|
16 | Install module via [npm][npm_url].
|
17 |
|
18 | ```bash
|
19 | # Install as local module.
|
20 | $ npm install apeman-commons-logging --save
|
21 | ```
|
22 |
|
23 | Usage
|
24 | -----
|
25 |
|
26 | ### Console Logger
|
27 |
|
28 | Create 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 |
|
39 | var ConsoleLogger = require('apeman-logging/lib/console_logger');
|
40 |
|
41 | var logger = new ConsoleLogger({
|
42 | indent: 3 // Indent size for each line.
|
43 | });
|
44 |
|
45 | logger.notice('This is NOTICE message.');
|
46 | logger.info('This is INFO message.');
|
47 | logger.debug('This is DEBUG message.');
|
48 | logger.trace('This is TRACE message.');
|
49 | logger.error('This is ERROR message.');
|
50 | logger.fatal('This is FATAL message.');
|
51 | ```
|
52 |
|
53 | License
|
54 | -------
|
55 |
|
56 | This software is released under the [MIT License][my_license_url].
|
57 |
|
58 |
|
59 | Links
|
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 |