Files
Checkmate/server/controllers/logController.js
Alex Holliday 7839e4c197 correct logging
2025-06-23 20:10:10 +08:00

24 lines
465 B
JavaScript

import { handleError } from "./controllerUtils.js";
const SERVICE_NAME = "JobQueueController";
class LogController {
constructor(logger) {
this.logger = logger;
}
getLogs = async (req, res, next) => {
try {
const logs = await this.logger.getLogs();
res.success({
msg: "Logs fetched successfully",
data: logs,
});
} catch (error) {
next(handleError(error, SERVICE_NAME, "getLogs"));
return;
}
};
}
export default LogController;