feat(#27): Set up consola logger, make use of log levels in backend and frontend

This commit is contained in:
2025-12-24 10:26:22 +01:00
parent 805c66bc4f
commit 7f7852a66a
36 changed files with 312 additions and 141 deletions

View File

@@ -1,8 +1,11 @@
import { useLogger } from './useLogger'
export const isServerAvailable = ref(true)
export const isChecking = ref(false)
export const lastCheckTime = ref<Date | null>(null)
export function useServerHealth() {
const logger = useLogger().withTag('serverHealth')
const checkInterval = ref<ReturnType<typeof setInterval> | null>(null)
const healthCheckUrl = '/api/actuator/health'
@@ -30,11 +33,11 @@ export function useServerHealth() {
isServerAvailable.value = response.ok
if (!wasAvailable && isServerAvailable.value) {
console.info('Server is back online')
logger.info('Server is back online')
}
if (wasAvailable && !isServerAvailable.value) {
console.warn('Server is no longer available')
logger.warn('Server is no longer available')
}
return isServerAvailable.value
@@ -43,7 +46,7 @@ export function useServerHealth() {
isServerAvailable.value = false
if (wasAvailable) {
console.warn('Server health check failed:', error)
logger.warn('Server health check failed:', error)
}
return false