From 7bf699be7006082b263e4f341616e05f1351e676 Mon Sep 17 00:00:00 2001 From: wisecolt Date: Wed, 4 Feb 2026 18:35:36 +0300 Subject: [PATCH] =?UTF-8?q?refactor(logger):=20dosya=20loglamas=C4=B1n?= =?UTF-8?q?=C4=B1=20kald=C4=B1r?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Log dosyasına yazma işlevi kaldırıldı. Artık loglar sadece terminale yazdırılıyor. LOG_FILE sabiti, logger_clear ve logger_tail fonksiyonları ile -l/--log ve --clear-log komut satırı seçenekleri tamamen kaldırıldı. --- poster-bash | 48 ++---------------------------------------------- 1 file changed, 2 insertions(+), 46 deletions(-) diff --git a/poster-bash b/poster-bash index d7ce2d8..e0b4971 100755 --- a/poster-bash +++ b/poster-bash @@ -28,7 +28,6 @@ export EXIT_ERROR_API=6 # Constants export RETRY_MAX=3 export TIMEOUT_SECONDS=30 -export LOG_FILE="${HOME}/.game-bash.log" # IGDB API endpoints export IGDB_OAUTH_URL="https://id.twitch.tv/oauth2/token" @@ -307,7 +306,7 @@ export LOG_LEVEL_SUCCESS=4 # Current log level (default: INFO) export CURRENT_LOG_LEVEL=$LOG_LEVEL_INFO -# Internal log function +# Internal log function (terminal only, no disk write) _log_write() { local level="$1" local level_num="$2" @@ -319,17 +318,11 @@ _log_write() { return 0 fi - local timestamp - timestamp=$(get_timestamp) - # Format level to 8 characters local level_formatted level_formatted=$(printf "%-8s" "$level") - # Write to log file - echo "[$timestamp] $level_formatted$message" >> "$LOG_FILE" - - # Write to terminal with color + # Write to terminal with color only (no disk write) if [ -n "$color" ]; then echo -e "${color}${level_formatted}${COLOR_RESET} ${message}" else @@ -364,14 +357,6 @@ log_debug() { # Initialize logger logger_init() { - # Create log file if it doesn't exist - if [ ! -f "$LOG_FILE" ]; then - touch "$LOG_FILE" - fi - - # Set permissions - chmod 600 "$LOG_FILE" - # Set log level from config local log_level_upper log_level_upper=$(echo "$LOG_LEVEL" | tr '[:lower:]' '[:upper:]') @@ -395,17 +380,6 @@ logger_init() { esac } -# Clear log file -logger_clear() { - > "$LOG_FILE" -} - -# Show recent log entries -logger_tail() { - local lines="${1:-20}" - tail -n "$lines" "$LOG_FILE" -} - ############################################################################### # UI MODULE ############################################################################### @@ -1152,8 +1126,6 @@ ${COLOR_BOLD}Kullanım:${COLOR_RESET} ${COLOR_BOLD}Seçenekler:${COLOR_RESET} -h, --help Bu yardım mesajını gösterir -v, --version Versiyon bilgisini gösterir - -l, --log Log dosyasını gösterir - --clear-log Log dosyasını temizler --test-run Test modunda çalışır (önce eski posterleri temizler) ${COLOR_BOLD}Kullanım:${COLOR_RESET} @@ -1234,21 +1206,6 @@ main() { show_version exit $EXIT_SUCCESS ;; - -l|--log) - echo "Log: ${LOG_FILE}" - if [ -f "$LOG_FILE" ]; then - echo "" - logger_tail 20 - else - echo "Log dosyası bulunamadı" - fi - exit $EXIT_SUCCESS - ;; - --clear-log) - logger_clear - echo "Log dosyası temizlendi" - exit $EXIT_SUCCESS - ;; --test-run) test_mode=true ;; @@ -1318,7 +1275,6 @@ main() { log_info "Tamamlandı" ui_print_divider 50 "━" - echo -e " ${COLOR_DIM}Log: ${LOG_FILE}${COLOR_RESET}" echo "" }