def record(&block)
      recording_groups << Array.new
      last_group = nil
      begin
        yield
      ensure
        last_group = recording_groups.pop
      end
      last_group
    end
def record(&block)
      recording_groups << Array.new
      last_group = nil
      begin
        yield
      ensure
        last_group = recording_groups.pop
      end
      last_group
    end
Begins recording of series of messages and returns all recorded events.
 If there is no record block on any level, messages are not accumulated,
 but only last_message is updated.
 Returns a list of all recorded messages.