     # Get metadata
     metadata = @_getMetadata()
     # If ok to send logs, encode logs to Base64
-    logs = ''
     #if @logsSwitch.isOn()
 
 

    ###


    @_getLogs()
    .then (val) =>

      # Set a boolean to pass isOkToSend()
      @view.logs.val(@logsSwitch.isOn())

      l 'logs', val

      _.map @view, (value) =>
        if value.val?() is ''
          value.after('<p style="color:red">The field must be filled!</p>')

      isOktoSend = _.every @view, (value) =>
        value.val?() isnt '' and value.val?()?
      l 'isOktoSend', isOktoSend

      if isOktoSend and @_validateEmail()
        ledger.api.GrooveRestClient.singleton().sendTicket @view.body.val(), @view.email.val(), @view.name.val(), @view.subject.val(), @view.tags.val(), metadata, @logs
      else
        l 'all fields are required!'


    @view.logs.setOn()
  ###

  _tryGetLogs: ->
    d = Q.defer()
    allLogs = ''
    if @logsSwitch.isOn()
      ledger.utils.Logger.logs()
      .then (v) ->
        allLogs = btoa(v)
        d.resolve(allLogs)
      .catch (e) -> l e
    else
      d.resolve(allLogs)
    d.promise


