diff --git a/functions/check_dead.sh b/functions/check_dead.sh index 5f4be40ee..73bd95167 100644 --- a/functions/check_dead.sh +++ b/functions/check_dead.sh @@ -152,17 +152,17 @@ find_dead() { } # Function 'log_event' logs domain processing events into the domain log. -# $1: domains to log stored in a variable. -# $2: event type (dead, whitelisted, etc.) -# $3: source +# $1: domains to log stored in a variable. +# $2: event type (dead, whitelisted, etc.) +# $3: source log_event() { printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \ '{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG" } -# Function 'format_file' calls a shell wrapper to -# standardize the format of a file. -# $1: file to format +# Function 'format_file' calls a shell wrapper to standardize the format +# of a file. +# $1: file to format format_file() { bash functions/tools.sh format "$1" } diff --git a/functions/check_parked.sh b/functions/check_parked.sh index 86c20766f..1ea3d3872 100644 --- a/functions/check_parked.sh +++ b/functions/check_parked.sh @@ -133,17 +133,17 @@ find_parked() { } # Function 'log_event' logs domain processing events into the domain log. -# $1: domains to log stored in a variable -# $2: event type (dead, whitelisted, etc.) -# $3: source +# $1: domains to log stored in a variable. +# $2: event type (dead, whitelisted, etc.) +# $3: source log_event() { printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \ '{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG" } -# Function 'format_file' calls a shell wrapper to -# standardize the format of a file. -# $1: file to format +# Function 'format_file' calls a shell wrapper to standardize the format +# of a file. +# $1: file to format format_file() { bash functions/tools.sh format "$1" } diff --git a/functions/retrieve_domains.sh b/functions/retrieve_domains.sh index cdd763629..2e9c2886d 100644 --- a/functions/retrieve_domains.sh +++ b/functions/retrieve_domains.sh @@ -252,16 +252,6 @@ decide_exit() { fi } -# Function 'log_event' logs domain processing events into the domain log. -# $1: domains to log stored in a variable -# $2: event type (dead, whitelisted, etc.) -# $3: source -log_event() { - [[ -n "$3" ]] && local source="$3" - printf "%s\n" "$1" | awk -v type="$2" -v source="$source" -v time="$TIME_FORMAT" \ - '{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG" -} - # Function 'log_source' prints and logs statistics for each source. # The variables should be declared before running this function, # otherwise, the default values are used. @@ -287,9 +277,18 @@ ${query_count:-0},${rate_limited:-false}",no >> "$SOURCE_LOG" printf "%s\n" "----------------------------------------------------------------------" } -# Function 'format_file' calls a shell wrapper to -# standardize the format of a file. -# $1: file to format +# Function 'log_event' logs domain processing events into the domain log. +# $1: domains to log stored in a variable. +# $2: event type (dead, whitelisted, etc.) +# $3: source +log_event() { + printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \ + '{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG" +} + +# Function 'format_file' calls a shell wrapper to standardize the format +# of a file. +# $1: file to format format_file() { bash functions/tools.sh format "$1" } diff --git a/functions/validate_raw.sh b/functions/validate_raw.sh index 42f162d01..4c10a3a28 100644 --- a/functions/validate_raw.sh +++ b/functions/validate_raw.sh @@ -159,17 +159,17 @@ validate_raw() { } # Function 'log_event' logs domain processing events into the domain log. -# $1: domains to log stored in a variable -# $2: event type (dead, whitelisted, etc.) -# $3: source +# $1: domains to log stored in a variable. +# $2: event type (dead, whitelisted, etc.) +# $3: source log_event() { printf "%s\n" "$1" | awk -v type="$2" -v source="$3" -v time="$(date -u +"%H:%M:%S %d-%m-%y")" \ '{print time "," type "," $0 "," source}' >> "$DOMAIN_LOG" } -# Function 'format_file' calls a shell wrapper to -# standardize the format of a file. -# $1: file to format +# Function 'format_file' calls a shell wrapper to standardize the format +# of a file. +# $1: file to format format_file() { bash functions/tools.sh format "$1" }