Class: Aio::Ui::Logger

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/aio/ui/logger.rb

Overview

单例日志保存类

Instance Method Summary collapse

Constructor Details

#initializeLogger

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_logObject



30
31
32
33
34
# File 'lib/aio/ui/logger.rb', line 30

def clear_log
  @log = {}
  @log[:info] = []
  @log[:debug] = []
end

#debugObject



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

#infoObject



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