Method: SimpleLogger#log
- Defined in:
- lib/logging/simple_logger.rb
#log(message) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/logging/simple_logger.rb', line 11 def log() = .to_s # in case booleans or whatever are passed = "#{Time.now.strftime("%Y-%m-%d %H:%M:%S")}" = "" prefix = "#{}|" = .gsub("\n", "\n" + (" " * prefix.length)) = "#{prefix}#{}\n" File.open(@log_file, "a") do |log_file| log_file.print() end print() if @also_log_to_console end |