Fix stdout

This commit is contained in:
Davidson Francis 2024-05-28 21:06:43 -03:00
parent e2b5df4567
commit 97a3b0b00d

View File

@ -27,7 +27,7 @@
#define LOG_FILE "log/log.txt"
/* Uncomment/comment to enable/disable the following settings. */
#define USE_FILE_AS_LOG /* stdout if commented. */
// #define USE_FILE_AS_LOG /* stdout if commented. */
// #define CURL_VERBOSE
// #define VALIDATE_CERTS
// #define DISABLE_NOTIFICATIONS
@ -437,18 +437,18 @@ int main(void)
TELEGRAM_CHAT_ID = getenv("TELEGRAM_CHAT_ID");
TELEGRAM_NICKNAME = getenv("TELEGRAM_NICKNAME");
#ifndef USE_FILE_AS_LOG
curr_file = STDOUT_FILENO;
#endif
if (!TELEGRAM_BOT_TOKEN || !TELEGRAM_CHAT_ID || !TELEGRAM_NICKNAME) {
panic("Unable to find env vars, please check if you have all of the\n"
panic("Unable to find env vars, please check if you have all of the"
"following set:\n"
"- TELEGRAM_BOT_TOKEN\n"
"- TELEGRAM_CHAT_ID\n"
"- TELEGRAM_NICKNAME\n");
}
#ifndef USE_FILE_AS_LOG
curr_file = STDOUT_FILENO;
#endif
log_msg("Alertik v%s started...\n", ALERTIK_VERSION);
fd = create_socket();