/** * Enable debug utilities. */ if (process.env.NODE_ENV !== 'production') { var config = require('../config') 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, e) { if (hasConsole && (!config.silent || config.debug)) { console.warn('[Vue warn]: ' + msg) /* istanbul ignore if */ if (config.debug) { console.warn((e || new Error('Warning Stack Trace')).stack) } } } /** * Assert asset exists */ exports.assertAsset = function (val, type, id) { if (!val) { exports.warn('Failed to resolve ' + type + ': ' + id) } } }