Skip to content

Commit

Permalink
feat: overhaul logger
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanMorel committed Oct 27, 2023
1 parent 6800bb4 commit dd2c6ea
Show file tree
Hide file tree
Showing 7 changed files with 314 additions and 69 deletions.
4 changes: 2 additions & 2 deletions app/sharex/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Config from "@/src/Config";
import { default as ServerConfig } from "@/src/helpers/Config";
import { Logger } from "@/src/helpers/server/Logger";
import logger from "@/src/helpers/server/Logger";
import { compareStrings, getRandomFilename } from "@/src/helpers/server/StringHelper";
import { promises as fs } from "fs";

Expand Down Expand Up @@ -41,7 +41,7 @@ export async function POST(request: Request): Promise<Response> {

await fs.writeFile(path, data);

Logger.log(`Uploaded ${file.name} as ${filename}.${extension} from ShareX successfully`);
logger.log(`Uploaded ${file.name} as ${filename}.${extension} from ShareX successfully`);

const result = {
link: `${Config.app.url}/${path}`
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,13 @@
"mime-types": "^2.1.35",
"next": "^13.5.6",
"nextjs-google-analytics": "^2.3.3",
"picocolors": "^1.0.0",
"pino": "^8.16.1",
"pino-pretty": "^10.2.3",
"postcss": "^8.4.31",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"rotating-file-stream": "^3.1.1",
"sharp": "^0.32.6",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",
Expand Down
Loading

0 comments on commit dd2c6ea

Please sign in to comment.