Class: Aio::Ui::Logger
- Inherits:
-
Object
- Object
- Aio::Ui::Logger
- Includes:
- Singleton
- Defined in:
- lib/aio/ui/logger.rb
Overview
单例日志保存类
Instance Method Summary collapse
- #clear_log ⇒ Object
- #debug ⇒ Object
- #debug=(msg) ⇒ Object
- #info ⇒ Object
- #info=(msg) ⇒ Object
-
#initialize ⇒ Logger
constructor
A new instance of Logger.
Constructor Details
#initialize ⇒ Logger
Returns a new instance of Logger.
10 11 12 |
# File 'lib/aio/ui/logger.rb', line 10 def initialize clear_log end |
Instance Method Details
#clear_log ⇒ Object
30 31 32 33 34 |
# File 'lib/aio/ui/logger.rb', line 30 def clear_log @log = {} @log[:info] = [] @log[:debug] = [] end |
#debug ⇒ Object
26 27 28 |
# File 'lib/aio/ui/logger.rb', line 26 def debug @log[:info] end |
#debug=(msg) ⇒ Object
18 19 20 |
# File 'lib/aio/ui/logger.rb', line 18 def debug=(msg) @log[:debug] << msg end |
#info ⇒ Object
22 23 24 |
# File 'lib/aio/ui/logger.rb', line 22 def info @log[:info] end |
#info=(msg) ⇒ Object
14 15 16 |
# File 'lib/aio/ui/logger.rb', line 14 def info=(msg) @log[:info] << msg end |