mirror of
https://github.com/buger/goreplay.git
synced 2024-04-21 12:32:02 +00:00
fix middlewares bugs: (#887)
bugs include: - middleware doesn't send message meta - send empty request when prettifier is off - handle shutdown gracefully - disable debug in example middlewares during test
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#
|
||||
|
||||
function log {
|
||||
if $GOR_TEST != ""; then # if we are not testing
|
||||
if [[ ! -v GOR_TEST ]]; then # if we are not testing
|
||||
# Logging to stderr, because stdout/stdin used for data transfer
|
||||
>&2 echo "[DEBUG][ECHO] $1"
|
||||
fi
|
||||
|
||||
@@ -115,7 +115,7 @@ func encode(buf []byte) []byte {
|
||||
}
|
||||
|
||||
func Debug(args ...interface{}) {
|
||||
if os.Getenv("GOR_TEST") != "" { // if we are not testing
|
||||
if os.Getenv("GOR_TEST") == "" { // if we are not testing
|
||||
fmt.Fprint(os.Stderr, "[DEBUG][TOKEN-MOD] ")
|
||||
fmt.Fprintln(os.Stderr, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user