@bshg/validation
Version:
Validation Library for TypeScript projects
20 lines (19 loc) • 646 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.LOGGER = void 0;
const timestamp = () => new Date().toISOString();
const prefix = (level, tag) => `[${timestamp()}] [@bshg/validation] [${level}] [${tag}]`;
const info = (tag, log, ...data) => {
if (log)
console.log(prefix("INFO", tag), ...data);
};
const warn = (tag, log, ...data) => {
if (log)
console.warn(prefix("WARNING", tag), ...data);
};
const error = (tag, log, ...data) => {
if (log)
console.error(prefix("ERROR", tag), ...data);
};
exports.default = { info, warn, error };
exports.LOGGER = { info, warn, error };