Commit fea29a7c authored by Yechang's avatar Yechang
Browse files

feat(log): replace console.log

parent e7e21953
Loading
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -90,7 +90,6 @@ export function setHours(date: ZonedDateTime, value: string) {
export function setMinutes(date: ZonedDateTime, value: string) {
	const minutes = getValidMinuteOrSecond(value);
	date = date.set({ minute: parseInt(minutes, 10) });
	console.log('set', date, parseInt(minutes, 10));
	return date;
}
export function setSeconds(date: ZonedDateTime, value: string) {
+4 −3
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ import { db } from '$lib/server/db';
import _ from 'lodash';
import { lucia } from '$lib/server/auth';
import type { LuciaUser } from '@prisma/client';
import { log } from '$lib/server/log';

const sustechUserSchema = z.object({
	sub: z.string(),
@@ -39,7 +40,7 @@ export async function GET(event: RequestEvent): Promise<Response> {
			}
		});
		const userData = sustechUserSchema.parse(await userResponse.json());
		console.log(userData);
		log.info(userData);

		const user = await db.user.findFirst({
			where: {
@@ -96,11 +97,11 @@ export async function GET(event: RequestEvent): Promise<Response> {
			}
		});
	} catch (e) {
		console.log(e);
		log.error(e);
		// the specific error message depends on the provider
		if (e instanceof OAuth2RequestError) {
			// invalid code
			console.log(e.request.url);
			log.error(e.request.url);
			return new Response(null, {
				status: 400
			});
+3 −2
Original line number Diff line number Diff line
import { db } from "$lib/server/db"
import { log } from "$lib/server/log"
import { redis } from "$lib/server/redis"
import { signDownloadRequest } from "$lib/server/storage/index.js"
import { signDownloadRequest } from "$lib/server/storage"
import { error, json } from "@sveltejs/kit"
import _ from "lodash"

@@ -28,7 +29,7 @@ export const GET = async ({ request }) => {
    if (_.isNil(task)) {
        error(404)
    }
    console.log(task)
    log.info(task)

    const { language, fileKey, testdataKey, args } = task
    return json({
+0 −1
Original line number Diff line number Diff line
@@ -12,7 +12,6 @@ import _ from 'lodash';
export const load: ServerLoad = async ({ params, locals, parent }) => {
	const { user } = locals;
	if (_.isNil(user)) {
		console.log('no user');
		redirect(302, '/login');
	}