3
|
1 define(["dojo/_base/declare", "../text/format"], function (declare, format) {
|
|
2 return declare(null, {
|
|
3 name: null,
|
0
|
4
|
3
|
5 constructor: function (name) {
|
|
6 this.name = name;
|
|
7 },
|
|
8
|
|
9 log: function () {
|
|
10 console.log(this._makeMsg(arguments));
|
|
11 },
|
0
|
12
|
3
|
13 warn: function () {
|
|
14 console.warn(this._makeMsg(arguments));
|
|
15 },
|
0
|
16
|
3
|
17 error: function () {
|
|
18 console.error(this._makeMsg(arguments));
|
|
19 },
|
0
|
20
|
3
|
21 _makeMsg: function (args) {
|
|
22 return this.name ? this.name + " " +
|
|
23 format.apply(null, args) : format.apply(null, args);
|
|
24 }
|
|
25 });
|
|
26 }); |