traceperf
Version:
High-performance function execution tracking and monitoring for Node.js
106 lines âĸ 2.19 kB
JavaScript
/**
* Default configuration for the logger
*/
export const DEFAULT_CONFIG = {
mode: 'dev',
level: 'debug',
colorize: true,
timestamp: true,
performanceThreshold: 100, // ms
indentSize: 2,
};
/**
* Log level priorities (higher number = higher priority)
*/
export const LOG_LEVEL_PRIORITY = {
debug: 0,
info: 1,
warn: 2,
error: 3,
};
/**
* Minimum log level for each mode
*/
export const MODE_MIN_LEVELS = {
dev: 'debug', // In dev mode, show all logs
staging: 'warn', // In staging, show only warnings and errors
prod: 'error', // In prod, show only errors
};
/**
* ANSI color codes for terminal output
*/
export const COLORS = {
reset: '\x1b[0m',
bright: '\x1b[1m',
dim: '\x1b[2m',
underscore: '\x1b[4m',
// Foreground colors
fg: {
black: '\x1b[30m',
red: '\x1b[31m',
green: '\x1b[32m',
yellow: '\x1b[33m',
blue: '\x1b[34m',
magenta: '\x1b[35m',
cyan: '\x1b[36m',
white: '\x1b[37m',
gray: '\x1b[90m',
},
// Background colors
bg: {
black: '\x1b[40m',
red: '\x1b[41m',
green: '\x1b[42m',
yellow: '\x1b[43m',
blue: '\x1b[44m',
magenta: '\x1b[45m',
cyan: '\x1b[46m',
white: '\x1b[47m',
},
};
/**
* Log level colors
*/
export const LEVEL_COLORS = {
debug: COLORS.fg.gray,
info: COLORS.fg.blue,
warn: COLORS.fg.yellow,
error: COLORS.fg.red,
};
/**
* Log level icons
*/
export const LEVEL_ICONS = {
debug: 'đ',
info: 'âšī¸',
warn: 'â ī¸',
error: 'â',
};
/**
* Box drawing characters for ASCII flow charts
*/
export const BOX_CHARS = {
topLeft: 'â',
topRight: 'â',
bottomLeft: 'â',
bottomRight: 'â',
horizontal: 'â',
vertical: 'â',
verticalRight: 'â',
verticalLeft: 'â¤',
horizontalDown: 'âŦ',
horizontalUp: 'â´',
cross: 'âŧ',
downArrow: 'âŧ',
};
/**
* Performance icons
*/
export const PERFORMANCE_ICONS = {
timer: 'âą',
slow: 'â ī¸',
memory: 'đ',
bottleneck: 'đ',
fix: 'đ ',
};
//# sourceMappingURL=constants.js.map