Permalink
Browse files

Provide a default implementation of the new logging call back for bac…

…kwards compat.
  • Loading branch information...
1 parent fd69099 commit 07dfabbe1ba76a5a99f2fe67d31c9dcaecd84aaa @holdenk holdenk committed Jul 19, 2012
Showing with 6 additions and 3 deletions.
  1. +1 −1 build.sbt
  2. +5 −2 src/main/scala/com/foursquare/slashem/Schema.scala
View
@@ -1,6 +1,6 @@
name := "slashem"
-version := "0.14.0"
+version := "0.14.1"
organization := "com.foursquare"
@@ -424,10 +424,14 @@ trait SolrMeta[T <: Record[T]] extends SlashemMeta[T] {
/** Logging and Timing solr trait */
trait SolrQueryLogger {
/**
+ * provide a null call back for people that don't want to implement
+ * onStartExecuteQuery */
+ val noopCallback: Function0[Unit] = () => ()
+ /**
* to instrument start and stop of query return a function that will be called
* when the query finishes
*/
- def onStartExecuteQuery(name: String, msg: String): Function0[Unit]
+ def onStartExecuteQuery(name: String, msg: String): Function0[Unit] = noopCallback
def log(name: String, msg: String, time: Long): Unit
@@ -451,7 +455,6 @@ trait SolrQueryLogger {
/** The default logger, does nothing. */
object NoopQueryLogger extends SolrQueryLogger {
- val noopCallback: Function0[Unit] = () => ()
override def onStartExecuteQuery(name: String, msg: String): Function0[Unit] = noopCallback
override def log(name: String, msg: String, time: Long): Unit = Unit
override def debug(msg: String): Unit = println(msg)

0 comments on commit 07dfabb

Please sign in to comment.