[agent]-[executor] optimize the command log collect algrothnm

This commit is contained in:
IceDerce
2022-12-14 13:54:48 +08:00
parent 5c65c983c9
commit 2e97f9326d
11 changed files with 645 additions and 67 deletions

View File

@@ -1,8 +1,22 @@
#!/bin/bash
. "C:\Users\wdd\IdeaProjects\ProjectOctopus\source\src\main\java\io\wdd\source\shell\lib\wdd-lib-log.sh"
. /root/IdeaProjects/ProjectOctopus/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-log.sh
. /root/IdeaProjects/ProjectOctopus/source/src/main/java/io/wdd/source/shell/lib/wdd-lib-env.sh
log "wdd is awesome !"
log "wdd is awesome !"
error "error message"
debug "debug message"
info "woshinibaba!"
debug "-------------------"
log "env TEST_ENV is $(env | grep TEST_ENV)"
TEST_ENV=cccc
log "env TEST_ENV is $(env | grep TEST_ENV)"

View File

@@ -0,0 +1,4 @@
#!/bin/bash
export TEST_ENV="${TEST_ENV}_.txt"

View File

@@ -37,7 +37,7 @@ stderr_print() {
# None
#########################
log() {
stderr_print "${CYAN}${MODULE:-} ${MAGENTA}$(date "+%T.%2N ")${RESET}${*}"
stderr_print "${CYAN}${MODULE:-} ${MAGENTA}$(date "+%Y-%m-%d %H:%M:%S.%2N ")${RESET}${*}"
}
########################
# Log an 'info' message
@@ -80,7 +80,7 @@ error() {
#########################
debug() {
# 'is_boolean_yes' is defined in libvalidations.sh, but depends on this file so we cannot source it
local bool="${BITNAMI_DEBUG:-false}"
local bool="${BITNAMI_DEBUG:-true}"
# comparison is performed without regard to the case of alphabetic characters
shopt -s nocasematch
if [[ "$bool" = 1 || "$bool" =~ ^(yes|true)$ ]]; then