Rocky_Mountain_Vending/.pnpm-store/v10/files/40/55ef8846e9793c18559faed7708e5c0c8ed566fce1f7b04b2001665c5c15d7b5db0b1a533cdf6b7bc58d72c6ac5737f060a353aa008dfbec15829a3204bdd4
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

80 lines
No EOL
2.5 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { bold, green, magenta, red, yellow, white } from '../../lib/picocolors';
import { LRUCache } from '../../server/lib/lru-cache';
export const prefixes = {
wait: white(bold('○')),
error: red(bold('')),
warn: yellow(bold('⚠')),
ready: '▲',
info: white(bold(' ')),
event: green(bold('✓')),
trace: magenta(bold('»'))
};
const LOGGING_METHOD = {
log: 'log',
warn: 'warn',
error: 'error'
};
function prefixedLog(prefixType, ...message) {
if ((message[0] === '' || message[0] === undefined) && message.length === 1) {
message.shift();
}
const consoleMethod = prefixType in LOGGING_METHOD ? LOGGING_METHOD[prefixType] : 'log';
const prefix = prefixes[prefixType];
// If there's no message, don't print the prefix but a new line
if (message.length === 0) {
console[consoleMethod]('');
} else {
// Ensure if there's ANSI escape codes it's concatenated into one string.
// Chrome DevTool can only handle color if it's in one string.
if (message.length === 1 && typeof message[0] === 'string') {
console[consoleMethod](' ' + prefix + ' ' + message[0]);
} else {
console[consoleMethod](' ' + prefix, ...message);
}
}
}
export function bootstrap(...message) {
// logging format: ' <prefix> <message>'
// e.g. ' ✓ Compiled successfully'
// Add spaces to align with the indent of other logs
console.log(' ' + message.join(' '));
}
export function wait(...message) {
prefixedLog('wait', ...message);
}
export function error(...message) {
prefixedLog('error', ...message);
}
export function warn(...message) {
prefixedLog('warn', ...message);
}
export function ready(...message) {
prefixedLog('ready', ...message);
}
export function info(...message) {
prefixedLog('info', ...message);
}
export function event(...message) {
prefixedLog('event', ...message);
}
export function trace(...message) {
prefixedLog('trace', ...message);
}
const warnOnceCache = new LRUCache(10000, (value)=>value.length);
export function warnOnce(...message) {
const key = message.join(' ');
if (!warnOnceCache.has(key)) {
warnOnceCache.set(key, key);
warn(...message);
}
}
const errorOnceCache = new LRUCache(10000, (value)=>value.length);
export function errorOnce(...message) {
const key = message.join(' ');
if (!errorOnceCache.has(key)) {
errorOnceCache.set(key, key);
error(...message);
}
}
//# sourceMappingURL=log.js.map