Skip to content

Commit 2e1fc05

Browse files
committed
feat: integrate pino for structured logging and add logger utility
- Added pino and pino-pretty to package.json for logging. - Created a logger utility in src/utils/logger.ts to handle logging configurations for production and development environments. - Replaced console.log and console.error statements with logger methods in various service files (leetcode-cn-service.ts, leetcode-global-service.ts). - Updated tests to use logger for logging messages instead of console.log. - Improved error handling in services by removing try-catch blocks where appropriate and using promises directly.
1 parent 9ea4dc4 commit 2e1fc05

File tree

8 files changed

+717
-687
lines changed

8 files changed

+717
-687
lines changed

package-lock.json

Lines changed: 227 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"@modelcontextprotocol/sdk": "^1.8.0",
4646
"leetcode-query": "^2.0.0",
4747
"minimist": "^1.2.8",
48+
"pino": "^9.6.0",
4849
"ts-node": "^10.9.2",
4950
"zod": "^3.24.2"
5051
},
@@ -64,7 +65,8 @@
6465
"tsc-watch": "6.2.1",
6566
"typescript": "^5.8.3",
6667
"typescript-eslint": "^8.29.1",
67-
"vitest": "^3.1.1"
68+
"vitest": "^3.1.1",
69+
"pino-pretty": "^13.0.0"
6870
},
6971
"optionalDependencies": {
7072
"@rollup/rollup-linux-x64-gnu": "^4.40.0"

0 commit comments

Comments
 (0)