mirror of
https://github.com/kikootwo/ReadMeABook.git
synced 2026-06-03 21:00:09 +00:00
Implement centralized logging with RMABLogger
Replaces scattered console statements with a unified RMABLogger across backend API routes and services. Adds LOG_LEVEL-based filtering, job-aware database persistence, and context-based logging. Updates documentation to describe the new logging system and usage patterns. Also documents qBittorrent CSRF header fix
This commit is contained in:
@@ -7,6 +7,9 @@ import { NextRequest, NextResponse } from 'next/server';
|
||||
import { getAudibleService } from '@/lib/integrations/audible.service';
|
||||
import { enrichAudiobooksWithMatches } from '@/lib/utils/audiobook-matcher';
|
||||
import { getCurrentUser } from '@/lib/middleware/auth';
|
||||
import { RMABLogger } from '@/lib/utils/logger';
|
||||
|
||||
const logger = RMABLogger.create('API.Audiobooks.Search');
|
||||
|
||||
/**
|
||||
* GET /api/audiobooks/search?q=query&page=1
|
||||
@@ -47,7 +50,7 @@ export async function GET(request: NextRequest) {
|
||||
hasMore: results.hasMore,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('Failed to search audiobooks:', error);
|
||||
logger.error('Failed to search audiobooks', { error: error instanceof Error ? error.message : String(error) });
|
||||
return NextResponse.json(
|
||||
{
|
||||
error: 'SearchError',
|
||||
|
||||
Reference in New Issue
Block a user