mixu / minilog

Lightweight client & server-side logging with Stream-API backends
http://mixu.net/minilog/
Other
380 stars 51 forks source link

minilog doesn't seem to work in the browser #6

Closed jmjpro closed 11 years ago

jmjpro commented 11 years ago

Upon loading the test/example page jquery_example.html in Chrome (either as a local page or served from a local web server) I see in the console:

Uncaught TypeError: undefined is not a function jquery_example.html:6

When I click the "Add log message", I see in the Chrome console:

Uncaught TypeError: Object #<HTMLInputElement> has no method 'info' jquery_example.html:25

If I comment out the line var jq = new Minilog.backends.jquery({ url: 'http://localhost:8080/log', interval: 1000, format: 'json' }); and the line

`` //.pipe(jq) I get a different error Uncaught TypeError: Object #<Object> has no method 'emit' minilog.js:15

Perhaps the instructions are missing steps?

mixu commented 11 years ago

Hi, sorry, the issue here is that master is Minilog v2, but that example code was written for the old version (e.g for npm install minilog@0.x). I'm still working on updating all the documentation for v2, which adds a bunch of things: mostly, better browser console output and more idiomatic use of Node 0.10.x style streams.

The commit above updates the example for Minilog v2.