// (C) 2007-2022 GoodData Corporation
import os from 'os';

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

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

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