feat: use logger

This commit is contained in:
2023-08-05 22:16:14 +02:00
parent 46cd823b6c
commit 32a7f89309
15 changed files with 99 additions and 37 deletions

View File

@ -2,6 +2,7 @@ import { HandlerContext } from "$fresh/server.ts";
import { getMovieCredits } from "@lib/tmdb.ts";
import * as cache from "@lib/cache/cache.ts";
import { json } from "@lib/helpers.ts";
import { createLogger } from "@lib/log.ts";
type CachedMovieCredits = {
lastUpdated: number;
@ -10,6 +11,8 @@ type CachedMovieCredits = {
const CACHE_INTERVAL = 1000 * 60 * 24 * 30;
const log = createLogger("api/tmdb");
export const handler = async (
_req: Request,
_ctx: HandlerContext,
@ -22,7 +25,7 @@ export const handler = async (
});
}
console.log("[api] getting movie credits");
log.debug("getting movie credits");
const cacheId = `/movie/credits/${id}`;