Skip to content

Instantly share code, notes, and snippets.

@mattandrews
Created November 29, 2010 15:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattandrews/720075 to your computer and use it in GitHub Desktop.
Save mattandrews/720075 to your computer and use it in GitHub Desktop.
import org.slf4j.LoggerFactory
import scala.util.control.Exception._
trait Logging {
protected def log = LoggerFactory.getLogger(getClass)
protected def ignoreAndLogExceptions = catching(classOf[Exception]) withApply (e => log.warn("ignoring exception", e))
protected def onErrorResumeNext = ignoreAndLogExceptions
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment