Added timestamps to logs
This commit is contained in:
10
tokens.js
10
tokens.js
@@ -21,7 +21,7 @@ async function TokenRenew() {
|
||||
await deleteToken(tokenID);
|
||||
shared.eventEmitter.emit("tokenRenewalEnd");
|
||||
} catch (error) {
|
||||
console.error("Errore nel rinnovo del token:", error);
|
||||
console.error(`[${shared.now}] Errore nel rinnovo del token: ${error}`);
|
||||
}
|
||||
}, day - hour);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ async function getUserID() {
|
||||
Authorization: `Token ${shared.getToken()}`,
|
||||
},
|
||||
});
|
||||
console.log(`UserID: ${response.data.id}`);
|
||||
console.log(`[${shared.now}] UserID: ${response.data.id}`);
|
||||
return response.data.id;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ async function deleteToken(tokenID) {
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log(`Token con ID ${tokenID} cancellato con successo`);
|
||||
console.log(`[${shared.now}] Token con ID ${tokenID} cancellato con successo`);
|
||||
}
|
||||
|
||||
async function getCurrentTokenID() {
|
||||
@@ -63,7 +63,7 @@ async function getCurrentTokenID() {
|
||||
const token = response.data.find((t) => t.name === "Uptime Kuma");
|
||||
if (!token) throw new Error("Token 'Uptime Kuma' non trovato");
|
||||
|
||||
console.log(`CurrentTokenID: ${token.id}`);
|
||||
console.log(`[${shared.now}] CurrentTokenID: ${token.id}`);
|
||||
return token.id;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ async function getNewToken() {
|
||||
},
|
||||
}
|
||||
);
|
||||
console.log(`Nuovo token creato: ${response.data.plain_token}`);
|
||||
console.log(`[${shared.now}] Nuovo token creato: ${response.data.plain_token}`);
|
||||
return response.data.plain_token;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user