🔧 chore: create @manacore/shared-logger and migrate 2 mobile apps

- Create shared logger package with logger, perfLogger, networkLogger
- Support both __DEV__ (React Native) and NODE_ENV environments
- Migrate manadeck and picture mobile apps to use shared package

Savings: ~120 LOC (126 → 10 LOC in apps)
This commit is contained in:
Till-JS 2026-01-29 17:12:48 +01:00
parent 5663c3d3ce
commit 2d16f7c9ff
7 changed files with 254 additions and 129 deletions

View file

@ -16,7 +16,7 @@
| ~~**MITTEL**~~ | ~~Vite Configs~~ | ~~300 LOC~~**~350 LOC entfernt** | ~~Niedrig~~ |
| ~~**MITTEL**~~ | ~~Navigation Stores~~ | ~~50 LOC~~**~50 LOC entfernt** | ~~Niedrig~~ |
| ~~**NIEDRIG**~~ | ~~Drizzle Configs~~ | ~~200 LOC~~**~160 LOC entfernt** | ~~Niedrig~~ |
| **NIEDRIG** | Logger Utilities | 130 LOC | Niedrig |
| ~~**NIEDRIG**~~ | ~~Logger Utilities~~ | ~~130 LOC~~**~120 LOC entfernt** | ~~Niedrig~~ |
---
@ -393,16 +393,21 @@ export default createDrizzleConfig({ dbName: 'chat' });
## 5. Utility Functions
### 5.1 NIEDRIG: Logger Utilities (130 LOC)
### ~~5.1 NIEDRIG: Logger Utilities~~ ✅ ERLEDIGT (~120 LOC gespart)
**Problem:** 2 Mobile Apps haben eigene Logger:
- `apps/manadeck/apps/mobile/utils/logger.ts` (34 LOC)
- `apps/picture/apps/mobile/utils/logger.ts` (92 LOC - erweitert)
**Status:** `@manacore/shared-logger` Package erstellt und 2 Mobile Apps migriert (29.01.2026)
**Empfehlung:** Erstelle `@manacore/shared-logger` mit:
- `logger.debug/info/warn/error/success`
- `perfLogger.start/end`
- `networkLogger.request/response/error`
**Erstelltes Package:** `packages/shared-logger/`
- `logger.debug/info/warn/error/success/log` - Standard Logger
- `perfLogger.start/end` - Performance-Messung
- `networkLogger.request/response/error` - Netzwerk-Debugging
- Individuelle Exports für Rückwärtskompatibilität: `debug`, `info`, `warn`, `error`, `log`
**Migrierte Apps:**
- ✅ `apps/manadeck/apps/mobile/utils/logger.ts` (34 → 5 LOC)
- ✅ `apps/picture/apps/mobile/utils/logger.ts` (92 → 5 LOC)
**Einsparung:** ~120 LOC (126 → 10 LOC, Shared Package: 100 LOC reusable)
---