UNPKG

dt-crud-x

Version:

基于d2-crud-x的自定义版本

22 lines (20 loc) 499 B
let debug = () => {} function getCallerInfo () { const e = new Error() return e.stack.split('\n')[3] } if (process.env.NODE_ENV !== 'production') { if (process.env.VUE_APP_D2P_LOG_DEBUG === 'true') { debug = (...args) => { const callerInfo = getCallerInfo() if (process.env.VUE_APP_D2P_LOG_WITH_CALLER === 'true') { console.log('[debug]', ...args, '\n', callerInfo) } else { console.log('[debug]', ...args) } } } } export default { debug }