Skip to content

wesleybliss/client-log

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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' })

About

Minimal web client logging to a server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published