Module: Unity::Modules::Logable

Defined in:
lib/unity/modules/logable.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#log_fileObject (readonly)

Returns the value of attribute log_file.



8
9
10
# File 'lib/unity/modules/logable.rb', line 8

def log_file
  @log_file
end

#loggerObject (readonly)

Returns the value of attribute logger.



8
9
10
# File 'lib/unity/modules/logable.rb', line 8

def logger
  @logger
end

Instance Method Details

#clean_logfileObject



10
11
12
13
14
# File 'lib/unity/modules/logable.rb', line 10

def clean_logfile
  return if log_file.kind_of?(IO)

  File.open(log_file, 'w') {}
end

#puts_log_pathObject



16
17
18
# File 'lib/unity/modules/logable.rb', line 16

def puts_log_path
  $stdout.puts("All logs in #{log_file}")
end