module Fluent::TimeMixin::TimeParameters
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
Fluent::Configurable#configure
# File lib/fluent/time.rb, line 155 def configure(conf) if conf.has_key?('localtime') || conf.has_key?('utc') if conf.has_key?('localtime') conf['localtime'] = Fluent::Config.bool_value(conf['localtime']) elsif conf.has_key?('utc') conf['localtime'] = !(Fluent::Config.bool_value(conf['utc'])) # Specifying "localtime false" means using UTC in TimeFormatter # And specifying "utc" is different from specifying "timezone +0000"(it's not always UTC). # There are difference between "Z" and "+0000" in timezone formatting. # TODO: add kwargs to TimeFormatter to specify "using localtime", "using UTC" or "using specified timezone" in more explicit way end end super if conf.has_key?('localtime') && conf.has_key?('utc') && !(@localtime ^ @utc) raise Fluent::ConfigError, "both of utc and localtime are specified, use only one of them" end if conf.has_key?('time_type') and @time_type == :mixed if @time_format.nil? and @time_format_fallbacks.empty? raise Fluent::ConfigError, "time_type is :mixed but time_format and time_format_fallbacks is empty." end end Fluent::Timezone.validate!(@timezone) if @timezone end