Skip to content

Commit

Permalink
Closes #383 - Adding the --quiet option to silence the logs
Browse files Browse the repository at this point in the history
  • Loading branch information
simianhacker committed Sep 24, 2014
1 parent 477dd1e commit 2b82a78
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/kibana/components/filter_bar/filter_bar.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<span>"{{ filter.value }}"</span>
</div>
<div class="filter-actions">
<a class="filter-toggle" ng-click="toggleFilter(filter)">toggle</a>
<a class="filter-toggle" ng-click="toggleFilter(filter)"><span ng-show="filter.disabled">enable</span><span ng-hide="filter.disabled">disable</span></a>
<a class="filter-remove" ng-click="removeFilter(filter)">remove</a>
</div>
</div>
Expand Down
4 changes: 4 additions & 0 deletions src/server/bin/initialize
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ parser = OptionParser.new do |opts|
opts.on('-p', '--port PORT', 'Kibana port') do |arg|
options[:port] = arg
end
opts.on('-q', '--quiet', 'Turns off logging') do |arg|
options[:quiet] = arg
end
opts.on('-H', '--host HOST', 'Kibana host') do |arg|
options[:host] = arg
end
Expand Down Expand Up @@ -68,6 +71,7 @@ Kibana.global_settings[:host] = host || '0.0.0.0'
Kibana.global_settings[:config] = config
Kibana.global_settings[:elasticsearch] = elasticsearch
Kibana.global_settings[:root] = File.expand_path("#{File.dirname(__FILE__)}/../")
Kibana.global_settings[:quiet] = options[:quiet]

# Set the public folder based on whether we are running in production or not.
if ENV['RACK_ENV'] == ('production')
Expand Down
4 changes: 2 additions & 2 deletions src/server/lib/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class App < Sinatra::Base
end

configure :production do
use JSONLogger, settings.logger
use JSONLogger, settings.logger unless Kibana.global_settings[:quiet]
end

configure :quiet do
set :logger, false
end

configure :development do
use ColorLogger, settings.logger
use ColorLogger, settings.logger unless Kibana.global_settings[:quiet]
end

error do
Expand Down
1 change: 1 addition & 0 deletions src/server/lib/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ module Server
}

def self.log(msg)
return if Kibana.global_settings[:quiet]
if ENV['RACK_ENV'] == 'production'
data = {
"@timestamp" => Time.now.iso8601,
Expand Down

0 comments on commit 2b82a78

Please sign in to comment.