Skip to content

Commit 5a609d7

Browse files
author
jiangpeiling
committed
♻️ Refactor: cleanup console log.
1 parent 956f598 commit 5a609d7

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

docker/volumes/functions/main/index.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { serve } from 'https://deno.land/[email protected]/http/server.ts'
22
import * as jose from 'https://deno.land/x/[email protected]/index.ts'
3-
import log from "../../../../frontend/utils/logger";
43

5-
log.log('main function started')
4+
console.log('main function started')
65

76
const JWT_SECRET = Deno.env.get('JWT_SECRET')
87
const VERIFY_JWT = Deno.env.get('VERIFY_JWT') === 'true'
@@ -25,7 +24,7 @@ async function verifyJWT(jwt: string): Promise<boolean> {
2524
try {
2625
await jose.jwtVerify(jwt, secretKey)
2726
} catch (err) {
28-
log.error(err)
27+
console.error(err)
2928
return false
3029
}
3130
return true
@@ -44,7 +43,7 @@ serve(async (req: Request) => {
4443
})
4544
}
4645
} catch (e) {
47-
log.error(e)
46+
console.error(e)
4847
return new Response(JSON.stringify({ msg: e.toString() }), {
4948
status: 401,
5049
headers: { 'Content-Type': 'application/json' },
@@ -66,7 +65,7 @@ serve(async (req: Request) => {
6665
}
6766

6867
const servicePath = `/home/deno/functions/${service_name}`
69-
log.error(`serving the request with ${servicePath}`)
68+
console.error(`serving the request with ${servicePath}`)
7069

7170
const memoryLimitMb = 150
7271
const workerTimeoutMs = 1 * 60 * 1000

0 commit comments

Comments
 (0)