-
Notifications
You must be signed in to change notification settings - Fork 145
/
debug.rb
28 lines (25 loc) · 986 Bytes
/
debug.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require 'honeybadger/backend/null'
module Honeybadger
module Backend
# Logs the notice payload rather than sending it. The purpose of this
# backend is primarily for programmatically inspecting JSON payloads in
# integration tests.
class Debug < Null
def notify(feature, payload)
logger.unknown("notifying debug backend of feature=#{feature}\n\t#{payload.to_json}")
return Response.new(ENV['DEBUG_BACKEND_STATUS'].to_i, nil) if ENV['DEBUG_BACKEND_STATUS']
super
end
def check_in(id)
logger.unknown("checking in debug backend with id=#{id}")
return Response.new(ENV['DEBUG_BACKEND_STATUS'].to_i, nil) if ENV['DEBUG_BACKEND_STATUS']
super
end
def event(payload)
logger.unknown("sending event to debug backend with event=#{payload.to_json}")
return Response.new(ENV['DEBUG_BACKEND_STATUS'].to_i, nil) if ENV['DEBUG_BACKEND_STATUS']
super
end
end
end
end