<commit_before>/**
 *
 * Get the log for a given log type. Log buffer is reset after each request
 *
 * @param {String} type  The [log type](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Log_Type). This must be provided.
 * @returns {Object[]} The list of [log entries](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Log_Entry_JSON_Object)
 *
 * @see  https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/log
 * @type protocol
 *
 */

var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function log (type) {

    /*!
     * make sure that callback contains chainit callback
     */
    var callback = arguments[arguments.length - 1];

    if(typeof type !== 'string' || type === '') {
        return callback(new ErrorHandler.ProtocolError('number or type of arguments don\'t agree with log command'));
    }

    this.requestHandler.create(
        '/session/:sessionId/log',
        type,
        callback
    );

};
<commit_msg>Fix: log command expecting an object and not a string<commit_after>/**
 *
 * Get the log for a given log type. Log buffer is reset after each request
 *
 * @param {String} type  The [log type](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Log_Type). This must be provided.
 * @returns {Object[]} The list of [log entries](https://code.google.com/p/selenium/wiki/JsonWireProtocol#Log_Entry_JSON_Object)
 *
 * @see  https://code.google.com/p/selenium/wiki/JsonWireProtocol#/session/:sessionId/log
 * @type protocol
 *
 */

var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function log (type) {

    /*!
     * make sure that callback contains chainit callback
     */
    var callback = arguments[arguments.length - 1];

    if(typeof type !== 'string' || type === '') {
        return callback(new ErrorHandler.ProtocolError('number or type of arguments don\'t agree with log command'));
    }

    var data = {type: type};

    this.requestHandler.create(
        '/session/:sessionId/log',
        data,
        callback
    );

};

{'fraction_non_alphanumeric': 0.13926499032882012, 'fraction_numerical': 0.0009671179883945841, 'mean_word_length': 3.2397540983606556, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6301312', 'n_tokens_mistral': 624, 'n_tokens_neox': 606, 'n_words': 163}