https://github.com/hypery2k/angular-pouchdb-logger
https://github.com/hypery2k/angular-pouchdb-logger
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/hypery2k/angular-pouchdb-logger
- Owner: hypery2k
- License: mit
- Created: 2015-10-19T15:31:27.000Z (over 9 years ago)
- Default Branch: develop
- Last Pushed: 2023-12-15T05:53:15.000Z (over 1 year ago)
- Last Synced: 2024-04-14T11:10:11.700Z (about 1 year ago)
- Language: JavaScript
- Size: 116 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 48
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Angular PouchDB Logger
[](https://greenkeeper.io/)
[](https://travis-ci.org/hypery2k/angular-pouchdb-logger)
[](https://ci.appveyor.com/project/hypery2k/angular-pouchdb-logger)
[](http://badge.fury.io/bo/angular-pouchdb-logger)
[](http://badge.fury.io/js/angular-pouchdb-logger)
[](https://david-dm.org/hypery2k/angular-pouchdb-logger#info=devDependencies)> A module for enabling logging to web database via pouchdb and $log delegate. The library is Ionic-aware and autoselect the best db for each platform
[](https://nodei.co/npm/angular-pouchdb-logger/)
> Feel free to **donate**
>
>![]()
>
>![]()
>
> Or donate [Bitcoins](bitcoin:3NKtxw1SRYgess5ev4Ri54GekoAgkR213D):
> [](bitcoin:3NKtxw1SRYgess5ev4Ri54GekoAgkR213D)
>
> Also via [greenaddress](https://greenaddress.it/pay/GA3ZPfh7As3Gc2oP6pQ1njxMij88u/)## WIP
- [x] Library core
- [x] Write unit tests
- [x] NPM package
- [ ] Write e2e-tests
- [ ] Write an API doc
- [ ] Provide complete examples## Usage
Install this module:
```bash
npm install angular-pouchdb-logger --save
```or via bower
```bash
bower install angular-pouchdb-logger --save
```Add the dependencies
```javascript
/*global app: true*/
var app = angular.module('resourcesApp', [
...
'ngDbLogger.core'
]);
```If you like to log also debug change the config:
```javascript
app.config(function (ngDbLoggerConfig) {
'use strict';// custom log db name
ngDbLoggerConfig.dbName = 'customLogDB';
// enable db logging (default true)
ngDbLoggerConfig.dbLogging = true;
// enable debug logging to db
ngDbLoggerConfig.debug = true;
// enable trace logging to db
ngDbLoggerConfig.trace = true;
});```
The log entries can be read via the `dbLoggerService`
```javascript
app.controller('myController', function (dbLoggerService) {
'use strict';// reset database
dbLoggerService.clearLogData().then(function () {
...
});
// read log data
dbLoggerService.readLogData('INFO').then(function (logEntries) {
...
});
});
```### About
This module instruments Angular's `delegate` to redirect log entries.