       whenLoggedChunk()
 
     if __doesNotExistFile() then __createAndAppend() else __handle err
-    
+
   _formatLine: ({level, msg, meta}) => "[#{level}] - #{@_timestamp()} - #{msg} #{@_meta(meta)} \n"
 
   _timestamp: -> new Date().toISOString()

        @client.appendFromText @containerName, @blobName, chunk, (err, result) =>
          return @_retryIfNecessary(err, chunk, whenLoggedChunk) if err
          whenLoggedChunk()
      , (err) -> 
        debug "Error in block" if err
        __whenLogAllBlock()



class BlobTransport extends Transport

  constructor: ({@account, @containerName, @blobName, @level = "info"}) ->
    @name = "BlobTransport"
    @cargo = @_buildCargo()
    @client = @_buildClient account

  initialize: ->
     Promise.promisifyAll azure.createBlobService @account.name, @account.key
      .createContainerIfNotExistsAsync @containerName, publicAccessLevel: "blob"
      .then (created) => debug "Container: #{@container} - #{if created then 'creada' else 'existente'}"

  log: (level, msg, meta, callback) =>
    line = @_formatLine {level, msg, meta}
