the LogStream constructor.
it inherits all methods of a writable stream
the constructor takes a options object. A important field is the model, the model will
be used for saving the log entry to the mongo db instance.
@param options
@constructor
422618
function LogStream(options) {

    this.model = options.model || false;

    if (!this.model) {
        throw new Error('[LogStream] - Fatal Error - No mongoose model provided!');
    }

    Writable.call(this, options);
}
1071120
@com.fasterxml.jackson.annotation.JsonProperty("LogStreamArn")
    public void setLogStreamArn(String logStreamArn) {
        this.logStreamArn = logStreamArn;
    }
103039
function objectMode( value, options ) {
		if ( arguments.length < 2 ) {
			options = {};
		}
		options.objectMode = true;
		return new Stream( value, options );
	}
517387
function (console2, logWriter) {

            //On new log, save it
            console2.on('new', function (log) {

                logWriter.save(log, {
                    logger   : log.opt
                });

            });

            //On new logger, save its options
            console2.on('newLogger', function (logger, loggerOpt) {

                logWriter.addLogger(loggerOpt);

            });
        }
318242
def do_logStream(self,args):
        """"""
        parser = CommandArgumentParser("logStream")
        parser.add_argument(dest='logStream',help='logStream index.');
        args = vars(parser.parse_args(args))

        print "loading log stream {}".format(args['logStream'])
        index = int(args['logStream'])
        logStream = self.logStreams[index]

        print "logStream:{}".format(logStream)
        self.childLoop(AwsLogStream.AwsLogStream(logStream,self))
429603
function(options) {
    if (!options) {
      options = {};
    }

    if (options.log) {
      if (!_.isFunction(options.log)) {
        throw new Error('setLogOptions expects the log key in the options parameter to be a function');
      }
    } else {
      // if no log function was passed set it to a default no op function.
      options.log = function() {};
    }

    if (options.level) {
      var level = options.level;
      if (level < 0 || level > 3) {
        throw new Error('setLogOptions expects the level key to be in the range 0 to 3 inclusive');
      }
    } else {
      options.level = this.LOGGING_LEVEL.ERROR;
    }

    if (options.loggingWithPII != true) {
      options.loggingWithPII = false;
    }
    
    this.LogOptions = options;
  }
438765
function(options)
    {
      var localIncludeTimestamp;
      var localBufferMaxLength;
      var localMessageMaxLength;
      var localLevel;

      // if an options argument is specified
      if (Util.exists(options))
      {
        // make sure it's an object
        Errors.assertInternal(Util.isObject(options));

        localIncludeTimestamp = options.includeTimestamp;
        localBufferMaxLength = options.bufferMaxLength;
        localMessageMaxLength = options.messageMaxLength;
        localLevel = options.level;
      }

      // if an includeTimestamp options is specified, convert it to a boolean
      if (Util.exists(localIncludeTimestamp))
      {
        includeTimestamp = !!localIncludeTimestamp;
      }
      else if (!Util.exists(includeTimestamp))
      {
        // default to true
        includeTimestamp = true;
      }

      // if a bufferMaxLength option is specified, make sure
      // it's a positive integer before updating the logger option
      if (Util.exists(localBufferMaxLength))
      {
        Errors.assertInternal(
            Util.number.isPositiveInteger(localBufferMaxLength));
        bufferMaxLength = localBufferMaxLength;
      }
      // initialize logger option if configure() hasn't been called before
      else if (!Util.exists(bufferMaxLength))
      {
        bufferMaxLength = DEFAULT_BUFFER_MAX_LENGTH;
      }

      // if a messageMaxLength option is specified, make sure
      // it's a positive integer before updating the logger option
      if (Util.exists(localMessageMaxLength))
      {
        Errors.assertInternal(
            Util.number.isPositiveInteger(localMessageMaxLength));
        messageMaxLength = localMessageMaxLength;
      }
      // initialize logger option if configure() hasn't been called before
      else if (!Util.exists(messageMaxLength))
      {
        messageMaxLength = DEFAULT_MESSAGE_MAX_LENGTH;
      }

      // if a level option is specified, make sure
      // it's valid before updating the logger option
      if (Util.exists(localLevel))
      {
        Errors.assertInternal(
            MAP_LOG_LEVEL_TO_OBJECT.hasOwnProperty(localLevel));
        currlevelObject = MAP_LOG_LEVEL_TO_OBJECT[localLevel];
      }
      // initialize logger option if configure() hasn't been called before
      else if (!Util.exists(currlevelObject))
      {
        currlevelObject = DEFAULT_LEVEL;
      }
    }
