Class: MiniBot::Logger
- Inherits:
-
Object
- Object
- MiniBot::Logger
- Defined in:
- lib/minibot/logger.rb
Class Attribute Summary collapse
-
.levels ⇒ Object
readonly
Returns the value of attribute levels.
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
Class Method Summary collapse
Instance Method Summary collapse
Class Attribute Details
.levels ⇒ Object (readonly)
Returns the value of attribute levels.
10 11 12 |
# File 'lib/minibot/logger.rb', line 10 def levels @levels end |
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
13 14 15 |
# File 'lib/minibot/logger.rb', line 13 def level @level end |
Class Method Details
.with_level(level, &block) ⇒ Object
6 7 8 |
# File 'lib/minibot/logger.rb', line 6 def with_level(level, &block) @levels[level] = block end |
Instance Method Details
#write(str) ⇒ Object
15 16 17 18 19 |
# File 'lib/minibot/logger.rb', line 15 def write(str) time = Time.now.strftime("%Y/%m/%d %H:%M:%S") @target.printf "<%s> [%s] %s\n",time, level, str @target.flush end |