Skip to content

Commit fd83d61

Browse files
committed
- add 'debug' method on RuntimeLogger
- update a warning message
1 parent 5a6b18e commit fd83d61

File tree

12 files changed

+253
-197
lines changed

12 files changed

+253
-197
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "system-runtime",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "Runtime, the System Runtime Environment",
55
"license": "MIT",
66
"homepage": "https://system-runtime.github.io",

build/system/system.js

Lines changed: 103 additions & 88 deletions
Large diffs are not rendered by default.

dist/system-runtime.js

Lines changed: 112 additions & 92 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/system-runtime.min.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "system-runtime",
3-
"version": "1.4.2",
3+
"version": "1.4.3",
44
"description": "Runtime, the System Runtime Environment",
55
"homepage": "https://system-runtime.github.io",
66
"keywords": [

src/log.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,18 @@ var ID = '_id',
5151
currentLevel = 'warn',
5252
loggerRef = null,
5353
fakeLoggerRef = {
54+
debug: function debug(message) {
55+
if (currentLevel === 'debug') {
56+
console.log('runtime: ' + message);
57+
}
58+
},
5459
info: function info(message) {
55-
if (currentLevel === 'info') {
60+
if (currentLevel === 'info' || currentLevel === 'debug') {
5661
console.info('runtime: ' + message);
5762
}
5863
},
5964
warn: function warning(message) {
60-
if (currentLevel === 'info' || currentLevel === 'warn') {
65+
if (currentLevel === 'info' || currentLevel === 'warn' || currentLevel === 'debug') {
6166
console.warn('runtime: ' + message);
6267
}
6368
},
@@ -245,7 +250,7 @@ function invalidTypeDefinition(name) {
245250
*/
246251
function invalidPropertyName(id, propertyName, propertyValue, type) {
247252
if (typeof type === 'string') {
248-
getLogger().warn("invalid type for property '" + propertyName + "' on component '" + id + "': expected '" + type + "' instead of '" + typeof propertyValue + "' on component '" + id + "'");
253+
getLogger().warn("invalid type for property '" + propertyName + "' on component '" + id + "': expected '" + type.replace('@', '') + "' instead of '" + typeof propertyValue + "' on component '" + id + "'");
249254
} else {
250255
getLogger().warn("invalid type for property type '" + propertyName + "' on component '" + id + "': expected 'string' instead of '" + typeof type + "' on component '" + id + "'");
251256
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"component": "RuntimeLogger",
3+
"state": "debug",
4+
"action": "function debug(message) {\n if (this.level() === 'debug') {\n console.log('runtime: ' + message);\n }\n}",
5+
"core": true
6+
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"component": "RuntimeLogger",
3-
"state": "info",
4-
"action": "function info(message) {\n if (this.level() === 'info') {\n console.info('runtime: ' + message);\n }\n}",
5-
"core": true
2+
"component": "RuntimeLogger",
3+
"state": "info",
4+
"action": "function info(message) {\n if (this.level() === 'info' || this.level() === 'debug') {\n console.info('runtime: ' + message);\n }\n}",
5+
"core": true
66
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"component": "RuntimeLogger",
3-
"state": "warn",
4-
"action": "function warn(message) {\n if (this.level() === 'info' || this.level() === 'warn') {\n console.warn('runtime: ' + message);\n } \n}",
5-
"core": true
2+
"component": "RuntimeLogger",
3+
"state": "warn",
4+
"action": "function warn(message) {\n if (this.level() === 'info' || this.level() === 'warn' || this.level() === 'debug') {\n console.warn('runtime: ' + message);\n } \n}",
5+
"core": true
66
}

src/system/models/RuntimeLogger.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
"mandatory": false,
88
"default": "warn"
99
},
10+
"debug": {
11+
"params": [
12+
{
13+
"name": "message",
14+
"type": "string"
15+
}
16+
]
17+
},
1018
"info": {
1119
"params": [
1220
{

0 commit comments

Comments
 (0)