mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2024-11-14 19:46:29 +08:00
b3f2aa544c
updating test leaderboards every 5 minutes
15 lines
304 B
JavaScript
15 lines
304 B
JavaScript
const { mongoDB } = require("../init/mongodb");
|
|
|
|
async function log(event, message, uid) {
|
|
console.log(new Date(), "\t", event, "\t", uid, "\t", message);
|
|
await mongoDB().collection("logs").insertOne({
|
|
timestamp: Date.now(),
|
|
uid,
|
|
event,
|
|
message,
|
|
});
|
|
}
|
|
|
|
module.exports = {
|
|
log,
|
|
};
|