view src/implab/log/ConsoleLogChannel.js @ 27:aee8ea860e9b

added utest/store/mock - json based mock store
author cin
date Mon, 11 Dec 2017 16:48:19 +0300
parents 7d7059d2a810
children
line wrap: on
line source

define(
    [ "dojo/_base/declare", "../text/format" ],
    function(declare, format) {
        return declare(
            null,
            {
                name : null,

                constructor : function(name) {
                    this.name = name;
                },

                log : function() {
                    console.log(this._makeMsg(arguments));
                },

                warn : function() {
                    console.warn(this._makeMsg(arguments));
                },

                error : function() {
                    console.error(this._makeMsg(arguments));
                },

                _makeMsg : function(args) {
                    return this.name ? this.name + " " +
                        format.apply(null, args) : format.apply(null, args);
                }
            });
    });