Module: Puggernaut::Logger

Included in:
Client, Server, Server::Channel, Server::Http, Server::Tcp, Server::Websocket
Defined in:
lib/puggernaut/logger.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.loggerObject



13
14
15
16
17
18
19
20
21
22
# File 'lib/puggernaut/logger.rb', line 13

def logger
  unless @logger
    base = Dir.pwd
    FileUtils.mkdir_p("#{base}/log")
    file = File.open("#{base}/log/puggernaut.log", 'a')
    file.sync = true
    @logger = ::Logger.new(file)
  end
  @logger
end

Instance Method Details

#loggerObject



7
8
9
# File 'lib/puggernaut/logger.rb', line 7

def logger
  Puggernaut::Logger.logger
end