logger

13 views
Skip to first unread message

Lena Herrmann

unread,
Nov 10, 2009, 7:24:08 AM11/10/09
to sam...@googlegroups.com
Hi!

Is there an example somewhere how to use Sammy.log?

Is it possible to have the Sammy logger do what console.log does,
without having the whole app crash when Firebug is not turned on?

Cheers!
Lena

Aaron Quint

unread,
Nov 10, 2009, 10:09:17 AM11/10/09
to sam...@googlegroups.com
Hey Lena

The default logger that gets called when using Sammy.log() (or
this.log() within a route) checks for the existence of the console
(firebug in firefox, webinspector in safari) so its 'safe'. You can
also add any number of loggers using Sammy.addLogger() this means
potentially, you could log to a persistent data store on the
server-side, e.g.:

http://gist.github.com/230937
(posted in a gist for readability)

Hope that helps,
--AQ


Aaron Quint
http://www.quirkey.com
Reply all
Reply to author
Forward
0 new messages