https://github.com/rootslab/gerry
Gerry, a tiny module for event logging.
https://github.com/rootslab/gerry
eventlog events logger nodejs
Last synced: 18 days ago
JSON representation
Gerry, a tiny module for event logging.
- Host: GitHub
- URL: https://github.com/rootslab/gerry
- Owner: rootslab
- License: mit
- Created: 2014-08-06T01:24:13.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2018-02-10T14:40:45.000Z (over 8 years ago)
- Last Synced: 2025-09-16T11:53:19.753Z (9 months ago)
- Topics: eventlog, events, logger, nodejs
- Language: JavaScript
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
### Gerry
[](https://www.npmjs.org/package/gerry)
[](https://www.codacy.com/public/44gatti/gerry)
[](https://codeclimate.com/github/rootslab/gerry)
[](https://github.com/rootslab/gerry#mit-license)

[](http://travis-ci.org/rootslab/gerry)
[](https://david-dm.org/rootslab/gerry)
[](https://david-dm.org/rootslab/gerry#info=devDependencies)
[](http://npm-stat.com/charts.html?package=gerry)

[](https://nodei.co/npm/gerry/)
> **_Gerry_**, a tiny module for collecting and logging events.
### Install
```bash
$ npm install gerry [-g]
```
> __require__:
```javascript
var Gerry = require( 'gerry' );
```
### Run Tests
```bash
$ cd gerry/
$ npm test
```
### Constructor
> Arguments within [ ] are optional.
```javascript
Gerry( EventEmitter emt [, Array evt_names [, Function logger ] ] )
// or
new Gerry( EventEmitter emt [, Array evt_names [, Function logger ] ] )
```
### Properties
```javascript
/*
* Current emitter to listen.
*/
Gerry.emt : EventEmitter
/*
* List of event names to log/save.
*/
Gerry.events : Array
/*
* Array of event listeners.
*/
Gerry.listeners : Array
/*
* The logger function, for default it outputs to console.
*/
Gerry.lfn : Function
/*
* An obj/hash containing The list of collected event names and arguments.
* { events : [ .. ], args : [ .. ] }
*/
Gerry.collected : Object
```
### Methods
> Arguments within [ ] are optional.
```javascript
/*
* Enable event logging by adding all events listeners.
*/
Gerry#enable = function ( [ Boolean collect_events [, Function logger ] ] ) : Gerry
/*
* Disable event logging by removing all events listeners.
*/
Gerry#disable = function ( [ Function logger ] ) : Gerry
/*
* Update/push event names, a name is added if not already exists in the list.
*/
Gerry#push = function ( [ Boolean collect_events [, Array evt_names ] ] ) : Number
/*
* Return the current list length.
*/
Gerry#size = function () : Number
/*
* Flush event names and listeners.
*/
Gerry#flush = function () : Gerry
```
### MIT License
> Copyright (c) 2014-present < Guglielmo Ferri : 44gatti@gmail.com >
> Permission is hereby granted, free of charge, to any person obtaining
> a copy of this software and associated documentation files (the
> 'Software'), to deal in the Software without restriction, including
> without limitation the rights to use, copy, modify, merge, publish,
> distribute, sublicense, and/or sell copies of the Software, and to
> permit persons to whom the Software is furnished to do so, subject to
> the following conditions:
> __The above copyright notice and this permission notice shall be
> included in all copies or substantial portions of the Software.__
> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
> EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
> CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
> TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.