1243585
function Logger(options)
{
  /**
   * The array to which all log messages will be added.
   *
   * @type {String[]}
   */
  var buffer = [];

  /**
   * Logs a message at a given level.
   *
   * @param {String} levelTag the tag associated with the level at which to log
   *   the message.
   * @param {String} message the message to log.
   * @param {Number} bufferMaxLength the maximum size to which the message
   *   buffer can grow.
   */
  var logMessage = function(levelTag, message, bufferMaxLength)
  {
    // add the log level tag (e.g. info, warn, etc.) to the front of the message
    message = Util.format('%s: %s', levelTag, message);

    // if the buffer is full, evict old messages
    while (buffer.length >= bufferMaxLength)
    {
      buffer.shift();
    }

    // add the new message to the buffer
    buffer.push(message);
  };

  // create an inner implementation to which all our methods will be forwarded
  var common = Core.createLogger(options, logMessage);

  /**
   * Configures this logger.
   *
   * @param {Object} options
   */
  this.configure = function(options)
  {
    common.configure(options);
  };

  /**
   * Returns the current log level.
   *
   * @returns {Number}
   */
  this.getLevel = function()
  {
    return common.getLevelNumber();
  };

  /**
   * Logs a given message at the error level.
   *
   * @param {String} message
   */
  this.error = function(message)
  {
    common.error.apply(common, arguments);
  };

  /**
   * Logs a given message at the warning level.
   *
   * @param {String} message
   */
  this.warn = function(message)
  {
    common.warn.apply(common, arguments);
  };

  /**
   * Logs a given message at the info level.
   *
   * @param {String} message
   */
  this.info = function(message)
  {
    common.info.apply(common, arguments);
  };

  /**
   * Logs a given message at the debug level.
   *
   * @param {String} message
   */
  this.debug = function(message)
  {
    common.debug.apply(common, arguments);
  };

  /**
   * Logs a given message at the trace level.
   *
   * @param {String} message
   */
  this.trace = function(message)
  {
    common.trace.apply(common, arguments);
  };

  /**
   * Returns the log buffer.
   *
   * @returns {String[]}
   */
  this.getLogBuffer = function()
  {
    // return a copy of the buffer array; calling slice() shallow-copies the
    // original array, but that's sufficient in this case because the array
    // contains strings
    return buffer.slice();
  };
}
575417
function(options) {
  stream.Duplex.call(this, { objectMode: true });

  this.options = extend(true, Pipeline.DEFAULTS, options || {});
  this.readyState = 0; // 0: closed, 1: open

  this._pipeline = [];

  this.setMaxListeners(0); // unlimited listeners allowed

  this.options.ipc.subscribe(
    this.options.ipc.namespace,
    this._proxy.bind(this)
  );
}
920777
function StreamCopier() {
	var self = this
	stream.Stream.call(this)
	this.writable = true
	this.log = log
	this.write = write
	this.setPrepend = setPrepend
	this.pLog = pLog
	this.addStream = addStream
	this.removeStream = removeStream
	this.end = end
	this.destroy = destroy
	var prepend
	var streamIndex = 0
	var streams = {}

	function pLog() {
		commonLog(Array.prototype.slice.call(arguments), prepend)
	}

	function log() {
		commonLog(Array.prototype.slice.call(arguments))
	}

	function commonLog(args, prepend) {
		var s = util.format.apply(this, args) + '\n'
		if (prepend) s = prepend + ' ' + s
		write(s)
	}

	function setPrepend(s) {
		prepend = s ? String(s) : ''
		return self
	}

	function addStream(stream, name) {
		if (self.writable) {
			var i = streamIndex++
			streams[i] = {
				stream: stream,
				name: name
			}
		} else self.emit('error', 'Stream not writable')
		return i
	}

	function removeStream(no) {
		delete streams[no]
	}

	function write(s) {
		var err
		var didCb
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null

		var cbCounter = Object.keys(streams).length + 1
		for (var streamNo in streams) doWrite(streamNo)
		end()

		function doWrite(streamNo) {
			var stream = streams[streamNo].stream
			if (stream.writable) stream.write.apply(stream, args.concat(writeResult))
			else streamLost()

			function writeResult(e) {
				if (!e) end()
				else streamLost(e) // a write resulted in error
			}

			function streamLost(e) {
				var isError = Object.keys(streams).length == 1 // if we lost the last stream, it's error

				// emit the event
				eventType = isError ? 'error' : 'warning'
				var msg = 'Stream ' + streams[streamNo].name + ' no longer writable'
				if (e) msg += ': ' + err.msg
				self.emit(eventType, msg)
				delete streams[streamNo]

				if (isError) {
					if (!e) e = new Error(msg)
					self.writable = false
					end(e)
				} else write(msg, end) // write to remaining streams
			}
		}

		function end(e) {
			if (!err && e) err = e
			if (!err) {
				if (!--cbCounter && cb) {
					cb()
				}
			} else if (!didCb && cb) {
				didCb = true
				cb(err)
			}
		}
	}

	function end(s) {
		var err
		var args = Array.prototype.slice.call(arguments)
		var cb = typeof args[args.length - 1] === 'function' ? args.pop() : null
		var cbCounter = Object.keys(streams).length + 1

		if (args.length) write.apply(this, args.concat(allWritten))
		else allWritten()

		function allWritten(e) {
			if (e && !err) err = e
			for (var streamNo in streams) doEnd(streamNo)
			end()
		}

		function doEnd(streamNo) {
			streams[streamNo].stream.end(endResult)

			function endResult(e) {
				if (e) {
					if (!err) err = e
					self.emit('error', 'Stream ' + streams[streamNo].name + ' end error: ' + e.message)
				}
				delete streams[streamNo]
				end()
			}
		}

		function end() {
			if (!--cbCounter) {
				self.writable = false
				if (cb)
					if (err) cb(err)
					else cb()
			}
		}
	}

	function destroy(cb) {
		var cbCounter = Object.keys(streams).length + 1
		for (var streamNo in streams) doDestroy(streamNo)
		end()

		function doDestroy(streamNo) {
			streams[streamNo].stream.destroy(endResult)

			function destroyResult(e) {
				if (e) {
					if (!err) err = e
					self.emit('error', 'Stream ' + streams[streamNo].name + ' destroy error: ' + e.message)
				}
				delete streams[streamNo]
				end()
			}
		}

		function end() {
			if (!--cbCounter) {
				self.writable = false
				if (cb)
					if (err) cb(err)
					else cb()
			}
		}
	}
}
1066841
public LogPublishingOptionsStatus withOptions(java.util.Map<String, LogPublishingOption> options) {
        setOptions(options);
        return this;
    }
