From 973bfdea8e1c2d71c753acad8c66a0b280c0a4b3 Mon Sep 17 00:00:00 2001 From: Marco Ferrari Date: Tue, 29 Sep 2020 22:46:24 +0200 Subject: [PATCH] Initialize all log-related ASAP --- lib/linter.sh | 5 +++-- lib/worker.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/linter.sh b/lib/linter.sh index 0bebc56f..7f25dcbf 100755 --- a/lib/linter.sh +++ b/lib/linter.sh @@ -17,6 +17,9 @@ ACTIONS_RUNNER_DEBUG="${ACTIONS_RUNNER_DEBUG:-false}" # Boolean to see even more # Log Vars # # Define these early, so we can use debug logging ASAP if needed # ################################################################## +LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder) +LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE) + if [[ ${ACTIONS_RUNNER_DEBUG} == true ]]; then LOG_LEVEL="DEBUG"; fi # Boolean to see trace logs LOG_TRACE=$(if [[ ${LOG_LEVEL} == "TRACE" ]]; then echo "true"; fi) @@ -189,8 +192,6 @@ GITHUB_SHA="${GITHUB_SHA}" # GitHub sh GITHUB_TOKEN="${GITHUB_TOKEN}" # GitHub Token passed from environment GITHUB_WORKSPACE="${GITHUB_WORKSPACE}" # Github Workspace KUBERNETES_DIRECTORY="${KUBERNETES_DIRECTORY}" # Kubernetes directory -LOG_FILE="${LOG_FILE:-super-linter.log}" # Default log file name (located in GITHUB_WORKSPACE folder) -LOG_LEVEL="${LOG_LEVEL:-VERBOSE}" # Default log level (VERBOSE, DEBUG, TRACE) MULTI_STATUS="${MULTI_STATUS:-true}" # Multiple status are created for each check ran TEST_CASE_RUN="${TEST_CASE_RUN}" # Boolean to validate only test cases VALIDATE_ALL_CODEBASE="${VALIDATE_ALL_CODEBASE}" # Boolean to validate all files diff --git a/lib/worker.sh b/lib/worker.sh index 12345ce6..36768ac1 100755 --- a/lib/worker.sh +++ b/lib/worker.sh @@ -359,6 +359,8 @@ function TestCodebase() { INDIVIDUAL_TEST_FOLDER="${5}" # Folder for specific tests TESTS_RAN=0 # Incremented when tests are ran, this will help find failed finds + debug "Running ${FILE_TYPE} test. Linter name: ${LINTER_NAME}, linter command: ${LINTER_COMMAND}, file extensions: ${FILE_EXTENSIONS}, individual test folder: ${INDIVIDUAL_TEST_FOLDER}" + ################ # print header # ################