1.0.0 • Published 11 years ago
storelogs v1.0.0
Store Logs
=========
Storing logs from frontend in Uhray Boilerplate.
Installation
Backend
npm install --save storelogsFrontend
bower install --save storelogsThen setup RequireJS to have crud and to point storelogs at dist/storelogs.js.
Usage
Backend
var crud = require('node-crud'),
mongoose = require('mongoose');
// pass in the crud and mongoose objects from your app
require('storelogs')(crud, mongoose);Now it's setup.
Frontend
define(['storelogs'], function(storelogs) {
storelogs.debug('my message', { here: 'is', some: 'data' });
storelogs.log('my message', { here: 'is', some: 'data' });
storelogs.warn('my message', { here: 'is', some: 'data' });
storelogs.error('my message', { here: 'is', some: 'data' });
}); The default URL it pings for storing logs is /api/storelogs, but if you need to change that you can call storelogs._setPath('my/new/path').
1.0.0
11 years ago