mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 04:51:16 +08:00
5beb1bf619
* Update Configuration to handle arrays * Add new db client * Add comment
17 lines
325 B
JavaScript
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,
|
|
};
|