chore: Add initial configuration files and code structure
This commit is contained in:
commit
127a7dc87f
13 changed files with 1761 additions and 0 deletions
16
logs/logger.js
Normal file
16
logs/logger.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
const fs = require('fs');
|
||||
|
||||
function logAction(action, userid, username) {
|
||||
const date = new Date();
|
||||
const formattedDate = `${date.getDate()}${date.getMonth() + 1}${date.getFullYear()}`;
|
||||
const logMessage = `${new Date().toISOString()} ${action}\n`;
|
||||
fs.appendFile(`./logs/${userid}_${username}_${formattedDate}.txt`, logMessage, (err) => {
|
||||
if (err) {
|
||||
console.error(`Failed to log action: ${err}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
logAction
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue