loggers.js
function SingleLine()
{
    SingleLine.prototype.print = function(msg)
    {
        var result = check();
        if (result.success)
        {
            process.stdout.clearLine();
            process.stdout.cursorTo(0);
            process.stdout.write(msg);
        }
        else
            MultiLine.prototype.print('missed method: ' + result.required_method + ' ' + msg);
    };

    SingleLine.prototype.info = function(msg)
    {
        this.parse_and_print(arguments, GREEN);
    };

    SingleLine.prototype.mark = function(msg)
    {
        this.parse_and_print(arguments, LIGHT_GREEN);
    };

    SingleLine.prototype.error = function(msg)
    {
        this.parse_and_print(arguments, RED);
    };

    SingleLine.prototype.warn = function(msg)
    {
        this.parse_and_print(arguments, YELLOW);
    };

    function check()
    {
        var check = ['clearLine', 'cursorTo', 'write'];
        for (var i = 0; i < check.length; i++)
        {
            var method = check[i];
            if (!(method in process.stdout))
                return {required_method: method};
        }
        return {success: true};
    }
}
function SingleLine()
{
    SingleLine.prototype.print = function(msg)
    {
        var result = check();
        if (result.success)
        {
            process.stdout.clearLine();
            process.stdout.cursorTo(0);
            process.stdout.write(msg);
        }
        else
            MultiLine.prototype.print('missed method: ' + result.required_method + ' ' + msg);
    };

    SingleLine.prototype.info = function(msg)
    {
        this.parse_and_print(arguments, GREEN);
    };

    SingleLine.prototype.mark = function(msg)
    {
        this.parse_and_print(arguments, LIGHT_GREEN);
    };

    SingleLine.prototype.error = function(msg)
    {
        this.parse_and_print(arguments, RED);
    };

    SingleLine.prototype.warn = function(msg)
    {
        this.parse_and_print(arguments, YELLOW);
    };

    function check()
    {
        var check = ['clearLine', 'cursorTo', 'write'];
        for (var i = 0; i < check.length; i++)
        {
            var method = check[i];
            if (!(method in process.stdout))
                return {required_method: method};
        }
        return {success: true};
    }
}
function SingleLine ( ) { SingleLine . prototype . print = function ( msg ) { var result = check ( ) ; if ( result . success ) { process . stdout . clearLine ( ) ; process . stdout . cursorTo ( 0 ) ; process . stdout . write ( msg ) ; } else MultiLine . prototype . print ( 'missed method: ' + result . required_method + ' ' + msg ) ; } ; SingleLine . prototype . info = function ( msg ) { this . parse_and_print ( arguments , GREEN ) ; } ; SingleLine . prototype . mark = function ( msg ) { this . parse_and_print ( arguments , LIGHT_GREEN ) ; } ; SingleLine . prototype . error = function ( msg ) { this . parse_and_print ( arguments , RED ) ; } ; SingleLine . prototype . warn = function ( msg ) { this . parse_and_print ( arguments , YELLOW ) ; } ; function check ( ) { var check = [ 'clearLine' , 'cursorTo' , 'write' ] ; for ( var i = 0 ; i < check . length ; i ++ ) { var method = check [ i ] ; if ( ! ( method in process . stdout ) ) return { required_method : method } ; } return { success : true } ; } }
Print every message in single line
@constructor
Print every message in single line