Class: SlackBot::DevConsole
- Inherits:
-
Object
- Object
- SlackBot::DevConsole
- Defined in:
- lib/slack_bot/dev_console.rb
Class Method Summary collapse
- .enabled=(value) ⇒ Object
- .enabled? ⇒ Boolean
- .log(message = nil, &block) ⇒ Object
- .log_check(message = nil, &block) ⇒ Object
- .log_input(message = nil, &block) ⇒ Object
- .log_output(message = nil, &block) ⇒ Object
- .logger ⇒ Object
- .logger=(value) ⇒ Object
Class Method Details
.enabled=(value) ⇒ Object
3 4 5 |
# File 'lib/slack_bot/dev_console.rb', line 3 def self.enabled=(value) @enabled = value end |
.enabled? ⇒ Boolean
7 8 9 |
# File 'lib/slack_bot/dev_console.rb', line 7 def self.enabled? @enabled end |
.log(message = nil, &block) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/slack_bot/dev_console.rb', line 19 def self.log( = nil, &block) return unless enabled? = yield if block logger.info() end |
.log_check(message = nil, &block) ⇒ Object
36 37 38 39 |
# File 'lib/slack_bot/dev_console.rb', line 36 def self.log_check( = nil, &block) = yield if block log("!!! #{}") end |
.log_input(message = nil, &block) ⇒ Object
26 27 28 29 |
# File 'lib/slack_bot/dev_console.rb', line 26 def self.log_input( = nil, &block) = yield if block log(">>> #{}") end |
.log_output(message = nil, &block) ⇒ Object
31 32 33 34 |
# File 'lib/slack_bot/dev_console.rb', line 31 def self.log_output( = nil, &block) = yield if block log("<<< #{}") end |
.logger ⇒ Object
15 16 17 |
# File 'lib/slack_bot/dev_console.rb', line 15 def self.logger @logger ||= Logger.new end |
.logger=(value) ⇒ Object
11 12 13 |
# File 'lib/slack_bot/dev_console.rb', line 11 def self.logger=(value) @logger = value end |