Sha256: 60701399e500a2fbcb6901843c305b91c250a108916765e0fd2e2a207409ff88

Contents?: true

Size: 856 Bytes

Versions: 24

Compression:

Stored size: 856 Bytes

Contents

class Loginator

  constructor :configurator, :project_file_loader, :project_config_manager, :file_wrapper, :system_wrapper


  def setup_log_filepath
    config_files = []
    config_files << @project_file_loader.main_file
    config_files << @project_file_loader.user_file
    config_files.concat( @project_config_manager.options_files )
    config_files.compact!
    config_files.map! { |file| file.ext('') }
    
    log_name = config_files.join( '_' )

    @project_log_filepath = File.join( @configurator.project_log_path, log_name.ext('.log') )
  end


  def log(string, heading=nil)
    return if (not @configurator.project_logging)
  
    output  = "\n[#{@system_wrapper.time_now}]"
    output += " :: #{heading}" if (not heading.nil?)
    output += "\n#{string.strip}\n"

    @file_wrapper.write(@project_log_filepath, output, 'a')
  end
  
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
ceedling-0.31.1 lib/ceedling/loginator.rb
ceedling-0.31.0 lib/ceedling/loginator.rb
ceedling-0.30.0 lib/ceedling/loginator.rb
ceedling-0.28.3 lib/ceedling/loginator.rb
ceedling-0.28.2 lib/ceedling/loginator.rb
ceedling-0.28.1 lib/ceedling/loginator.rb
ceedling-0.27.0 lib/ceedling/loginator.rb
ceedling-0.25.0 lib/ceedling/loginator.rb
ceedling-0.24.0 lib/ceedling/loginator.rb
ceedling-0.22.0 lib/ceedling/loginator.rb
ceedling-0.21.0 lib/ceedling/loginator.rb
ceedling-0.20.3 lib/ceedling/loginator.rb
ceedling-0.20.2 lib/ceedling/loginator.rb
ceedling-0.19.0 lib/ceedling/loginator.rb
ceedling-0.18.0 lib/ceedling/loginator.rb
ceedling-0.17.0 lib/ceedling/loginator.rb
ceedling-0.16.0 lib/ceedling/loginator.rb
ceedling-0.15.6 lib/ceedling/loginator.rb
ceedling-0.15.5 lib/ceedling/loginator.rb
ceedling-0.15.4 lib/ceedling/loginator.rb