feat(#27): Set up consola logger, make use of log levels in backend and frontend
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { HTTPMethod } from 'h3'
|
||||
import { useLogger } from '../composables/useLogger'
|
||||
|
||||
// Custom OpenAPI fetch client that wraps useRequestFetch. This ensures that authentication headers
|
||||
// are forwarded correctly during SSR. Unlike fetch, useRequestFetch returns data directly,
|
||||
@@ -28,7 +29,8 @@ export const wrappedFetchWrap = (requestFetch: ReturnType<typeof useRequestFetch
|
||||
}
|
||||
})
|
||||
} catch (error: unknown) {
|
||||
console.error('Fetch error:', error)
|
||||
const logger = useLogger().withTag('wrappedFetch')
|
||||
logger.error('Fetch error:', error)
|
||||
|
||||
// Check if it's a FetchError from ofetch
|
||||
if (error && typeof error === 'object' && 'status' in error) {
|
||||
|
||||
Reference in New Issue
Block a user