Skip to content

Commit

Permalink
Merge pull request #124 from mateopresacastro/dev
Browse files Browse the repository at this point in the history
chore: add env to log
  • Loading branch information
mateopresacastro authored Dec 15, 2024
2 parents 22a179c + f9883a7 commit 8e6c3a4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ class Logger {

async #send(prefix: string, message: string, details?: unknown) {
try {
const env = String(process.env.VERCEL_ENV).toUpperCase();
const fullMessage = details
? `${prefix}${message}\n${this.#formatDetails(details)}`
: `${prefix}${message}`;
? `${env} - ${prefix}${message}\n${this.#formatDetails(details)}`
: `${env} - ${prefix}${message}`;

await this.#bot.api.sendMessage(this.#chatId, fullMessage);
} catch (error) {
Expand Down

0 comments on commit 8e6c3a4

Please sign in to comment.