diff options
| author | iv-ar <i@oiee.no> | 2023-03-04 16:54:16 +0100 |
|---|---|---|
| committer | iv-ar <i@oiee.no> | 2023-03-04 16:54:16 +0100 |
| commit | cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad (patch) | |
| tree | 8103d953afec0618a55dc957ba8a3222dac0e842 /code/app/src/routes/(main)/+layout.server.ts | |
| parent | b85164718d3bd6a4ad5fc06d04a3ce2dc028b1db (diff) | |
| download | greatoffice-cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad.tar.xz greatoffice-cf546fd4b9a1fbf77bccf5f0b713e688d29a66ad.zip | |
feat: Use console to log
Diffstat (limited to 'code/app/src/routes/(main)/+layout.server.ts')
| -rw-r--r-- | code/app/src/routes/(main)/+layout.server.ts | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/code/app/src/routes/(main)/+layout.server.ts b/code/app/src/routes/(main)/+layout.server.ts index 25043aa..0670dd6 100644 --- a/code/app/src/routes/(main)/+layout.server.ts +++ b/code/app/src/routes/(main)/+layout.server.ts @@ -1,11 +1,10 @@ -import { api_base, CookieNames } from "$configuration"; -import { cached_result_async, CacheKeys } from "$utilities/cache"; -import { log_debug, log_error } from "$utilities/logger"; -import { get_md5_hash } from "$utilities/crypto-helpers"; -import { error, redirect } from "@sveltejs/kit"; -import type { LayoutServerLoad } from "./$types"; +import {api_base, CookieNames} from "$configuration"; +import {cached_result_async, CacheKeys} from "$utilities/cache"; +import {get_md5_hash} from "$utilities/crypto-helpers"; +import {error, redirect} from "@sveltejs/kit"; +import type {LayoutServerLoad} from "./$types"; -export const load: LayoutServerLoad = async ({ route, cookies, locals, fetch }) => { +export const load: LayoutServerLoad = async ({route, cookies, locals, fetch}) => { const isBaseRoute = route.id === "/(main)"; const isPortalRoute = route.id === "/(main)/(public)/portal"; const isPublicRoute = (isBaseRoute || (route.id?.startsWith("/(main)/(public)") ?? false)) ?? true; @@ -18,14 +17,14 @@ export const load: LayoutServerLoad = async ({ route, cookies, locals, fetch }) Cookie: CookieNames.session + "=" + sessionCookieValue, }, }).catch((e) => { - log_error(e); + console.error(e); throw error(503, { message: "We are experiencing a service disruption! Have patience while we resolve the issue.", }); }))).ok; } - log_debug("Base Layout loaded", { + console.debug("Base Layout loaded", { sessionIsValid, isPublicRoute, isBaseRoute, |
