Kouhei Sutou
null+****@clear*****
Wed Jul 12 14:46:31 JST 2017
Kouhei Sutou 2017-07-12 14:46:31 +0900 (Wed, 12 Jul 2017) New Revision: fcfe7f2dd9e05bdee96b8f141015a6d0ea6913f4 https://github.com/ranguba/chupa-text/commit/fcfe7f2dd9e05bdee96b8f141015a6d0ea6913f4 Message: Use Loggable Modified files: lib/chupa-text/external-command.rb Modified: lib/chupa-text/external-command.rb (+7 -5) =================================================================== --- lib/chupa-text/external-command.rb 2017-07-12 00:15:10 +0900 (82d537e) +++ lib/chupa-text/external-command.rb 2017-07-12 14:46:31 +0900 (6d3f38c) @@ -56,6 +56,8 @@ module ChupaText end class SpawnLimitOptions + include Loggable + attr_reader :options def initialize @options = {} @@ -84,7 +86,7 @@ module ChupaText return nil end limit_info = "soft-limit:#{soft_limit}, hard-limit:#{hard_limit}" - log(:info, "[#{key}][set] <#{value}>(#{limit_info})") + info("#{log_tag}[#{key}][set] <#{value}>(#{limit_info})") @options[:"rlimit_#{key}"] = value end @@ -125,15 +127,15 @@ module ChupaText end def log_hard_limit_over_value(key, value, hard_limit) - log(:warning, "[#{key}][large] <#{value}>(hard-limit:#{hard_limit})") + warn("#{log_tag}[#{key}][large] <#{value}>(hard-limit:#{hard_limit})") end def log_invalid_value(key, value, type) - log(:warning, "[#{key}][invalid] <#{value}>(#{type})") + warn("#{log_tag}[#{key}][invalid] <#{value}>(#{type})") end - def log(level, message) - ChupaText.logger.send(level, "[external-command][limit]#{message}") + def log_tag + "[external-command][limit]" end end end -------------- next part -------------- HTML����������������������������... Download