Permalink
Browse files

consolidate methods

  • Loading branch information...
1 parent f6800f4 commit d22076af92e4b9e6c7dd642a04c281d1e05cf1f8 Kyle Maxwell committed Mar 4, 2011
Showing with 2 additions and 8 deletions.
  1. +2 −8 src/main/scala/com/twitter/logging/ScribeHandler.scala
View
10 src/main/scala/com/twitter/logging/ScribeHandler.scala
@@ -147,15 +147,9 @@ class ScribeHandler(hostname: String, port: Int, category: String, bufferTime: D
socket = None
}
- def publish(record: javalog.LogRecord): Unit = synchronized {
+ def publish(record: javalog.LogRecord): Unit = {
if (record.getLoggerName == "scribe") return
- queue += getFormatter.format(record).getBytes("UTF-8")
- while (queue.size > maxMessagesToBuffer) {
- queue.trimStart(1)
- }
- if (Time.now - lastTransmission >= bufferTime) {
- flush()
- }
+ publish(getFormatter.format(record).getBytes("UTF-8"))
}
def publish(record: Array[Byte]): Unit = synchronized {

0 comments on commit d22076a

Please sign in to comment.