A Scala.js facade for the JSNLog library
Besides the facade to JSNLog, this library also includes:
- Enrichments to the JSNLog library to easily log exceptions with the Scala stacktraces to either the browser console, the server, or both.
- An execution context that will catch unhandled errors running in Futures and log them.
In the demo folder is a Play project that uses jsnlog-facade. Look for the following details:
- Configuration at the top of
- Examples of logging information to the browser's console and server in that same file.
- Examples of exceptions being caught and logged using the window's
try/catchstatement, and by a custom execution context (imported at the top of the file).
- The controller that receives the logged messages is in
server/app/controllers/LogCtrl.scala. The logger used here requires configuration from
Installing the library
To use jsnlog-facade, add this line to your libraryDependencies:
"ca.bwbecker" %%% "jsnlog-facade" % "0.1.0"