@since 0.0.1
@author Igor Ivanovic
@method Logger#createStreams

@description
Create read log server
769792
function Logger_createReadLogServer() {
            var that = this;
            this.server = new HttpServer();
            this.server.on('request', function (request, response) {
                var startMessage = 'LAST '+ that.config.readLength + ' BYTES:\n\n';

                fs.open(that.file, 'r', 755, function(status, fd) {
                    fs.fstat(fd, function (err, stats) {
                        var size = stats.size,
                            start = size > that.config.readLength ? size - that.config.readLength : 0,
                            end = size > that.config.readLength ? that.config.readLength : size,
                            buffer =  new Buffer(end + startMessage.length);
                        buffer.fill(startMessage);
                        fs.read(fd, buffer, startMessage.length, end, start, function() {
                            response.writeHead(200, {'Content-type': 'text/plain', 'Content-Length': buffer.length});
                            response.end(buffer);
                        });
                    });
                });

            });

            this.server.listen(this.config.port);

            this.info('Publishing log write stream on port: ', this.config.port);
        }
42091
@Override
    public StreamMessage createStreamMessage() throws JMSRuntimeException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "createStreamMessage");

        StreamMessage streamMessage = null;

        try {
            streamMessage = jmsSession.createStreamMessage();
        } catch (JMSException jmse) {
            throw (JMSRuntimeException) JmsErrorUtils.getJMS2Exception(jmse, JMSRuntimeException.class);
        } finally {
            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(this, tc, "createStreamMessage", new Object[] { streamMessage });
        }

        return streamMessage;

    }
95793
async function readLogStream(file, instance) {
    return new Promise(resolve => {
        var stream = fs.createReadStream(file, { encoding: 'utf8', highWaterMark: instance.chunkSize });
        var hasStarted = false;
        // Split data into chunks so we dont stall the client
        stream.on('data', chunk => {
            if (!hasStarted) instance.emit("parsingStarted");
            hasStarted = true;
            var lines = chunk.toString().split("\n");
            // Pause stream until this chunk is completed to avoid spamming the thread
            stream.pause();
            async.each(lines, function (line, callback) {
                instance.registerMatch(line);
                callback();
            }, function (err) {
                setTimeout(() => {
                    stream.resume();
                }, instance.chunkInterval);
            });
        });
        stream.on('end', () => {
            instance.emit("parsingComplete");
            resolve();
            stream.close();
        });
    });
}
980488
private PrintStream createOutputStream() {
        if (outputLogFilename != null) {
            try {
                FileOutputStream fout = new FileOutputStream(outputLogFilename, false);
                BufferedOutputStream bos = new BufferedOutputStream(fout, 4096);
                // We are using a PrintStream for output to match System.out
                if (encoding != null) {
                    return new PrintStream(bos, false, encoding);
                } else {
                    return new PrintStream(bos, false);
                }
            } catch (IOException e) {
                throw new IllegalArgumentException(getLocalizedString("CWTRA0005E"));
            }
        }

        // No output filename specified.
        isSystemOut = true;
        if (encoding != null) {
            try {
                // Encode output before directing it into System.out
                return new PrintStream(System.out, false, encoding);
            } catch (UnsupportedEncodingException e) {
                // We already checked that encoding is supported
            }
        }
        return System.out;
    }
921494
function create(targetScrollY) {
  var scrollPositionStream = ScrollStream.create();
  var overTheLineStream = Stream.create();
  var pastScrollY = false;
  var firstRun = true;

  Stream.onValue(scrollPositionStream, function onScrollTrackPosition_(currentScrollY) {
    if ((firstRun || pastScrollY) && (currentScrollY < targetScrollY)) {
      pastScrollY = false;
      Stream.emit(overTheLineStream, ['before', targetScrollY]);
    } else if ((firstRun || !pastScrollY) && (currentScrollY >= targetScrollY)) {
      pastScrollY = true;
      Stream.emit(overTheLineStream, ['after', targetScrollY]);
    }

    firstRun = false;
  });

  return overTheLineStream;
}
799190
private function createStreamCallback()
    {
        $read =& $this->readListeners;
        $write =& $this->writeListeners;
        $this->streamCallback = function ($stream, $flags) use (&$read, &$write) {
            $key = (int) $stream;

            if (Event::READ === (Event::READ & $flags) && isset($read[$key])) {
                \call_user_func($read[$key], $stream);
            }

            if (Event::WRITE === (Event::WRITE & $flags) && isset($write[$key])) {
                \call_user_func($write[$key], $stream);
            }
        };
    }
979077
def stream(socket)
      include_proxy_headers if using_proxy? && !@uri.https?
      Request::Writer.new(socket, body, headers, headline).stream
    end
