8000 fix: don't color console output unless Vue.config.debug is true · rubythonode/nativescript-vue@14e5ed4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 14e5ed4

Browse files
committed
fix: don't color console output unless Vue.config.debug is true
1 parent 472ebd7 commit 14e5ed4

File tree

1 file changed

+16
-17
lines changed

1 file changed

+16
-17
lines changed

platform/nativescript/framework.js

+16Lines changed: 16 additions & 17 deletions
4B96
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,9 @@
1-
import inspect from 'util-inspect'
2-
3-
console.log = (function(log, inspect) {
4-
return function() {
5-
return log.apply(
6-
this,
7-
Array.prototype.map.call(arguments, function(arg) {
8-
return inspect(arg, { depth: 1, colors: true })
9-
})
10-
)
11-
}
12-
})(console.log, inspect)
13-
14-
console.keys = function(object) {
15-
console.log(Object.keys(object))
16-
}
17-
181
// This is required because some of the third party plugins rely on this
192
// and cause errors since there is no process variable in {N}.
203
global.process = global.process || {}
214
global.process.env = global.process.env || {}
225

6+
import inspect from 'util-inspect'
237
import Vue from './runtime/index'
248
import ModalPlugin from './plugins/modal-plugin'
259
import NavigatorPlugin from './plugins/navigator-plugin'
@@ -31,4 +15,19 @@ Vue.use(NavigatorPlugin)
3115
// Vue.use(DecoderPlugin)
3216
Vue.use(RouterPlugin)
3317

18+
console.log = (function(log, inspect, Vue) {
19+
return function() {
20+
return log.apply(
21+
this,
22+
Array.prototype.map.call(arguments, function(arg) {
23+
return inspect(arg, { depth: 1, colors: Vue.config.debug })
24+
})
25+
)
26+
}
27+
})(console.log, inspect, Vue)
28+
29+
console.keys = function(object) {
30+
console.log(Object.keys(object))
31+
}
32+
3433
export default Vue

0 commit comments

Comments
 (0)
0