Skip to content

Instantly share code, notes, and snippets.

@softprops
Created October 11, 2010 15:38
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 softprops/620723 to your computer and use it in GitHub Desktop.
Save softprops/620723 to your computer and use it in GitHub Desktop.
/** Generic logging behavior trait */
trait Logged {
import java.util.logging._
private val log = net.lag.logging.Logger.get
def trace(msg: => String) = log ifTrace(msg)
def trace(t:Throwable, msg: => String) = log ifTrace(t, msg)
def info(msg: => String) = log ifInfo(msg)
def info(t:Throwable, msg: => String) = log ifInfo(t, msg)
def warn(msg: => String) = log ifWarning(msg)
def warn(t:Throwable, msg: => String) = log ifWarning(t, msg)
def err(msg: => String) = log ifError(msg)
def err(t:Throwable, msg: => String) = log ifError(t, msg)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment