lib/kitchen/logger.rb
# Return an IO object from a filepath String or the IO object itself.
#
# @param filepath_or_logdev [String,IO] a filepath String or IO object
# @return [IO] an IO object
# @api private
Return an IO object from a filepath String or the IO object itself.
Return an IO object from a filepath String or the IO object itself .
def resolve_logdev(filepath_or_logdev)
      if filepath_or_logdev.is_a? String
        FileUtils.mkdir_p(File.dirname(filepath_or_logdev))
        file = File.open(File.expand_path(filepath_or_logdev), "ab")
        file.sync = true
        file
      else
        filepath_or_logdev
      end
    end
def resolve_logdev ( filepath_or_logdev ) if filepath_or_logdev . is_a? String FileUtils . mkdir_p ( File . dirname ( filepath_or_logdev ) ) file = File . open ( File . expand_path ( filepath_or_logdev ) , "ab" ) file . sync = true file else filepath_or_logdev end end
Return an IO object from a filepath String or the IO object itself.
Return an IO object from a filepath String or the IO object itself .
an IO object
an IO object
IO
filepath_or_logdev
a filepath String or IO object
a filepath String or IO object
api
None