From 7327f117948ed815ee2154ee27d84b88d52e82a5 Mon Sep 17 00:00:00 2001
From: "Xinwei Xiong(cubxxw-openim)" <3293172751nss@gmail.com>
Date: Thu, 10 Aug 2023 12:25:44 +0800
Subject: [PATCH] feat: add config and images log
Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
---
CHANGELOG/CHANGELOG-3.1.md | 87 ++++++++++++++++++++++++++++
CHANGELOG/CHANGELOG.md | 61 +++++++++++++++++++
deployments/README.md | 1 -
docs/CODEOWNERS | 5 +-
scripts/advertise.sh | 24 +++-----
scripts/common.sh | 3 +-
scripts/install/common.sh | 25 ++++++++
scripts/{ => install}/environment.sh | 6 +-
scripts/lib/color.sh | 72 +++++++++--------------
scripts/lib/init.sh | 1 +
scripts/lib/logging.sh | 55 +++++++++++++-----
scripts/make-rules/common.mk | 6 ++
scripts/make-rules/golang.mk | 4 +-
13 files changed, 263 insertions(+), 87 deletions(-)
create mode 100644 CHANGELOG/CHANGELOG-3.1.md
create mode 100755 scripts/install/common.sh
rename scripts/{ => install}/environment.sh (96%)
diff --git a/CHANGELOG/CHANGELOG-3.1.md b/CHANGELOG/CHANGELOG-3.1.md
new file mode 100644
index 000000000..c51eb2098
--- /dev/null
+++ b/CHANGELOG/CHANGELOG-3.1.md
@@ -0,0 +1,87 @@
+# Version logging for OpenIM
+
+
+
+- [Version logging for OpenIM](#version-logging-for-openim)
+ - [Unreleased](#unreleased)
+ - [v3.1.2-beta.3 - 2023-08-09](#v312-beta3---2023-08-09)
+ - [v3.1.2-beta.2 - 2023-08-09](#v312-beta2---2023-08-09)
+ - [v3.1.2-beta.1 - 2023-08-09](#v312-beta1---2023-08-09)
+ - [v3.1.2-beta.0 - 2023-08-08](#v312-beta0---2023-08-08)
+ - [v3.1.2.beta.0 - 2023-08-08](#v312beta0---2023-08-08)
+ - [v3.1.1-beta.4 - 2023-08-07](#v311-beta4---2023-08-07)
+ - [v3.1.1-beta.3 - 2023-08-05](#v311-beta3---2023-08-05)
+ - [v3.1.1-beta.2 - 2023-08-04](#v311-beta2---2023-08-04)
+ - [v3.1.1-beta.1 - 2023-08-04](#v311-beta1---2023-08-04)
+ - [v3.1.1-alpha.3 - 2023-08-03](#v311-alpha3---2023-08-03)
+ - [v3.1.1-alpha.2 - 2023-08-03](#v311-alpha2---2023-08-03)
+ - [v3.1.1-alpha.1 - 2023-08-02](#v311-alpha1---2023-08-02)
+ - [v3.1.0 - 2023-07-28](#v310---2023-07-28)
+ - [Reverts](#reverts)
+ - [Pull Requests](#pull-requests)
+
+
+
+
+
+## [Unreleased]
+
+
+
+## [v3.1.2-beta.3] - 2023-08-09
+
+
+## [v3.1.2-beta.2] - 2023-08-09
+
+
+## [v3.1.2-beta.1] - 2023-08-09
+
+
+## [v3.1.2-beta.0] - 2023-08-08
+
+
+## [v3.1.2.beta.0] - 2023-08-08
+
+
+## [v3.1.1-beta.4] - 2023-08-07
+
+
+## [v3.1.1-beta.3] - 2023-08-05
+
+
+## [v3.1.1-beta.2] - 2023-08-04
+
+
+## [v3.1.1-beta.1] - 2023-08-04
+
+
+## [v3.1.1-alpha.3] - 2023-08-03
+
+
+## [v3.1.1-alpha.2] - 2023-08-03
+
+
+## [v3.1.1-alpha.1] - 2023-08-02
+
+
+## v3.1.0 - 2023-07-28
+### Reverts
+- update etcd to v3.5.2 ([#206](https://github.com/OpenIMSDK/Open-IM-Server/issues/206))
+
+### Pull Requests
+- Merge branch 'tuoyun'
+
+
+[Unreleased]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.3...HEAD
+[v3.1.2-beta.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.2...v3.1.2-beta.3
+[v3.1.2-beta.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.1...v3.1.2-beta.2
+[v3.1.2-beta.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2-beta.0...v3.1.2-beta.1
+[v3.1.2-beta.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.2.beta.0...v3.1.2-beta.0
+[v3.1.2.beta.0]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.4...v3.1.2.beta.0
+[v3.1.1-beta.4]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.3...v3.1.1-beta.4
+[v3.1.1-beta.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.2...v3.1.1-beta.3
+[v3.1.1-beta.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-beta.1...v3.1.1-beta.2
+[v3.1.1-beta.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.3...v3.1.1-beta.1
+[v3.1.1-alpha.3]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.2...v3.1.1-alpha.3
+[v3.1.1-alpha.2]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.1-alpha.1...v3.1.1-alpha.2
+[v3.1.1-alpha.1]: https://github.com/OpenIMSDK/Open-IM-Server/compare/v3.1.0...v3.1.1-alpha.1
diff --git a/CHANGELOG/CHANGELOG.md b/CHANGELOG/CHANGELOG.md
index 822e9bc92..7d872108e 100644
--- a/CHANGELOG/CHANGELOG.md
+++ b/CHANGELOG/CHANGELOG.md
@@ -3,6 +3,8 @@
- [Changelog](#changelog)
- [OpenIM versioning policy](#openim-versioning-policy)
- [command](#command)
+ - [install](#install)
+ - [User](#user)
- [create next tag](#create-next-tag)
- [Release version logs](#release-version-logs)
- [Introduction](#introduction)
@@ -22,10 +24,68 @@ All notable changes to this project will be documented in this file.
## command
+To use git-chglog you need to configure:
+
+1. CHANGELOG templates
+2. git-chglog configuration
+
+### install
+
+```bash
+$ go get github.com/git-chglog/git-chglog/cmd/git-chglog
+```
+
+
+## User
+
+```bash
+$ git-chglog --init
+```
+
+**Options**
+
+- What is the URL of your repository?: https://github.com/marmotedu/iam
+- What is your favorite style?: github
+- Choose the format of your favorite commit message: (): -- feat(core): Add new feature
+- What is your favorite template style?: standard
+- Do you include Merge Commit in CHANGELOG?: n
+- Do you include Revert Commit in CHANGELOG?: y
+- In which directory do you output configuration files and templates?: .chglog
+
```bash
git-chglog --tag-filter-pattern 'v2.0.*' -o CHANGELOG-2.0.md
```
+**Other uses:**
+
+```bash
+$ git-chglog
+
+ If is not specified, it corresponds to all tags.
+ This is the simplest example.
+
+$ git-chglog 1.0.0..2.0.0
+
+ The above is a command to generate CHANGELOG including commit of 1.0.0 to 2.0.0.
+
+$ git-chglog 1.0.0
+
+ The above is a command to generate CHANGELOG including commit of only 1.0.0.
+
+$ git-chglog $(git describe --tags $(git rev-list --tags --max-count=1))
+
+ The above is a command to generate CHANGELOG with the commit included in the latest tag.
+
+$ git-chglog --output CHANGELOG.md
+
+ The above is a command to output to CHANGELOG.md instead of standard output.
+
+$ git-chglog --config custom/dir/config.yml
+
+ The above is a command that uses a configuration file placed other than ".chglog/config.yml".
+```
+
+
## create next tag
```bash
@@ -51,6 +111,7 @@ git tag 2.0.0
+ [OpenIM CHANGELOG-V2.3](CHANGELOG-2.3.md)
+ [OpenIM CHANGELOG-V2.9](CHANGELOG-2.9.md)
+ [OpenIM CHANGELOG-V3.0](CHANGELOG-3.0.md)
++ [OpenIM CHANGELOG-V3.1](CHANGELOG-3.1.md)
## Introduction
diff --git a/deployments/README.md b/deployments/README.md
index 602371fb0..dd59f09cf 100644
--- a/deployments/README.md
+++ b/deployments/README.md
@@ -12,7 +12,6 @@ OpenIM 支持很多种集群化部署方式,包括但不限于 helm, sealos, k
- https://github.com/showurl/deploy-openim
-
### 依赖检查
```bash
diff --git a/docs/CODEOWNERS b/docs/CODEOWNERS
index 93aec15ab..95babf0d1 100644
--- a/docs/CODEOWNERS
+++ b/docs/CODEOWNERS
@@ -64,12 +64,11 @@ cmd/*
# config directory
config/* @skiffer-git
-# db directory
-db/sdk @cubxxw @FGadvancer
-
# internal directory
internal/ @openimsdk/openim @skiffer-git @FGadvancer
+tools @openimsdk/openim @openimsdk/bot @cubxxw @skiffer-git @FGadvancer
+
# logs directory
logs/* @skiffer-git @FGadvancer
diff --git a/scripts/advertise.sh b/scripts/advertise.sh
index 25f3a7f2d..9914e0710 100755
--- a/scripts/advertise.sh
+++ b/scripts/advertise.sh
@@ -13,44 +13,34 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
set -e
set -o pipefail
-. $(dirname ${BASH_SOURCE})/lib/init.sh
-
-trap 'echo "Script interrupted."; exit 1' INT
+. $(dirname ${BASH_SOURCE})/lib/color.sh
-# Function for colored echo
-function color_echo() {
- COLOR=$1
- shift
- echo -e "${COLOR}===> $* ${COLOR_SUFFIX}"
-}
+trap 'openim::color::echo RED_PREFIX "Script interrupted."; exit 1' INT
-function print_with_delay() {
+print_with_delay() {
text="$1"
delay="$2"
- color="$3"
for i in $(seq 0 $((${#text}-1))); do
- printf "${color}${text:$i:1}${COLOR_SUFFIX}"
+ printf "${text:$i:1}"
sleep $delay
done
printf "\n"
}
-function print_progress() {
+print_progress() {
total="$1"
delay="$2"
- color="$3"
- printf "${color}["
+ printf "["
for i in $(seq 1 $total); do
printf "#"
sleep $delay
done
- printf "]${COLOR_SUFFIX}\n"
+ printf "]\n"
}
function openim_logo() {
diff --git a/scripts/common.sh b/scripts/common.sh
index 6068a1d95..35bcd6e9e 100755
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -37,7 +37,8 @@ readonly DOCKER_MACHINE_DRIVER=${DOCKER_MACHINE_DRIVER:-"virtualbox --virtualbox
# This will canonicalize the path
OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
-source "${OPENIM_ROOT}/scripts/lib/init.sh"
+# Please do not refer to lib after referring to common
+. $(dirname ${BASH_SOURCE})/lib/init.sh
# Constants
readonly OPENIM_BUILD_IMAGE_REPO=openim-build
diff --git a/scripts/install/common.sh b/scripts/install/common.sh
new file mode 100755
index 000000000..62bb5f9fa
--- /dev/null
+++ b/scripts/install/common.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# Copyright 2020 Lingfei Kong . All rights reserved.
+# Use of this source code is governed by a MIT style
+# license that can be found in the LICENSE file.
+
+
+# Common utilities, variables and checks for all build scripts.
+set -o errexit
+set +o nounset
+set -o pipefail
+
+# Sourced flag
+COMMON_SOURCED=true
+
+# The root of the build/dist directory
+OPENIM_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/../.. && pwd -P)
+
+source "${OPENIM_ROOT}/scripts/lib/init.sh"
+source "${OPENIM_ROOT}/scripts/install/environment.sh"
+
+# Execute commands that require root permission without entering a password
+function openim::common::sudo {
+ echo ${LINUX_PASSWORD} | sudo -S $1
+}
diff --git a/scripts/environment.sh b/scripts/install/environment.sh
similarity index 96%
rename from scripts/environment.sh
rename to scripts/install/environment.sh
index 0c2aea971..95d84de8f 100755
--- a/scripts/environment.sh
+++ b/scripts/install/environment.sh
@@ -5,10 +5,10 @@
# license that can be found in the LICENSE file.
# OPENIM 项目源码根目录
-IAM_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
+OPENIM_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
# 生成文件存放目录
-LOCAL_OUTPUT_ROOT="${IAM_ROOT}/${OUT_DIR:-_output}"
+LOCAL_OUTPUT_ROOT="${OPENIM_ROOT}/${OUT_DIR:-_output}"
# 设置统一的密码,方便记忆
readonly PASSWORD=${PASSWORD:-'iam59!z$'}
@@ -21,7 +21,7 @@ readonly LINUX_PASSWORD=${LINUX_PASSWORD:-${PASSWORD}}
# 设置安装目录
readonly INSTALL_DIR=${INSTALL_DIR:-/tmp/installation}
mkdir -p ${INSTALL_DIR}
-readonly ENV_FILE=${IAM_ROOT}/scripts/install/environment.sh
+readonly ENV_FILE=${OPENIM_ROOT}/scripts/install/environment.sh
# MariaDB 配置信息
readonly MARIADB_ADMIN_USERNAME=${MARIADB_ADMIN_USERNAME:-root} # MariaDB root 用户
diff --git a/scripts/lib/color.sh b/scripts/lib/color.sh
index 24b6784a3..5f8418923 100755
--- a/scripts/lib/color.sh
+++ b/scripts/lib/color.sh
@@ -19,6 +19,18 @@
# Usage: `scripts/color.sh`.
################################################################################
+# shellcheck disable=SC2034
+if [[ ! -v COLOR_OPEN ]]; then
+ COLOR_OPEN=1
+fi
+
+# Function for colored echo
+openim::color::echo() {
+ COLOR=$1
+ [ $COLOR_OPEN -eq 1 ] && echo -e "${COLOR} $(date '+%Y-%m-%d %H:%M:%S') $@ ${COLOR_SUFFIX}"
+ shift
+}
+
# Define color variables
# --- Feature ---
COLOR_NORMAL='\033[0m';COLOR_BOLD='\033[1m';COLOR_DIM='\033[2m';COLOR_UNDER='\033[4m';
@@ -36,6 +48,21 @@ COLOR_BGREEN='\033[42m';COLOR_BYELLOW='\033[43m';
COLOR_BBLUE='\033[44m';COLOR_BMAGENTA='\033[45m';
COLOR_BCYAN='\033[46m';COLOR_BWHITE='\033[47m';
+# --- Color definitions ---
+# Color definitions
+COLOR_SUFFIX="\033[0m" # End all colors and special effects
+BLACK_PREFIX="\033[30m" # Black prefix
+RED_PREFIX="\033[31m" # Red prefix
+GREEN_PREFIX="\033[32m" # Green prefix
+YELLOW_PREFIX="\033[33m" # Yellow prefix
+BLUE_PREFIX="\033[34m" # Blue prefix
+SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
+WHITE_PREFIX="\033[37m" # White prefix
+BOLD_PREFIX="\033[1m" # Bold prefix
+UNDERLINE_PREFIX="\033[4m" # Underline prefix
+ITALIC_PREFIX="\033[3m" # Italic prefix
+CYAN_PREFIX="\033[0;36m" # Cyan prefix
+
# --- make demo (run demo) ---
reset=$(tput sgr0)
bold=$(tput bold)
@@ -46,51 +73,6 @@ yellow=$(tput bold; tput setaf 3)
blue=$(tput bold; tput setaf 6)
timeout=$(if [ "$(uname)" == "Darwin" ]; then echo "1"; else echo "0.1"; fi)
-# --- Color definitions ---
-# Color definitions
-function openim_color() {
- COLOR_SUFFIX="\033[0m" # End all colors and special effects
-
- BLACK_PREFIX="\033[30m" # Black prefix
- RED_PREFIX="\033[31m" # Red prefix
- GREEN_PREFIX="\033[32m" # Green prefix
- YELLOW_PREFIX="\033[33m" # Yellow prefix
- BLUE_PREFIX="\033[34m" # Blue prefix
- SKY_BLUE_PREFIX="\033[36m" # Sky blue prefix
- WHITE_PREFIX="\033[37m" # White prefix
- BOLD_PREFIX="\033[1m" # Bold prefix
- UNDERLINE_PREFIX="\033[4m" # Underline prefix
- ITALIC_PREFIX="\033[3m" # Italic prefix
-
- CYAN_PREFIX="\033[0;36m" # Cyan prefix
-}
-
-# --- helper functions for logs ---
-function info()
-{
- echo -e "[${GREEN_PREFIX}INFO${COLOR_SUFFIX}] " "$@"
-}
-
-function warn()
-{
- echo -e "[${YELLOW_PREFIX}WARN${COLOR_SUFFIX}] " "$@" >&2
-}
-
-function fatal()
-{
- echo -e "[${RED_PREFIX}ERROR${COLOR_SUFFIX}] " "$@" >&2
- exit 1
-}
-
-function debug()
-{
- echo -e "[${BLUE_PREFIX}DEBUG${COLOR_SUFFIX}]===> " "$@"
-}
-
-function success()
-{
- echo -e "${BRIGHT_GREEN_PREFIX}===> [SUCCESS] <===${COLOR_SUFFIX}\n=> " "$@"
-}
# Print colors you can use
openim::color::print_color()
diff --git a/scripts/lib/init.sh b/scripts/lib/init.sh
index f0e783cd3..be6e811e6 100755
--- a/scripts/lib/init.sh
+++ b/scripts/lib/init.sh
@@ -38,6 +38,7 @@ OPENIM_OUTPUT_BINPATH="${OPENIM_OUTPUT}/bin/platforms"
OPENIM_OUTPUT_BINTOOLPATH="${OPENIM_OUTPUT}/bin-tools"
OPENIM_OUTPUT_TOOLS="${OPENIM_OUTPUT}/tools"
OPENIM_OUTPUT_TMP="${OPENIM_OUTPUT}/tmp"
+OPENIM_OUTPUT_LOGS="${OPENIM_OUTPUT}/logs"
# This controls rsync compression. Set to a value > 0 to enable rsync
# compression for build container
diff --git a/scripts/lib/logging.sh b/scripts/lib/logging.sh
index 092db5513..faef3d1fa 100755
--- a/scripts/lib/logging.sh
+++ b/scripts/lib/logging.sh
@@ -13,10 +13,26 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-
# Controls verbosity of the script output and logging.
OPENIM_VERBOSE="${OPENIM_VERBOSE:-5}"
+if [[ ! -v OPENIM_VERBOSE ]]; then
+ openim::log::info "OPENIM_VERBOSE is not set; defaulting to \"5\""
+ OPENIM_OUTPUT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../../_output" && pwd -P)"
+ OPENIM_VERBOSE="${OPENIM_OUTPUT}/logs"
+fi
+
+log_file="${OPENIM_OUTPUT_LOGS}/openim_$(date '+%Y%m%d').log"
+
+function echo_log() {
+ echo_log -e "$@" | tee -a "${log_file}"
+}
+
+# MAX_LOG_SIZE=10485760 # 10MB
+
+# Clear logs from 5 days ago
+# find $OPENIM_OUTPUT_LOGS -type f -name "*.log" -mtime +5 -exec rm -f {} \;
+
# Handler for when we exit automatically on an error.
# Borrowed from https://gist.github.com/ahendrix/7030300
openim::log::errexit() {
@@ -58,7 +74,7 @@ openim::log::stack() {
local stack_skip=${1:-0}
stack_skip=$((stack_skip + 1))
if [[ ${#FUNCNAME[@]} -gt ${stack_skip} ]]; then
- echo "Call stack:" >&2
+ echo_log_log "Call stack:" >&2
local i
for ((i=1 ; i <= ${#FUNCNAME[@]} - stack_skip ; i++))
do
@@ -66,7 +82,7 @@ openim::log::stack() {
local source_file=${BASH_SOURCE[${frame_no}]}
local source_lineno=${BASH_LINENO[$((frame_no - 1))]}
local funcname=${FUNCNAME[${frame_no}]}
- echo " ${i}: ${source_file}:${source_lineno} ${funcname}(...)" >&2
+ echo_log_log " ${i}: ${source_file}:${source_lineno} ${funcname}(...)" >&2
done
fi
}
@@ -85,14 +101,14 @@ openim::log::error_exit() {
if [[ ${OPENIM_VERBOSE} -ge 4 ]]; then
local source_file=${BASH_SOURCE[${stack_skip}]}
local source_line=${BASH_LINENO[$((stack_skip - 1))]}
- echo "!!! Error in ${source_file}:${source_line}" >&2
+ echo_log "!!! Error in ${source_file}:${source_line}" >&2
[[ -z ${1-} ]] || {
- echo " ${1}" >&2
+ echo_log " ${1}" >&2
}
openim::log::stack ${stack_skip}
- echo "Exiting with status ${code}" >&2
+ echo_log "Exiting with status ${code}" >&2
fi
exit "${code}"
@@ -101,21 +117,21 @@ openim::log::error_exit() {
# Log an error but keep going. Don't dump the stack or exit.
openim::log::error() {
timestamp=$(date +"[%m%d %H:%M:%S]")
- echo "!!! ${timestamp} ${1-}" >&2
+ echo_log "!!! ${timestamp} ${1-}" >&2
shift
for message; do
- echo " ${message}" >&2
+ echo_log " ${message}" >&2
done
}
# Print an usage message to stderr. The arguments are printed directly.
openim::log::usage() {
- echo >&2
+ echo_log >&2
local message
for message; do
- echo "${message}" >&2
+ echo_log "${message}" >&2
done
- echo >&2
+ echo_log >&2
}
openim::log::usage_from_stdin() {
@@ -135,14 +151,14 @@ openim::log::info() {
fi
for message; do
- echo "${message}"
+ echo_log "${message}"
done
}
# Just like openim::log::info, but no \n, so you can make a progress bar
openim::log::progress() {
for message; do
- echo -e -n "${message}"
+ echo_log -e -n "${message}"
done
}
@@ -163,9 +179,18 @@ openim::log::status() {
fi
timestamp=$(date +"[%m%d %H:%M:%S]")
- echo "+++ ${timestamp} ${1}"
+ echo_log "+++ ${timestamp} ${1}"
shift
for message; do
- echo " ${message}"
+ echo_log " ${message}"
done
}
+
+openim::log::success()
+{
+ local V="${V:-0}"
+ if [[ ${OPENIM_VERBOSE} < ${V} ]]; then
+ return
+ fi
+ echo_log -e "${BRIGHT_GREEN_PREFIX}===> [success] <===${COLOR_SUFFIX}\n=> " "$@"
+}
\ No newline at end of file
diff --git a/scripts/make-rules/common.mk b/scripts/make-rules/common.mk
index 051f1697d..18b2bd9c6 100644
--- a/scripts/make-rules/common.mk
+++ b/scripts/make-rules/common.mk
@@ -52,6 +52,12 @@ BIN_TOOLS_DIR := $(OUTPUT_DIR)/bin-tools
$(shell mkdir -p $(BIN_TOOLS_DIR))
endif
+# LOGS_DIR: Directory where log files are stored.
+ifeq ($(origin LOGS_DIR),undefined)
+LOGS_DIR := $(OUTPUT_DIR)/logs
+$(shell mkdir -p $(LOGS_DIR))
+endif
+
# TOOLS_DIR: The directory where tools are stored for build and testing.
ifeq ($(origin TOOLS_DIR),undefined)
TOOLS_DIR := $(OUTPUT_DIR)/tools
diff --git a/scripts/make-rules/golang.mk b/scripts/make-rules/golang.mk
index 339cbef6e..7cff9d42b 100644
--- a/scripts/make-rules/golang.mk
+++ b/scripts/make-rules/golang.mk
@@ -221,8 +221,8 @@ go.updates: tools.verify.go-mod-outdated
## go.clean: Clean all builds directories and files
.PHONY: go.clean
go.clean:
- @echo "===========> Cleaning all builds TMP_DIR($(TMP_DIR)) AND BIN_DIR($(BIN_DIR)) AND BIN_TOOLS_DIR($(BIN_TOOLS_DIR))"
- @-rm -vrf $(TMP_DIR) $(BIN_DIR) $(BIN_TOOLS_DIR)
+ @echo "===========> Cleaning all builds tmp, bin, logs directories and files"
+ @-rm -vrf $(TMP_DIR) $(BIN_DIR) $(BIN_TOOLS_DIR) $(LOGS_DIR)
@echo "===========> End clean..."
## copyright.help: Show copyright help