Tattletale
A utility to send console logs over XHR for server-side processing.
Last updated 4 years ago by jenshult .
Apache 2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install Tattletale 
SYNC missed versions from official npm registry.

Tattletale.JS

Tattletale wraps around the browser’s console object, storing your logs in order to send them over XHR for long-term storage and analysis using a service like Scribe.

Usage

var tattletale = new Tattletale('/log');

tattletale.log('“My name is Ozymandias, king of kings:');
tattletale.log('Look on my works, ye Mighty, and despair!”');

tattletale.send();

When the send() method is called, an array of all log calls made since the last send() call will be submitted to the server as an array of request parameters name console_logs:

# Form Data
console_logs[0]:“My name is Ozymandias, king of kings:
console_logs[1]:Look on my works, ye Mighty, and despair!”

The empty() method will be automatically triggered to prevent duplicate entries from appearing in your logs.

Options

In addition to a server-side endpoint, the constructor also accepts an object of static parameters to be sent along with your request. For example, if your POST requests need to include a token to prevent against XSRF:

var tattletale = new Tattletale('/log', {
    token: window.xsrft
});

Current Tags

  • 0.1.0                                ...           latest (4 years ago)

1 Versions

  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (8)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |