mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 00:04:37 +08:00
15 lines
322 B
JavaScript
15 lines
322 B
JavaScript
import db from "../init/db";
|
|
|
|
export default {
|
|
async 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,
|
|
});
|
|
},
|
|
};
|