mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-17 03:59:40 +02:00
- Add uload project with apps/web structure
- Reorganize from flat to monorepo structure
- Remove PocketBase binary and local data
- Update to pnpm and @uload/web namespace
- Add picture project to monorepo
- Remove embedded git repository
- Unify all package names to @{project}/{app} schema:
- @maerchenzauber/* (was @storyteller/*)
- @manacore/* (was manacore-*, manacore)
- @manadeck/* (was web, backend, manadeck)
- @memoro/* (was memoro-web, landing, memoro)
- @picture/* (already unified)
- @uload/web
- Add convenient dev scripts for all apps:
- pnpm dev:{project}:web
- pnpm dev:{project}:landing
- pnpm dev:{project}:mobile
- pnpm dev:{project}:backend
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
91 lines
1.8 KiB
TypeScript
91 lines
1.8 KiB
TypeScript
/**
|
|
* Centralized logging utility
|
|
* - Development: Logs to console
|
|
* - Production: Can be integrated with Sentry, LogRocket, etc.
|
|
*/
|
|
|
|
const isDevelopment = __DEV__;
|
|
|
|
export const logger = {
|
|
/**
|
|
* Log debug information (only in development)
|
|
*/
|
|
debug: (...args: any[]) => {
|
|
if (isDevelopment) {
|
|
console.log('[DEBUG]', ...args);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Log general information
|
|
*/
|
|
info: (...args: any[]) => {
|
|
if (isDevelopment) {
|
|
console.log('[INFO]', ...args);
|
|
}
|
|
},
|
|
|
|
/**
|
|
* Log warnings (always logged)
|
|
*/
|
|
warn: (...args: any[]) => {
|
|
console.warn('[WARN]', ...args);
|
|
// TODO: Send to error tracking service in production
|
|
},
|
|
|
|
/**
|
|
* Log errors (always logged)
|
|
*/
|
|
error: (...args: any[]) => {
|
|
console.error('[ERROR]', ...args);
|
|
// TODO: Send to error tracking service (Sentry, etc.)
|
|
},
|
|
|
|
/**
|
|
* Log success messages (only in development)
|
|
*/
|
|
success: (...args: any[]) => {
|
|
if (isDevelopment) {
|
|
console.log('[SUCCESS] ✅', ...args);
|
|
}
|
|
},
|
|
};
|
|
|
|
/**
|
|
* Performance logger for measuring execution time
|
|
*/
|
|
export const perfLogger = {
|
|
start: (label: string) => {
|
|
if (isDevelopment) {
|
|
console.time(label);
|
|
}
|
|
},
|
|
|
|
end: (label: string) => {
|
|
if (isDevelopment) {
|
|
console.timeEnd(label);
|
|
}
|
|
},
|
|
};
|
|
|
|
/**
|
|
* Network request logger
|
|
*/
|
|
export const networkLogger = {
|
|
request: (url: string, method: string, body?: any) => {
|
|
if (isDevelopment) {
|
|
console.log(`[NETWORK] ${method} ${url}`, body ? { body } : '');
|
|
}
|
|
},
|
|
|
|
response: (url: string, status: number, data?: any) => {
|
|
if (isDevelopment) {
|
|
console.log(`[NETWORK] Response ${status} from ${url}`, data ? { data } : '');
|
|
}
|
|
},
|
|
|
|
error: (url: string, error: any) => {
|
|
console.error(`[NETWORK] Error from ${url}`, error);
|
|
// TODO: Send to error tracking
|
|
},
|
|
};
|