| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- var config = require('../config')
- /**
- * Enable debug utilities. The enableDebug() function and
- * all _.log() & _.warn() calls will be dropped in the
- * minified production build.
- */
- enableDebug()
- function enableDebug () {
- var hasConsole = typeof console !== 'undefined'
-
- /**
- * Log a message.
- *
- * @param {String} msg
- */
- exports.log = function (msg) {
- if (hasConsole && config.debug) {
- console.log('[Vue info]: ' + msg)
- }
- }
- /**
- * We've got a problem here.
- *
- * @param {String} msg
- */
- exports.warn = function (msg) {
- if (hasConsole && !config.silent) {
- console.warn('[Vue warn]: ' + msg)
- if (config.debug && console.trace) {
- console.trace()
- }
- }
- }
- /**
- * Assert asset exists
- */
- exports.assertAsset = function (val, type, id) {
- if (!val) {
- exports.warn('Failed to resolve ' + type + ': ' + id)
- }
- }
- }
|