lib/development/repositories/logging_repo.rb
# Write out a dump of information for later inspection.
# The first three parameters are used to name the logfile.
# Log files are written to log/infodump.
#
# @param keyname [string] the general context of the action.
# @param key [string] the specific context of the action.
# @param description [string] A short description of the context (preferably without spaces)
# @param information [string] the text to dump in the logfile.
# @return [void]
Write out a dump of information for later inspection.
The first three parameters are used to name the logfile.
Log files are written to log/infodump.
Write out a dump of information for later inspection . The first three parameters are used to name the logfile . Log files are written to log / infodump .
def log_infodump(keyname, key, description, information)
      dir = File.join(ENV['ROOT'], 'log', 'infodump')
      Dir.mkdir(dir) unless Dir.exist?(dir)
      fn = File.join(dir, "#{keyname}_#{key}_#{Time.now.strftime('%Y_%m_%d_%H_%M_%S')}_#{description}.log")
      File.open(fn, 'w') { |f| f.puts information }
    end
def log_infodump ( keyname , key , description , information ) dir = File . join ( ENV [ 'ROOT' ] , 'log' , 'infodump' ) Dir . mkdir ( dir ) unless Dir . exist? ( dir ) fn = File . join ( dir , "#{keyname}_#{key}_#{Time.now.strftime('%Y_%m_%d_%H_%M_%S')}_#{description}.log" ) File . open ( fn , 'w' ) { | f | f . puts information } end
Write out a dump of information for later inspection.
Write out a dump of information for later inspection .
None
void
keyname
the general context of the action.
the general context of the action .
key
the specific context of the action.
the specific context of the action .
description
A short description of the context (preferably without spaces)
A short description of the context ( preferably without spaces )
information
the text to dump in the logfile.
the text to dump in the logfile .