Logging Update
- Changed to uniform logging with the 'debug' module - Updated all apps
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
const mysqlHander = require("../mysqlHandler");
|
||||
const utils = require("../utils");
|
||||
// Debug
|
||||
const { DebugBuilder } = require("../utilities/debugBuilder.js");
|
||||
const log = new DebugBuilder("server", "nodesController");
|
||||
// Utilities
|
||||
const mysqlHander = require("../utilities/mysqlHandler");
|
||||
const utils = require("../utilities/utils");
|
||||
|
||||
exports.listAllNodes = async (req, res) => {
|
||||
mysqlHander.getAllNodes((allNodes) => {
|
||||
@@ -32,7 +36,7 @@ exports.newNode = async (req, res) => {
|
||||
if (err === "No name provided") {
|
||||
return res.sendStatus(400);
|
||||
}
|
||||
else console.log(err)
|
||||
else log.ERROR(err)
|
||||
return res.sendStatus(500);
|
||||
}
|
||||
}
|
||||
@@ -65,7 +69,7 @@ exports.nodeCheckIn = async (req, res) => {
|
||||
// If no changes are made tell the client
|
||||
if (Object.keys(nodeObject).length === 0) return res.status(200).json("No keys updated");
|
||||
|
||||
console.log("Updating the following keys for ID:", req.body.id, nodeObject);
|
||||
log.INFO("Updating the following keys for ID: ", req.body.id, nodeObject);
|
||||
// Adding the ID key to the body so that the client can double-check their ID
|
||||
nodeObject.id = req.body.id;
|
||||
mysqlHander.updateNodeInfo(nodeObject, () => {
|
||||
|
||||
Reference in New Issue
Block a user