[Groonga-commit] groonga/groonga-log at 22387aa [master] Use Integer with base

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 8 11:49:18 JST 2018


Kouhei Sutou	2018-03-08 11:49:18 +0900 (Thu, 08 Mar 2018)

  New Revision: 22387aa8566784148c45b5a03a91af068971f5f2
  https://github.com/groonga/groonga-log/commit/22387aa8566784148c45b5a03a91af068971f5f2

  Message:
    Use Integer with base

  Modified files:
    lib/groonga-log/parser.rb

  Modified: lib/groonga-log/parser.rb (+8 -8)
===================================================================
--- lib/groonga-log/parser.rb    2018-02-04 21:43:31 +0900 (78e1ee1)
+++ lib/groonga-log/parser.rb    2018-03-08 11:49:18 +0900 (3018275)
@@ -72,17 +72,17 @@ module GroongaLog
 
         entry = Entry.new
 
-        year = m["year"].to_i
-        month = m["month"].to_i
-        day = m["day"].to_i
-        hour = m["hour"].to_i
-        minute = m["minute"].to_i
-        second = m["second"].to_i
-        micro_second = m["micro_second"].to_i
+        year = Integer(m["year"], 10)
+        month = Integer(m["month"], 10)
+        day = Integer(m["day"], 10)
+        hour = Integer(m["hour"], 10)
+        minute = Integer(m["minute"], 10)
+        second = Integer(m["second"], 10)
+        micro_second = Integer(m["micro_second"], 10)
         entry.timestamp = Time.local(year, month, day,
                                      hour, minute, second, micro_second)
         entry.log_level = log_level_to_symbol(m["log_level"])
-        entry.pid = m["pid"].to_i if m["pid"]
+        entry.pid = Integer(m["pid"], 10) if m["pid"]
         entry.message = m["message"]
         yield entry
       end
-------------- next part --------------
HTML����������������������������...
URL: https://lists.osdn.me/mailman/archives/groonga-commit/attachments/20180308/a02f7fa4/attachment.htm 



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