// (C) 2007-2018 GoodData Corporation
const os = require('os');

function logTime() {
    const now = new Date();
    process.stdout.write(`${now.toISOString().replace('T', ' ')} `);
}

function log(value, includeTime = true) {
    if (includeTime) {
        logTime();
    }
    process.stdout.write(value);
}

function logLn(value, includeTime = true) {
    log(value, includeTime);
    log(os.EOL, false);
}

module.exports = {
    log,
    logLn
};