593294
function Logger(options) {
        var logger;

        // Default values
        var dict = {
            ssl: true,
            catchall: false,
            trace: true,
            page_info: 'never',
            print: false,
            endpoint: null,
            token: null
        };

        if (typeof options === "object")
            for (var k in options)
                dict[k] = options[k];
        else
            throw new Error("Invalid parameters for createLogStream()");

        if (dict.token === null) {
            throw new Error("Token not present.");
        } else {
            logger = new LogStream(dict);
        }

        var _log = function(msg) {
            if (logger) {
                return logger.log.apply(this, arguments);
            } else
                throw new Error("You must call LE.init(...) first.");
        };

         // The public interface
        return {
            log: function() {
                _log.apply(this, arguments).level('LOG').send();
            },
            warn: function() {
                _log.apply(this, arguments).level('WARN').send();
            },
            error: function() {
                _log.apply(this, arguments).level('ERROR').send();
            },
            info: function() {
                _log.apply(this, arguments).level('INFO').send();
            }
        };
    }
477476
function Connection(log, firstStreamId, settings) {
  // * initializing the base class
  Flow.call(this, 0);

  // * logging: every method uses the common logger object
  this._log = log.child({ component: 'connection' });

  // * stream management
  this._initializeStreamManagement(firstStreamId);

  // * lifecycle management
  this._initializeLifecycleManagement();

  // * flow control
  this._initializeFlowControl();

  // * settings management
  this._initializeSettingsManagement(settings);

  this._initializeConnectionFlowControl();

  // * multiplexing
  this._initializeMultiplexing();
}
988305
function logReadableStream(stream) {
        var encoding = "utf8";

        stream.setEncoding(encoding);

        stream.on("data", function (chunk) {
            writeToLog(chunk, encoding);
        });
    }
876488
function Logger() {
  this._level = LEVELS.NOTICE;
  this._out = process.stdout;
  this._err = process.stderr;

  /* istanbul ignore next: allow server to suppress logs */
  if(process.env.NODE_ENV === Constants.TEST && !process.env.TEST_DEBUG) {
    this.log = function noop(){};
  }
}
274750
private static function initializeOutputStreams()
    {
        if (self::$out === null) {
            if (!defined('STDOUT')) {
                self::$out = new OutputStream(fopen('php://stdout', 'w'));
            } else {
                self::$out = new OutputStream(STDOUT);
            }
        }
        if (self::$err === null) {
            if (!defined('STDERR')) {
                self::$err = new OutputStream(fopen('php://stderr', 'w'));
            } else {
                self::$err = new OutputStream(STDERR);
            }
        }
    }
302268
def open(io)
      begin
        @@logger = Logger.new(io, *@@options)
      rescue IOError => e
        @@logger = Logger.new($stderr)
        $stderr.puts "Cannot open log file: #{e.message}"
      end
      @@logger.level = @@level
      @@logger.formatter = @@formatter
    end
697899
function LogstashStream(options) {
  EventEmitter.call(this);
  options = options || {};

  this.name = 'bunyan';
  this.level = options.level || 'info';
  this.server = options.server || os.hostname();
  this.host = options.host || '127.0.0.1';
  this.port = options.port || 9999;
  this.application = options.appName || process.title;
  this.pid = options.pid || process.pid;
  this.tags = options.tags || ['bunyan'];
  this.type = options.type;

  this.client = null;

  // ssl
  this.ssl_enable = options.ssl_enable || false;
  this.ssl_key = options.ssl_key || '';
  this.ssl_cert = options.ssl_cert || '';
  this.ca = options.ca || '';
  this.ssl_passphrase = options.ssl_passphrase || '';

  this.cbuffer_size = options.cbuffer_size || 10;

  // Connection state
  this.log_queue = new CBuffer(this.cbuffer_size);
  this.connected = false;
  this.socket = null;
  this.retries = -1;

  this.max_connect_retries = (typeof options.max_connect_retries === 'number') ? options.max_connect_retries : 4;
  this.retry_interval = options.retry_interval || 100;

  this.connect();
}
1231011
def new_stream(**args)
      fail ConnectionClosed if @state == :closed
      fail StreamLimitExceeded if @active_stream_count >= @remote_settings[:settings_max_concurrent_streams]

      stream = activate_stream(id: @stream_id, **args)
      @stream_id += 2

      stream
    end
917574
function createLogRequest(logger, utils, path, environment, emitter, failureCallback) {

  'use strict';

  logger.logEnter('createLogRequest ' + path);

  var options = environment.elasticsearchOptions('POST', path);

  var respConsumer = utils.responseConsumer(logger, 'after posting events', 200, failureCallback ? failureCallback : emitter, null, 201, options, path);

  var request = environment.request(options, respConsumer);

  request.once('error', function (e) {
    emitter.emit('error', 'Error while reporting events: ' + e);
  });

  request.setHeader('Content-Type', 'text/plain');

  logger.logExit('createLogRequest');

  return request;
}
470130
function createStream(func) {
    var dir = Path.dirname(this.options.path);
    Mkdirp.sync(dir);
    return Fs[func](this.options.path, Ul.deepMerge(
        {}
      , this.options.options
      , { flags: this.options.flags }
    ));
}