lib/log.rb in forj-0.0.24 vs lib/log.rb in forj-0.0.25

- old
+ new

@@ -16,10 +16,11 @@ # limitations under the License. # create a forj.log file in ~/.hpcloud/forj.log +require 'rubygems' require 'logger' require 'require_relative' require_relative 'helpers.rb' @@ -29,13 +30,14 @@ # Logging module # module Logging def info(message) home = Helpers.get_home_path - Helpers.create_directory(format('%{home}/.forj/', home: home)) + d = '%s/.forj/' % [home] + Helpers.create_directory(d) - log = format('%{home}/.forj/forj.log', home: home) + log = '%s/.forj/forj.log' % [home] log = Logger.new(log) log.level = Logger::DEBUG log.formatter = proc do |severity, datetime, progname, msg| "#{progname} : #{datetime}: #{severity}: #{msg} \n" @@ -44,12 +46,13 @@ log.info(message) end def error(message) home = Helpers.get_home_path - Helpers.create_directory(format('%{home}/.forj/', home: home)) + d = '%s/.forj/' % [home] + Helpers.create_directory(d) - log = format('%{home}/.forj/forj.log', home: home) + log = '%s/.forj/forj.log' % [home] log = Logger.new(log) log.level = Logger::ERROR log.formatter = proc do |severity, datetime, progname, msg| "#{progname} : #{datetime}: #{severity}: #{msg} \n"