~singpolyma/sgx-jmp

b363f2b5a2798e45de0f7b1b7b937002e9714e3b — Stephen Paul Weber 3 years ago 737a7f5 + 2ece5c3
Merge branch 'statsd-logging'

* statsd-logging:
  Use the logger for all gems
1 files changed, 20 insertions(+), 1 deletions(-)

M sgx_jmp.rb
M sgx_jmp.rb => sgx_jmp.rb +20 -1
@@ 22,9 22,28 @@ LOG.formatter = Ougai::Formatters::Readable.new(
	nil,
	plain: !$stdout.isatty
)
Blather.logger = LOG
EM::Hiredis.logger = LOG
StatsD.logger = LOG
LOG.info "Starting"

Sentry.init
Sentry.init do |config|
	config.logger = LOG
	config.breadcrumbs_logger = [:sentry_logger]
end

module SentryOugai
	class SentryLogger
		include Sentry::Breadcrumb::SentryLogger
		include Singleton
	end

	def _log(severity, message=nil, ex=nil, data=nil, &block)
		super
		SentryLogger.instance.add_breadcrumb(severity, message || ex.to_s, &block)
	end
end
LOG.extend SentryOugai

CONFIG =
	Dhall::Coder