vue-cssgen
Version:
Инструмент для автоматизации работы со стилями в Vue 3-проектах
22 lines (16 loc) • 569 B
JavaScript
import config from './config.js';
function log(type, msg, context = '') {
if (type === 'info' && config.logLevel !== 'info') return;
const now = new Date().toISOString().replace('T', ' ').substr(0, 19);
console.log(`[${now}] [${type.toUpperCase()}]${context ? ' [' + context + ']' : ''} ${msg}`);
}
function warn(msg, context) {
log('warn', msg, context);
}
function error(msg, context) {
log('error', msg, context);
}
function info(msg, context) {
log('info', msg, context);
}
export default {log, warn, error, info};