Skip to content

Instantly share code, notes, and snippets.

@moaikids
Created February 6, 2013 05:41
Show Gist options
  • Save moaikids/4720631 to your computer and use it in GitHub Desktop.
Save moaikids/4720631 to your computer and use it in GitHub Desktop.
//https://github.com/fluent/fluentd/blob/master/lib/fluent/command/fluentd.rb
//line 81-91
op.on('-v', '--verbose', "increase verbose level (-v: debug, -vv: trace)", TrueClass) {|b|
if b
opts[:log_level] = [opts[:log_level] - 1, Fluent::Log::LEVEL_TRACE].max
end
}
op.on('-q', '--quiet', "decrease verbose level (-q: warn, -qq: error)", TrueClass) {|b|
if b
opts[:log_level] = [opts[:log_level] + 1, Fluent::Log::LEVEL_ERROR].min
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment