[Groonga-commit] groonga/fluent-plugin-groonga-log at 18a19e1 [master] Add a missing time elements in yield

Back to archive index

Hiroshi Hatake null+****@clear*****
Fri Sep 15 17:01:23 JST 2017


Hiroshi Hatake	2017-09-15 17:01:23 +0900 (Fri, 15 Sep 2017)

  New Revision: 18a19e177bc13e30c268ffa9eaae454e82a2748e
  https://github.com/groonga/fluent-plugin-groonga-log/commit/18a19e177bc13e30c268ffa9eaae454e82a2748e

  Merged 084168f: Merge pull request #1 from cosmo0920/tweak-name-and-returns

  Message:
    Add a missing time elements in yield

  Modified files:
    lib/fluent/plugin/parser_groonga_log.rb
    test/plugin/test_parser_groonga_log.rb

  Modified: lib/fluent/plugin/parser_groonga_log.rb (+2 -1)
===================================================================
--- lib/fluent/plugin/parser_groonga_log.rb    2017-09-15 16:48:59 +0900 (61838bc)
+++ lib/fluent/plugin/parser_groonga_log.rb    2017-09-15 17:01:23 +0900 (ed2b9ed)
@@ -52,6 +52,7 @@ module Fluent
         log_level = m['log_level']
         context_id = m['context_id']
         message = m['message']
+        time = Fluent::Engine.now
 
         record = {
           "year" => year,
@@ -66,7 +67,7 @@ module Fluent
           "message" => message,
         }
 
-        yield record
+        yield time, record
       end
     end
   end

  Modified: test/plugin/test_parser_groonga_log.rb (+2 -1)
===================================================================
--- test/plugin/test_parser_groonga_log.rb    2017-09-15 16:48:59 +0900 (f754aea)
+++ test/plugin/test_parser_groonga_log.rb    2017-09-15 17:01:23 +0900 (b612924)
@@ -21,7 +21,8 @@ class GroongaLogParserTest < Test::Unit::TestCase
   end
 
   def test_parse
-    @parser.instance.parse('2017-07-19 14:41:05.663978|n|18c61700|spec:2:update:Object:32(type):8') { |record|
+    @parser.instance.parse('2017-07-19 14:41:05.663978|n|18c61700|spec:2:update:Object:32(type):8') { |time, record|
+      assert_true(time.is_a?(Fluent::EventTime))
       assert_equal(@expected, record)
     }
   end
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20170915/a75a2f84/attachment-0001.htm 



More information about the Groonga-commit mailing list
Back to archive index