annotate src/implab/components/ConsoleLogChannel.js @ 5:3d124d0b9078

improved declare/override, added override.before, override.after, override.hide, inherited.arguments.
author cin
date Fri, 16 Jun 2017 02:14:25 +0300
parents 00779cb63b12
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
00779cb63b12 formatting
cin
parents: 1
diff changeset
1 define(["dojo/_base/declare", "../text/format"], function (declare, format) {
00779cb63b12 formatting
cin
parents: 1
diff changeset
2 return declare(null, {
00779cb63b12 formatting
cin
parents: 1
diff changeset
3 name: null,
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
4
3
00779cb63b12 formatting
cin
parents: 1
diff changeset
5 constructor: function (name) {
00779cb63b12 formatting
cin
parents: 1
diff changeset
6 this.name = name;
00779cb63b12 formatting
cin
parents: 1
diff changeset
7 },
00779cb63b12 formatting
cin
parents: 1
diff changeset
8
00779cb63b12 formatting
cin
parents: 1
diff changeset
9 log: function () {
00779cb63b12 formatting
cin
parents: 1
diff changeset
10 console.log(this._makeMsg(arguments));
00779cb63b12 formatting
cin
parents: 1
diff changeset
11 },
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
12
3
00779cb63b12 formatting
cin
parents: 1
diff changeset
13 warn: function () {
00779cb63b12 formatting
cin
parents: 1
diff changeset
14 console.warn(this._makeMsg(arguments));
00779cb63b12 formatting
cin
parents: 1
diff changeset
15 },
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
16
3
00779cb63b12 formatting
cin
parents: 1
diff changeset
17 error: function () {
00779cb63b12 formatting
cin
parents: 1
diff changeset
18 console.error(this._makeMsg(arguments));
00779cb63b12 formatting
cin
parents: 1
diff changeset
19 },
0
fc2517695ee1 Initial commit, draft import of existing work
cin
parents:
diff changeset
20
3
00779cb63b12 formatting
cin
parents: 1
diff changeset
21 _makeMsg: function (args) {
00779cb63b12 formatting
cin
parents: 1
diff changeset
22 return this.name ? this.name + " " +
00779cb63b12 formatting
cin
parents: 1
diff changeset
23 format.apply(null, args) : format.apply(null, args);
00779cb63b12 formatting
cin
parents: 1
diff changeset
24 }
00779cb63b12 formatting
cin
parents: 1
diff changeset
25 });
00779cb63b12 formatting
cin
parents: 1
diff changeset
26 });