monkeytype/backend/handlers/logger.js
Bruce Berrios 5beb1bf619
Update Configuration to handle arrays/ Add new db client (#2395)
* Update Configuration to handle arrays

* Add new db client

* Add comment
2022-02-02 19:26:43 +01:00

17 lines
325 B
JavaScript

const db = require("../init/db");
async function log(event, message, uid) {
const logsCollection = db.collection("logs");
console.log(new Date(), "\t", event, "\t", uid, "\t", message);
await logsCollection.insertOne({
timestamp: Date.now(),
uid,
event,
message,
});
}
module.exports = {
log,
};