Skip to content

Commit

Permalink
feat: add more server log
Browse files Browse the repository at this point in the history
  • Loading branch information
geekdada committed Oct 16, 2019
1 parent 7ea67b6 commit de77875
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
14 changes: 0 additions & 14 deletions .snyk

This file was deleted.

4 changes: 2 additions & 2 deletions lib/gateway/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function handler(request: FcRequest, response: FcResponse): void {
return;
}

console.log('[request] [%s] %s %s %s', clientIP, method, url, headers['user-agent'] || '-');
console.log('[request] [%s] %s %s "%s"', clientIP, method, url, headers['user-agent'] || '-');

server.getArtifact(artifactName)
.then(result => {
Expand Down Expand Up @@ -72,7 +72,7 @@ export async function nowHandler(req: NowRequest, res: NowResponse): Promise<voi
return;
}

console.log('[request] [%s] %s %s %s', clientIP, method, url, headers['user-agent'] || '-');
console.log('[request] [%s] %s %s "%s"', clientIP, method, url, headers['user-agent'] || '-');

server.getArtifact(artifactName)
.then(result => {
Expand Down
2 changes: 2 additions & 0 deletions lib/gateway/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export class Server {
`<h2>${err.name}: ${err.message}</h2>` +
`<pre>${err.stack}</pre>`
);
console.error(err);
}

public fcNotFound(response: FcResponse): void {
Expand All @@ -59,6 +60,7 @@ export class Server {
`<h2>${err.name}: ${err.message}</h2>` +
`<pre>${err.stack}</pre>`
);
console.error(err);
}

public nowNotFound(response: NowResponse): void {
Expand Down

0 comments on commit de77875

Please sign in to comment.