Skip to content

feat: Centralize logging configuration across backend modules#45

Open
alisoliman wants to merge 7 commits intomainfrom
feat/centralize-logging
Open

feat: Centralize logging configuration across backend modules#45
alisoliman wants to merge 7 commits intomainfrom
feat/centralize-logging

Conversation

@alisoliman
Copy link
Contributor

Summary

  • Centralizes logging configuration to a single module (logging_config.py)
  • Adds LOG_LEVEL environment variable for runtime log level control
  • Removes scattered basicConfig() calls that caused unpredictable behavior

Problem

The backend had logging.basicConfig() scattered across 8 different modules. Since basicConfig() only takes effect on the first call, the actual logging configuration depended on module import order—an unpredictable and fragile pattern.

Additionally:

  • Error handling in gallery.py used print() instead of proper logging
  • Some functions redundantly re-imported logging inside function bodies

Changes

File Change
backend/core/config.py Add LOG_LEVEL: str = "INFO" setting
backend/core/logging_config.py NEW - setup_logging() function
backend/main.py Call setup_logging() at startup
backend/core/*.py (5 files) Remove basicConfig() calls
backend/api/endpoints/*.py (3 files) Remove basicConfig(), fix anti-patterns

Log Format

2026-02-01 00:29:54,000 - module.name - INFO - Message here

Usage

# Default INFO level
python -m backend.main

# Enable debug logging
LOG_LEVEL=DEBUG python -m backend.main

Testing

Verified that:

  • Default INFO level works (DEBUG messages suppressed)
  • LOG_LEVEL=DEBUG enables debug messages
  • Azure SDK verbose logging is suppressed at INFO level
  • Log format includes timestamp, logger name, level, and message

alisoliman and others added 7 commits February 1, 2026 00:33
- Add LOG_LEVEL setting to config.py for environment-based log level control
- Create logging_config.py with setup_logging() for single-point configuration
- Call setup_logging() early in main.py before other imports
- Remove scattered basicConfig() calls from 8 modules
- Replace print() with logger.error() in gallery.py error handler
- Remove redundant function-level logging imports

This ensures consistent log format and predictable behavior regardless
of module import order. Log level can be controlled via LOG_LEVEL env var.
- Replace color system with pure B/W + single red accent (#FF0000)
- Swap fonts to Bebas Neue (display) + Source Sans 3 (body)
- Set all border-radius to 0px for sharp, architectural edges
- Apply uppercase + wide letter-spacing to all headings/labels
- Increase whitespace and spacing throughout (8rem+ gaps)
- Oversized typography with clamp() and font-weight 900
- Dramatic 404 page with massive type
- Bold minimal login page
- Clean card overlays with no rounded corners
- Tighter grid gaps for gallery views
- Updated sidebar with bold section labels and border accents
- Dark mode: deep black (#0A0A0A) with white text

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The Red Thread — a signature 2px red accent line (#E40010) that
weaves through the entire interface as the single memorable element:
- Slides under active page headers and sidebar brand
- Draws across hover states on gallery cards (bottom edge)
- Climbs vertically on stat cards on hover
- Appears as a divider on login and empty states

Atmosphere & texture:
- Film grain overlay via SVG noise filter (body::after)
- Red text selection color across the entire app
- Red focus rings for keyboard navigation
- Refined color palette with warmer neutrals

Motion & reveals:
- Custom @Keyframes: reveal-up, fade-in, line-draw
- Stagger delay classes (.stagger-1 through .stagger-6)
- Dramatic 404 page with layered animations
- Login page with sequenced entrance (title → red line → subtitle → form)
- Refined page transitions with cubic-bezier(0.22, 1, 0.36, 1)

Typography refinements:
- Tighter heading line-height (0.9) for dramatic stacking
- Wider letter-spacing on labels (0.2em+)
- 404 scaled up to clamp(10rem, 30vw, 24rem)
- Stat numbers at text-5xl with -0.05em tracking

Editorial details:
- Settings tabs restyled as underlined editorial navigation
- Theme toggle icon turns red on hover
- Gallery card hover: border goes foreground + red bottom line
- Login card border thickens on hover (2px → foreground)
- prefers-reduced-motion fully respected

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…dule

Add IMAGEGEN_15_DEPLOYMENT and IMAGEGEN_1_MINI_DEPLOYMENT params to
containerApp.bicep and pass them as env vars. Remove unnecessary
dependsOn entries that Bicep infers from output references.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Reverts commits b649eab and dabd05a per user request.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Replace RowBasedMasonryGrid with Aceternity UI's LayoutGrid component
for the image gallery. Cards animate on click with Framer Motion layout
transitions. Existing interactions (delete, move, detail view) preserved.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant