 
       identifier = KodingLogger.getIdentifier scope, group
 
-      KodingLogger.connect()
-
-      KodingLogger.pt.on 'connect', ->
+      KodingLogger[scope] group, log
+
+      setTimeout ->
 
         KodingLogger.search { query }, (err, result) ->
 

          expect(result.logs[0].message).to.be.equal "#{identifier} #{logs[0]}"
          expect(result.logs[1].message).to.be.equal "#{identifier} #{logs[1]}"

          KodingLogger.close()

          done()

      for log in logs
        KodingLogger[scope] group, log


runTests()


      identifier = KodingLogger.getIdentifier scope, group

      for log in logs
        KodingLogger[scope] group, log

      setTimeout ->

        KodingLogger.search { query }, (err, result) ->

