Module: Asmodai

Defined in:
lib/asmodai.rb,
lib/asmodai/version.rb

Defined Under Namespace

Modules: Logging Classes: CLI, Daemon, Info

Constant Summary collapse

VERSION =
"0.1.19"

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.rootObject

Returns the value of attribute root.



6
7
8
# File 'lib/asmodai.rb', line 6

def root
  @root
end

Class Method Details

.log_fileObject



13
14
15
16
17
18
# File 'lib/asmodai.rb', line 13

def log_file
  @log_file ||= 
    log_file_path.open("a").tap do |r|
      r.sync = true
    end
end

.log_file_pathObject



8
9
10
11
# File 'lib/asmodai.rb', line 8

def log_file_path
  @log_file_path ||=
    Asmodai.root.join("log/#{Asmodai::Info.current.daemon_name}.log")
end

.loggerObject



20
21
22
23
24
# File 'lib/asmodai.rb', line 20

def logger
  @logger ||= Logger.new($stdout).tap do |logger|
    logger.formatter = Logger::Formatter.new
  end
end