Class: Discordrb::Logger
- Inherits:
-
Object
- Object
- Discordrb::Logger
- Defined in:
- lib/discordrb/logger.rb
Overview
Logs debug messages
Instance Attribute Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#debug(message, important = false) ⇒ Object
6 7 8 |
# File 'lib/discordrb/logger.rb', line 6 def debug(, important = false) puts "[DEBUG : #{Thread.current[:discordrb_name]} @ #{Time.now}] #{message}" if @debug || important end |
Instance Method Details
#log_exception(e) ⇒ Object
10 11 12 13 |
# File 'lib/discordrb/logger.rb', line 10 def log_exception(e) debug("Exception: #{e.inspect}", true) e.backtrace.each { |line| debug(line, true) } end |