Method: Discordrb::API.trace

Defined in:
lib/discordrb/api.rb

.trace(reason) ⇒ Object

Perform rate limit tracing. All this method does is log the current backtrace to the console with the :ratelimit level.

Parameters:

  • reason (String)

    the reason to include with the backtrace.



169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/discordrb/api.rb', line 169

def trace(reason)
  unless @trace
    Discordrb::LOGGER.debug("trace was called with reason #{reason}, but tracing is not enabled")
    return
  end

  Discordrb::LOGGER.ratelimit("Trace (#{reason}):")

  caller.each do |str|
    Discordrb::LOGGER.ratelimit(' ' + str)
  end
end