Skip to content

Commit

Permalink
stop to use implicit default type :string (for process_name), and enu…
Browse files Browse the repository at this point in the history
…m to show valid log levels
  • Loading branch information
tagomoris committed Jan 30, 2017
1 parent 91b7665 commit 19c60be
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions lib/fluent/system_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,17 @@ class SystemConfig
:file_permission, :dir_permission,
]

config_param :workers, :integer, default: 1
config_param :root_dir, :string, default: nil
config_param :log_level, default: nil do |level|
Log.str_to_level(level)
end
config_param :workers, :integer, default: 1
config_param :root_dir, :string, default: nil
config_param :log_level, :enum, list: [:trace, :debug, :info, :warn, :error, :fatal], default: nil
config_param :suppress_repeated_stacktrace, :bool, default: nil
config_param :emit_error_log_interval, :time, default: nil
config_param :emit_error_log_interval, :time, default: nil
config_param :suppress_config_dump, :bool, default: nil
config_param :log_event_verbose, :bool, default: nil
config_param :without_source, :bool, default: nil
config_param :rpc_endpoint, :string, default: nil
config_param :log_event_verbose, :bool, default: nil
config_param :without_source, :bool, default: nil
config_param :rpc_endpoint, :string, default: nil
config_param :enable_get_dump, :bool, default: nil
config_param :process_name, default: nil
config_param :process_name, :string, default: nil
config_param :file_permission, default: nil do |v|
v.to_i(8)
end
Expand Down Expand Up @@ -77,6 +75,12 @@ def initialize(conf=nil)
configure(conf)
end

def configure(conf)
super

@log_level = Log.str_to_level(@log_level.to_s) if @log_level
end

def dup
s = SystemConfig.new
SYSTEM_CONFIG_PARAMETERS.each do |param|
Expand Down

0 comments on commit 19c60be

Please sign in to comment.