322424
function Logger_write() {
            var log = this.logs.shift();

            if (log && (this.config.type === log.type || this.config.type === 'ALL')) {
                if (this.config.console) {
                    if (log.type === 'ERROR') {
                        exec_console(console.error, log, this.config.streamFormat);
                    } else if (log.type === 'INFO') {
                        exec_console(console.info, log, this.config.streamFormat);
                    } else if (log.type === 'WARNING') {
                        exec_console(console.warn, log, this.config.streamFormat);
                    } else {
                        exec_console(console.log, log, this.config.streamFormat);
                    }
                }

                if (this.stream) {
                    if (this.config.streamFormat === 'json') {
                        this.stream.write(JSON.stringify(log));
                        this.stream.write('\n');
                    } else {
                        this.stream.write('TYPE: ' + log.type);
                        this.stream.write('\n');
                        this.stream.write('CREATED: ' + log.created + '\t ');
                        this.stream.write('\n');
                        this.stream.write('MESSAGE: ' + log.message + '\t ' + log.trace);
                        this.stream.write('\n');
                        this.stream.write('DATA: ' + this.clean(log.data));
                        this.stream.write('\n');
                        this.stream.write('\n');
                    }
                }
                // clean log data for hook
                log.data = this.clean(log.data);
                // call log
                this.hooks.forEach(function (callback) {
                    callback(log);
                });
            }
            /**
             * Exec console output
             * @param func
             * @param log
             */
            function exec_console(func, log, format) {
                if (format === 'json') {
                    func(JSON.stringify(log));
                } else {
                    func(
                        ' ' + log.type + '\n',
                        'CREATED: ' + log.created + '\t ' + '\n',
                        'MESSAGE: ' + log.message + '\t ' + log.trace + '\n',
                        !!log.data ? 'DATA:' + log.data + '\n' : '',
                        '\n'
                    );
                }
            };
        }
