<commit_before>/**
 * XadillaX <<EMAIL>> created at 2016-12-20 11:41:04 with ❤
 *
 * Copyright (c) 2016 xcoder.in, all rights reserved.
 */
"use strict";

var EventEmitter = require("events").EventEmitter;
var fs = require("fs-extra");
var os = require("os");
var path = require("path");

var tailStream = require("lei-stream").tailStream;
var uuid = require("uuid/v1");
var watch = require("node-watch");

var _setLogPath = require("../build/Release/ons").setLogPath;

var logger = new EventEmitter();

var filenames = [];
var _pathname = path.resolve(os.tmpdir(), ".@node-ons/log-" + uuid());
_setLogPath(_pathname);

try {
    fs.mkdirSync(_pathname);
    filenames = fs.readdirSync(_pathname);
} catch(e) {
    // ...
}

if(process.env.NODE_ONS_LOG === "true") {
    console.log("[.] Log pathname: " + _pathname);
}<commit_msg>fix: using `mkdir -p` while create temp log path<commit_after>/**
 * XadillaX <<EMAIL>> created at 2016-12-20 11:41:04 with ❤
 *
 * Copyright (c) 2016 xcoder.in, all rights reserved.
 */
"use strict";

var EventEmitter = require("events").EventEmitter;
var fs = require("fs-extra");
var os = require("os");
var path = require("path");

var tailStream = require("lei-stream").tailStream;
var uuid = require("uuid/v1");
var watch = require("node-watch");

var _setLogPath = require("../build/Release/ons").setLogPath;

var logger = new EventEmitter();

var filenames = [];
var _pathname = path.resolve(os.tmpdir(), ".@node-ons/log-" + uuid());
_setLogPath(_pathname);

try {
    fs.mkdirsSync(_pathname);
    filenames = fs.readdirSync(_pathname);
} catch(e) {
    if(process.env.NODE_ONS_LOG) {
        console.error(e);
    }
}

if(process.env.NODE_ONS_LOG === "true") {
    console.log("[.] Log pathname: " + _pathname);
}
{'fraction_non_alphanumeric': 0.18757126567844926, 'fraction_numerical': 0.021664766248574687, 'mean_word_length': 4.286144578313253, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, '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': '5579943', 'n_tokens_mistral': 648, 'n_tokens_neox': 622, 'n_words': 140}