index.js
function (config) {
    /** @type {SplunkLogger} */
    this.logger = new SplunkLogger(config);

    // If using the common logger's default name, change it
    if (this.logger.config.name.match("splunk-javascript-logging/\\d+\\.\\d+\\.\\d+")) {
        this.logger.config.name = "splunk-bunyan-logger/0.10.1";
    }

    // Overwrite the common library's error callback
    var that = this;
    this.logger.error = function(err, context) {
        that.emit("error", err, context);
    };

    /* jshint unused:false */
    /**
     * A callback function called after sending a request to Splunk:
     *  <code>function(err, response, body)</code>. Defaults
     * to an empty function.
     *
     * @type {function}
     */
    this.send = function(err, resp, body) {};
}
function (config) {
    /** @type {SplunkLogger} */
    this.logger = new SplunkLogger(config);

    // If using the common logger's default name, change it
    if (this.logger.config.name.match("splunk-javascript-logging/\\d+\\.\\d+\\.\\d+")) {
        this.logger.config.name = "splunk-bunyan-logger/0.10.1";
    }

    // Overwrite the common library's error callback
    var that = this;
    this.logger.error = function(err, context) {
        that.emit("error", err, context);
    };

    /* jshint unused:false */
    /**
     * A callback function called after sending a request to Splunk:
     *  <code>function(err, response, body)</code>. Defaults
     * to an empty function.
     *
     * @type {function}
     */
    this.send = function(err, resp, body) {};
}
function ( config ) { /** @type {SplunkLogger} */ this . logger = new SplunkLogger ( config ) ; // If using the common logger's default name, change it if ( this . logger . config . name . match ( "splunk-javascript-logging/\\d+\\.\\d+\\.\\d+" ) ) { this . logger . config . name = "splunk-bunyan-logger/0.10.1" ; } // Overwrite the common library's error callback var that = this ; this . logger . error = function ( err , context ) { that . emit ( "error" , err , context ) ; } ; /* jshint unused:false */ /**
     * A callback function called after sending a request to Splunk:
     *  <code>function(err, response, body)</code>. Defaults
     * to an empty function.
     *
     * @type {function}
     */ this . send = function ( err , resp , body ) { } ; }
A class that implements a raw writable stream.

@property {object} config - Configuration settings for this <code>SplunkStream</code> instance.
@property {object[]} contextQueue - Queue of <code>context</code> objects to be sent to Splunk.
@property {function} error - A callback function for errors: <code>function(err, context)</code>.
Defaults to <code>console.log</code> both values;

@param {object} config - Configuration settings for a new [SplunkLogger]{@link SplunkLogger}.
@param {string} config.token - HTTP Event Collector token, required.
@param {string} [config.name=splunk-javascript-logging/0.10.1] - Name for this logger.
@param {string} [config.host=localhost] - Hostname or IP address of Splunk server.
@param {string} [config.maxRetries=0] - How many times to retry when HTTP POST to Splunk fails.
@param {string} [config.path=/services/collector/event/1.0] - URL path to send data to on the Splunk server.
@param {string} [config.protocol=https] - Protocol used to communicate with the Splunk server, <code>http</code> or <code>https</code>.
@param {number} [config.port=8088] - HTTP Event Collector port on the Splunk server.
@param {string} [config.url] - URL string to pass to {@link https://nodejs.org/api/url.html#url_url_parsing|url.parse}. This will try to set
<code>host</code>, <code>path</code>, <code>protocol</code>, <code>port</code>, <code>url</code>. Any of these values will be overwritten if
the corresponding property is set on <code>config</code>.
@param {string} [config.level=info] - Logging level to use, will show up as the <code>severity</code> field of an event, see
[SplunkLogger.levels]{@link SplunkLogger#levels} for common levels.
@param {number} [config.batchInterval=0] - Automatically flush events after this many milliseconds.
When set to a non-positive value, events will be sent one by one. This setting is ignored when non-positive.
@param {number} [config.maxBatchSize=0] - Automatically flush events after the size of queued
events exceeds this many bytes. This setting is ignored when non-positive.
@param {number} [config.maxBatchCount=1] - Automatically flush events after this many
events have been queued. Defaults to flush immediately on sending an event. This setting is ignored when non-positive.
@constructor
@implements {@link https://nodejs.org/api/stream.html#stream_class_stream_writable|Stream.Writable}
A class that implements a raw writable stream .