Skip to content

Instantly share code, notes, and snippets.

@stephenjudkins
Created February 10, 2012 00:00
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 stephenjudkins/1784518 to your computer and use it in GitHub Desktop.
Save stephenjudkins/1784518 to your computer and use it in GitHub Desktop.
import bytecask.Bytecask
import org.slf4j.{LoggerFactory, Logger}
import akka.dispatch.Future
import annotation.tailrec
import org.slf4j.helpers.{NOPLoggerFactory, SubstituteLoggerFactory}
private def tellLoggerToStfu() {
@tailrec def impl(i: Int, wait: Long) {
Thread.sleep(wait - 1)
LoggerFactory.getILoggerFactory() match {
case _ : SubstituteLoggerFactory => impl(i - 1, wait * 2)
case _ : NOPLoggerFactory => impl(i - 1, wait * 2)
case _ =>
}
}
impl(10, 1)
org.slf4j.LoggerFactory.getLogger("bytecask.Index") match {
case l : ch.qos.logback.classic.Logger => l.setLevel(ch.qos.logback.classic.Level.OFF)
case _ =>
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment