Skip to content

Commit

Permalink
fix: move log to prevent spam in dev (#361)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusmarminge authored Sep 16, 2023
1 parent 5b30be2 commit 4f6949d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-hornets-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"uploadthing": patch
---

fix: move dev-log into function scope to prevent spam
8 changes: 4 additions & 4 deletions packages/uploadthing/src/internal/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ const fileCountLimitHit = (
return { limitHit: false };
};

if (process.env.NODE_ENV === "development") {
console.log("[UT] UploadThing dev server is now running!");
}

const isValidResponse = (response: Response) => {
if (!response.ok) return false;
if (response.status >= 400) return false;
Expand Down Expand Up @@ -167,6 +163,10 @@ export const buildRequestHandler = <
}): Promise<
UploadThingError | { status: 200; body?: UploadThingResponse }
> => {
if (process.env.NODE_ENV === "development") {
console.log("[UT] UploadThing dev server is now running!");
}

const { req, res } = input;
const { router, config } = opts;
const preferredOrEnvSecret =
Expand Down

1 comment on commit 4f6949d

@vercel
Copy link

@vercel vercel bot commented on 4f6949d Sep 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.