feat: Add stack trace utility and enhance logging across various modules

This commit is contained in:
2024-12-31 15:14:30 +08:00
parent 5131515770
commit 730b673954
15 changed files with 311 additions and 54 deletions

View File

@@ -14,6 +14,9 @@ import { User, UserPermission } from "../../db.ts";
import { toJSON } from "../../utils.ts";
import { ImportConfig } from "../../tasks/import.ts";
import { UpdateTagTranslationConfig } from "../../tasks/update_tag_translation.ts";
import { base_logger } from "../../utils/logger.ts";
const logger = base_logger.get_logger("api-task");
export const handler: Handlers = {
GET(req, ctx) {
@@ -61,7 +64,7 @@ export const handler: Handlers = {
socket.onerror = () => {
removeListener();
clearInterval(interval);
console.error("WebSocket error.");
logger.error("WebSocket error.");
};
socket.onmessage = (e) => {
try {