Skip to content

Commit 8f98ad7

Browse files
committed
feat: allow silencing the console ouput
closes #99
1 parent 632bd80 commit 8f98ad7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Diff for: platform/nativescript/util/index.js

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
import { makeMap } from 'shared/util'
1+
import { makeMap, once } from 'shared/util'
22
import { isKnownView, getViewMeta } from '../element-registry'
3+
import Vue from '../framework'
34

45
export const isReservedTag = makeMap('template', true)
56

@@ -34,7 +35,17 @@ export function query(el, renderer, document) {
3435
export const VUE_VERSION = process.env.VUE_VERSION
3536
export const NS_VUE_VERSION = process.env.NS_VUE_VERSION
3637

38+
const infoTrace = once(() => {
39+
console.log(
40+
`NativeScript-Vue has "Vue.config.silent" set to true, to see output logs set it to false.`
41+
)
42+
})
43+
3744
export function trace(message) {
45+
if (Vue.config.silent) {
46+
return infoTrace()
47+
}
48+
3849
console.log(
3950
`{NSVue (Vue: ${VUE_VERSION} | NSVue: ${NS_VUE_VERSION})} -> ${message}`
4051
)

0 commit comments

Comments
 (0)