From 97a3b0b00d71ed89faaa873264ba497a9a3554f2 Mon Sep 17 00:00:00 2001 From: Davidson Francis Date: Tue, 28 May 2024 21:06:43 -0300 Subject: [PATCH] Fix stdout --- alertik.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/alertik.c b/alertik.c index 73a43bc..50f3e7c 100644 --- a/alertik.c +++ b/alertik.c @@ -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();