~singpolyma/sgx-jmp

2ece5c31c9462e2e422fc094fc4d870618a80c2d — Stephen Paul Weber 3 years ago d799a92
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