1267828
private void processOptions(OptionSet options) {
    Pseudorandom.get().setSeed(options.valueOf(randomSeed));

    if (opts.contains(CommonOptions.MAP_REDUCE)) {
      MapReduceConfiguration.setMapReduceExecutor(new LocalMapReduceExecutor(
          options.valueOf(mrMaxThreads), options.valueOf(mrMaxBatchesPerThread)));
    }

    if (opts.contains(CommonOptions.STOCHASTIC_GRADIENT) || opts.contains(CommonOptions.LBFGS)) {
      LogFunction log = null;
      if (parsedOptions.has(logBrief)) {
        log = new NullLogFunction();
      } else {
         log = new DefaultLogFunction(parsedOptions.valueOf(logInterval), false,
             options.valueOf(logParametersInterval), options.valueOf(logParametersDir));
      }
      LogFunctions.setLogFunction(log);
    }
  }
409627
public static CreateObjectOptions objectOptionsFromFileOptions(CreateFileOptions options) {
    return new CreateObjectOptions(
        options.overwriteExisting(), options.getContentType(), options.getAttributes());
  }
33359
function FeedJett (options) {
  if (!(this instanceof FeedJett)) {
    return new FeedJett(options);
  }

  TransformStream.call(this);
  this._readableState.objectMode = true;
  this._readableState.highWaterMark = 16; // max. # of output nodes buffered

  this.init();
  this.parseOptions(options);

  sax.MAX_BUFFER_LENGTH = this.options.MAX_BUFFER_LENGTH;
  this.stream = sax.createStream(this.options.strict, {lowercase: true, xmlns: true });
  this.stream.on('processinginstruction', this.onProcessingInstruction.bind(this));
  this.stream.on('attribute', this.onAttribute.bind(this));
  this.stream.on('opentag', this.onOpenTag.bind(this));
  this.stream.on('closetag',this.onCloseTag.bind(this));
  this.stream.on('text', this.onText.bind(this));
  this.stream.on('cdata', this.onText.bind(this));
  this.stream.on('end', this.onEnd.bind(this));
  this.stream.on('error', this.onSaxError.bind(this));
}
793511
function buildStream (host, options, secure) {
  var stream = [];

  // accept options as a secure boolean
  if (options === true) {
    secure = true;
  }

  options = _.defaults(_.isObject(options) ? options : {}, {
    request  : {},
    response : {}
  });

  function applyStreamFunctions (funcSet) {
    _.each(funcSet || [], function (middleware) {
      if (_.isFunction(middleware)) {
        // wrapper allows us to call the callback without passing proxyObj
        stream.push(function asyncWrapper (proxyObj, callback) {
          return middleware(proxyObj, (error, _proxyObj) => callback(error, _proxyObj || proxyObj));
        });
      }
    });
  }

  // if there is `pre` middleware
  let preSet = options.pre;
  if (preSet) {
    // accept raw functions, but wrap it in an array
    preSet = _.isFunction(preSet) ? [preSet] : preSet;
    applyStreamFunctions(preSet);
  }

  // push the core request
  stream.push(proxyReq);

  // if there is `post` middleware
  let postSet = options.post;
  if (postSet) {
    // accept raw functions, but wrap it in an array
    postSet = _.isFunction(postSet) ? [postSet] : postSet;
    applyStreamFunctions(postSet);
  }

  if (secure) {
    options.request.forceHttps = true;
  }

  return stream;
}
1122658
function create(options) {
  options = options || {};

  var scrollParent = (options.scrollTarget && options.scrollTarget.parentNode) || window;

  var oldScrollY;
  var scrollDirty = true;
  var scrollEventsStream = Stream.createFromEvents(scrollParent, 'scroll');

  Stream.onValue(scrollEventsStream, function onScrollSetDirtyBit_() {
    scrollDirty = true;
  });

  var rAF = Stream.createFromRAF();

  var didChangeOnRAFStream = Stream.filter(function filterDirtyFramesFromRAF_() {
    if (!scrollDirty) { return false; }
    scrollDirty = false;

    var newScrollY = DOM.documentScrollY(scrollParent);

    if (oldScrollY !== newScrollY) {
      oldScrollY = newScrollY;
      return true;
    }

    return false;
  }, rAF);

  // It's going to space, will you just give it a second!
  Util.defer(Util.partial(Events.dispatchEvent, scrollParent, 'scroll'), 10);

  return Stream.map(function getWindowPosition_() {
    return oldScrollY;
  }, didChangeOnRAFStream);
}