Sha256: 712b066b393ef4835321c0b68d80d17b230cfb2e453c867ea4d60f14c6bba453

Contents?: true

Size: 526 Bytes

Versions: 1

Compression:

Stored size: 526 Bytes

Contents

require 'structured_log'

StructuredLog.open('custom_section.xml') do |log|
  log.section('With blocks') do
    log.put_element('section_with_children') do
      log.put_element('child', :rank => 'Older')
      log.put_element('child', :rank => 'Younger')
    end
    log.put_element('section_with_duration', :duration, 'Block contains timed code to be timed.') do
      sleep 1
    end
    log.put_element('section_with_rescue', :rescue, 'Block contains code to be rescued if necessary.') do
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
structured_log-0.9.0 readme_files/scripts/custom_section.rb