client-log

1.0.0 • Public • Published

Client Log

Installation

None needed. Just clone & reference the main src/index.js file.

Testing

$ npm i
$ npm test

Usage

See example.

<!-- myfile.html -->
<script src="path/to/client-log/index.js"></script>
// myfile.js
if (!window.clientLog)
    throw new Error('Failed to init clientLog')

// or if using via Node,
const clientLog = require('client-log')

var log = clientLog({
    endpoints: {
        logs: 'http://localhost:8080/logs',
        errors: 'http://localhost:8080/errors'
    }
})

// window.error will now automatically be captured,
// but to trigger an event manually
log.sendLog('message', 'file.html', 1, 2, { foo: 'bar' })

/client-log/

    Package Sidebar

    Install

    npm i client-log

    Weekly Downloads

    2

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • wesleybliss