Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package fortio for openSUSE:Factory checked in at 2023-08-06 16:29:51 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/fortio (Old) and /work/SRC/openSUSE:Factory/.fortio.new.22712 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "fortio" Sun Aug 6 16:29:51 2023 rev:47 rq:1102545 version:1.58.0 Changes: -------- --- /work/SRC/openSUSE:Factory/fortio/fortio.changes 2023-08-04 15:04:22.100633961 +0200 +++ /work/SRC/openSUSE:Factory/.fortio.new.22712/fortio.changes 2023-08-06 16:30:11.107928251 +0200 @@ -1,0 +2,7 @@ +Sun Aug 06 07:52:20 UTC 2023 - ka...@b1-systems.de + +- Update to version 1.58.0: + * Plug in the ErrorHandlers for JSON/color compatibility of http + lib logging (#812) + +------------------------------------------------------------------- Old: ---- fortio-1.57.5.obscpio New: ---- fortio-1.58.0.obscpio ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ fortio.spec ++++++ --- /var/tmp/diff_new_pack.sSMYuu/_old 2023-08-06 16:30:12.035933876 +0200 +++ /var/tmp/diff_new_pack.sSMYuu/_new 2023-08-06 16:30:12.043933924 +0200 @@ -19,7 +19,7 @@ %define __arch_install_post export NO_BRP_STRIP_DEBUG=true Name: fortio -Version: 1.57.5 +Version: 1.58.0 Release: 0 Summary: Load testing library, command line tool, advanced echo server and web UI License: Apache-2.0 ++++++ _service ++++++ --- /var/tmp/diff_new_pack.sSMYuu/_old 2023-08-06 16:30:12.079934143 +0200 +++ /var/tmp/diff_new_pack.sSMYuu/_new 2023-08-06 16:30:12.083934167 +0200 @@ -3,7 +3,7 @@ <param name="url">https://github.com/fortio/fortio</param> <param name="scm">git</param> <param name="exclude">.git</param> - <param name="revision">v1.57.5</param> + <param name="revision">v1.58.0</param> <param name="versionformat">@PARENT_TAG@</param> <param name="changesgenerate">enable</param> <param name="versionrewrite-pattern">v(.*)</param> ++++++ _servicedata ++++++ --- /var/tmp/diff_new_pack.sSMYuu/_old 2023-08-06 16:30:12.107934312 +0200 +++ /var/tmp/diff_new_pack.sSMYuu/_new 2023-08-06 16:30:12.111934337 +0200 @@ -1,6 +1,6 @@ <servicedata> <service name="tar_scm"> <param name="url">https://github.com/fortio/fortio</param> - <param name="changesrevision">bddad000c61bbd099b6e7d8f8f978771bca3aacd</param></service></servicedata> + <param name="changesrevision">fef3d6d3b49815d40e2af4301cddb6f50c95362b</param></service></servicedata> (No newline at EOF) ++++++ fortio-1.57.5.obscpio -> fortio-1.58.0.obscpio ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.57.5/README.md new/fortio-1.58.0/README.md --- old/fortio-1.57.5/README.md 2023-08-03 22:06:18.000000000 +0200 +++ new/fortio-1.58.0/README.md 2023-08-04 17:34:19.000000000 +0200 @@ -1,4 +1,4 @@ -<!-- 1.57.5 --> +<!-- 1.58.0 --> # Fortio [](https://github.com/avelino/awesome-go#networking) @@ -60,13 +60,13 @@ The [releases](https://github.com/fortio/fortio/releases) page has binaries for many OS/architecture combinations (see assets): ```shell -curl -L https://github.com/fortio/fortio/releases/download/v1.57.5/fortio-linux_amd64-1.57.5.tgz \ +curl -L https://github.com/fortio/fortio/releases/download/v1.58.0/fortio-linux_amd64-1.58.0.tgz \ | sudo tar -C / -xvzpf - # or the debian package -wget https://github.com/fortio/fortio/releases/download/v1.57.5/fortio_1.57.5_amd64.deb -dpkg -i fortio_1.57.5_amd64.deb +wget https://github.com/fortio/fortio/releases/download/v1.58.0/fortio_1.58.0_amd64.deb +dpkg -i fortio_1.58.0_amd64.deb # or the rpm -rpm -i https://github.com/fortio/fortio/releases/download/v1.57.5/fortio-1.57.5-1.x86_64.rpm +rpm -i https://github.com/fortio/fortio/releases/download/v1.58.0/fortio-1.58.0-1.x86_64.rpm # and more, see assets in release page ``` @@ -76,7 +76,7 @@ brew install fortio ``` -On Windows, download https://github.com/fortio/fortio/releases/download/v1.57.5/fortio_win_1.57.5.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt: +On Windows, download https://github.com/fortio/fortio/releases/download/v1.58.0/fortio_win_1.58.0.zip and extract `fortio.exe` to any location, then using the Windows Command Prompt: ``` fortio.exe server ``` @@ -128,7 +128,7 @@ <!-- use release/updateFlags.sh to update this section --> <pre> <!-- USAGE_START --> -ΦοÏÏίο 1.57.5 usage: +ΦοÏÏίο 1.58.0 usage: fortio command [flags] target where command is one of: load (load testing), server (starts ui, rest api, http-echo, redirect, proxies, tcp-echo, udp-echo and grpc ping servers), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.57.5/fhttp/http_server.go new/fortio-1.58.0/fhttp/http_server.go --- old/fortio-1.57.5/fhttp/http_server.go 2023-08-03 22:06:18.000000000 +0200 +++ new/fortio-1.58.0/fhttp/http_server.go 2023-08-04 17:34:19.000000000 +0200 @@ -241,6 +241,7 @@ ReadHeaderTimeout: ServerIdleTimeout.Get(), IdleTimeout: ServerIdleTimeout.Get(), Handler: h2c.NewHandler(hdlr, h2s), + ErrorLog: log.NewStdLogger("http2c srv "+name, log.Error), } listener, addr := fnet.Listen(name, port) if listener == nil { @@ -270,6 +271,7 @@ IdleTimeout: ServerIdleTimeout.Get(), Handler: m, TLSConfig: tlsConfig, + ErrorLog: log.NewStdLogger("http srv "+name, log.Error), } go func() { err := s.ServeTLS(listener, to.Cert, to.Key) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.57.5/go.mod new/fortio-1.58.0/go.mod --- old/fortio-1.57.5/go.mod 2023-08-03 22:06:18.000000000 +0200 +++ new/fortio-1.58.0/go.mod 2023-08-04 17:34:19.000000000 +0200 @@ -5,9 +5,9 @@ require ( fortio.org/assert v1.2.0 fortio.org/cli v1.3.3 - fortio.org/dflag v1.5.2 - fortio.org/log v1.9.3 - fortio.org/scli v1.10.3 + fortio.org/dflag v1.5.3 + fortio.org/log v1.10.0 + fortio.org/scli v1.11.0 fortio.org/testscript v0.3.1 fortio.org/version v1.0.2 github.com/golang/protobuf v1.5.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/fortio-1.57.5/go.sum new/fortio-1.58.0/go.sum --- old/fortio-1.57.5/go.sum 2023-08-03 22:06:18.000000000 +0200 +++ new/fortio-1.58.0/go.sum 2023-08-04 17:34:19.000000000 +0200 @@ -2,12 +2,12 @@ fortio.org/assert v1.2.0/go.mod h1:039mG+/iYDPO8Ibx8TrNuJCm2T2SuhwRI3uL9nHTTls= fortio.org/cli v1.3.3 h1:b2JPQ7ekVFpF7SrEllJTbh1rdivsyXT081oQUeiuIp0= fortio.org/cli v1.3.3/go.mod h1:ZsevXTvMidh3xllYoAElS52XRcGx+f1hVlgB+v2Pa0Y= -fortio.org/dflag v1.5.2 h1:F9XVRj4Qr2IbJP7BMj7XZc9wB0Q/RZ61Ool+4YPVad8= -fortio.org/dflag v1.5.2/go.mod h1:ppb/A8u+KKg+qUUYZNYuvRnXuVb8IsdHb/XGzsmjkN8= -fortio.org/log v1.9.3 h1:rkgDmgF7dLfNRtVOE44Av5KBlro8FkpTKnTnphHy074= -fortio.org/log v1.9.3/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU= -fortio.org/scli v1.10.3 h1:6aNn9ggOAoyp9vDs3rXN3uMZiRHcVdlPbsTHoN8PfiE= -fortio.org/scli v1.10.3/go.mod h1:qfmKaJUtGumrCs0+CfErIFp2qjT2OV6BTBGXGgRqaY4= +fortio.org/dflag v1.5.3 h1:+pCqZBCz95PYTxhcmenjrkVORWIRB1Je4eO/So574Bc= +fortio.org/dflag v1.5.3/go.mod h1:cM/ojIzdDv8FRA5yqSRpDK9jCGmASln0k7ag3zeiqbw= +fortio.org/log v1.10.0 h1:Id2z9HjGlof0VsIHi2XNI9k+tG7ujODVDnAAvkSgpuE= +fortio.org/log v1.10.0/go.mod h1:u/8/2lyczXq52aT5Nw6reD+3cR6m/EbS2jBiIYhgiTU= +fortio.org/scli v1.11.0 h1:MI0kTivwCIF2L6eJJFUnTipd5d1KtCM1oVMB6Dcf6pY= +fortio.org/scli v1.11.0/go.mod h1:XfyQjPJWYlF74dY0zMascOzVPds0GCbam184DMuCySU= fortio.org/sets v1.0.3 h1:HzewdGjH69YmyW06yzplL35lGr+X4OcqQt0qS6jbaO4= fortio.org/sets v1.0.3/go.mod h1:QZVj0r6KP/ZD9ebySW9SgxVNy/NjghUfyHW9NN+WU+4= fortio.org/testscript v0.3.1 h1:MmRO64AsmzaU1KlYMzAbotJIMKRGxD1XXssJnBRiMGQ= ++++++ fortio.obsinfo ++++++ --- /var/tmp/diff_new_pack.sSMYuu/_old 2023-08-06 16:30:12.347935767 +0200 +++ /var/tmp/diff_new_pack.sSMYuu/_new 2023-08-06 16:30:12.355935815 +0200 @@ -1,5 +1,5 @@ name: fortio -version: 1.57.5 -mtime: 1691093178 -commit: bddad000c61bbd099b6e7d8f8f978771bca3aacd +version: 1.58.0 +mtime: 1691163259 +commit: fef3d6d3b49815d40e2af4301cddb6f50c95362b ++++++ vendor.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/fortio.org/log/http_logging.go new/vendor/fortio.org/log/http_logging.go --- old/vendor/fortio.org/log/http_logging.go 2023-08-04 08:23:02.000000000 +0200 +++ new/vendor/fortio.org/log/http_logging.go 2023-08-06 09:52:21.000000000 +0200 @@ -17,6 +17,7 @@ import ( "crypto/tls" "fmt" + "log" "net/http" "strings" ) @@ -72,3 +73,28 @@ } S(Info, msg, attr...) } + +type logWriter struct { + source string + level Level +} + +// Returns a Std logger that will log to the given level with the given source attribute. +// Can be passed for instance to net/http/httputil.ReverseProxy.ErrorLog. +func NewStdLogger(source string, level Level) *log.Logger { + return log.New(logWriter{source, level}, "", 0) +} + +func (w logWriter) Write(p []byte) (n int, err error) { + // Force JSON to avoid infinite loop and also skip file/line so it doesn't show this file as the source + // (TODO consider passing the level up the stack to look for the caller) + s(w.level, false, true, strings.TrimSpace(string(p)), Str("src", w.source)) + return len(p), nil +} + +// InterceptStandardLogger changes the output of the standard logger to use ours, at the given +// level, with the source "std", as a catchall. +func InterceptStandardLogger(level Level) { + log.SetFlags(0) + log.SetOutput(logWriter{"std", level}) +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/fortio.org/log/logger.go new/vendor/fortio.org/log/logger.go --- old/vendor/fortio.org/log/logger.go 2023-08-04 08:23:02.000000000 +0200 +++ new/vendor/fortio.org/log/logger.go 2023-08-06 09:52:21.000000000 +0200 @@ -532,17 +532,18 @@ // S logs a message of the given level with additional attributes. func S(lvl Level, msg string, attrs ...KeyVal) { + s(lvl, Config.LogFileAndLine, Config.JSON, msg, attrs...) +} + +func s(lvl Level, logFileAndLine bool, json bool, msg string, attrs ...KeyVal) { if !Log(lvl) { return } - // extra := "" - // if Config.GoroutineID { - // } buf := strings.Builder{} var format string if Color { format = Colors.Reset + ", " + Colors.Blue + "%s" + Colors.Reset + "=" + LevelToColor[lvl] + "%q" - } else if Config.JSON { + } else if json { format = ",%q:%q" } else { format = ", %s=%q" @@ -561,14 +562,14 @@ } else { lvl1Char = "[" + LevelToStrA[lvl][0:1] + "]" } - if Config.LogFileAndLine { //nolint:nestif - _, file, line, _ := runtime.Caller(1) + if logFileAndLine { //nolint:nestif + _, file, line, _ := runtime.Caller(2) file = file[strings.LastIndex(file, "/")+1:] if Color { jsonWrite(fmt.Sprintf("%s%s%s %s:%d%s%s%s%s%s\n", colorTimestamp(), colorGID(), ColorLevelToStr(lvl), file, line, prefix, LevelToColor[lvl], msg, buf.String(), Colors.Reset)) - } else if Config.JSON { + } else if json { jsonWrite(fmt.Sprintf("{%s\"level\":%s,%s\"file\":%q,\"line\":%d,\"msg\":%q%s}\n", jsonTimestamp(), LevelToJSON[lvl], jsonGID(), file, line, msg, buf.String())) } else { @@ -578,7 +579,7 @@ if Color { jsonWrite(fmt.Sprintf("%s%s%s%s%s%s%s%s\n", colorTimestamp(), colorGID(), ColorLevelToStr(lvl), prefix, LevelToColor[lvl], msg, buf.String(), Colors.Reset)) - } else if Config.JSON { + } else if json { jsonWrite(fmt.Sprintf("{%s\"level\":%s,\"msg\":%q%s}\n", jsonTimestamp(), LevelToJSON[lvl], msg, buf.String())) } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/fortio.org/scli/README.md new/vendor/fortio.org/scli/README.md --- old/vendor/fortio.org/scli/README.md 2023-08-04 08:23:02.000000000 +0200 +++ new/vendor/fortio.org/scli/README.md 2023-08-06 09:52:21.000000000 +0200 @@ -7,6 +7,8 @@ In addition to flags, usage and help output, arguments validation, `scli` abstracts the repetitive parts of a `main()` to setup a config directory watch for [dynamic flags](https://github.com/fortio/dflag) (configmap in kubernetes cases) and configuration endpoint/UI/api. +It also sets up standard library logger interception to log these under same JSON (or color console) format. + You can see real use example in a server like [proxy](https://github.com/fortio/proxy). ## Server Example diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/fortio.org/scli/scli.go new/vendor/fortio.org/scli/scli.go --- old/vendor/fortio.org/scli/scli.go 2023-08-04 08:23:02.000000000 +0200 +++ new/vendor/fortio.org/scli/scli.go 2023-08-06 09:52:21.000000000 +0200 @@ -80,6 +80,10 @@ log.Critf("Unable to watch config/flag changes in %v: %v", *configDir, err) } } + + // So http client library for instance ends up logging in JSON or color too and not break json parsing. + log.InterceptStandardLogger(log.Warning) + shortScliV, _, _ := version.FromBuildInfoPath("fortio.org/scli") hasStartedServer := false diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/vendor/modules.txt new/vendor/modules.txt --- old/vendor/modules.txt 2023-08-04 08:23:02.000000000 +0200 +++ new/vendor/modules.txt 2023-08-06 09:52:22.000000000 +0200 @@ -4,17 +4,17 @@ # fortio.org/cli v1.3.3 ## explicit; go 1.18 fortio.org/cli -# fortio.org/dflag v1.5.2 +# fortio.org/dflag v1.5.3 ## explicit; go 1.19 fortio.org/dflag fortio.org/dflag/configmap fortio.org/dflag/dynloglevel fortio.org/dflag/endpoint -# fortio.org/log v1.9.3 +# fortio.org/log v1.10.0 ## explicit; go 1.18 fortio.org/log fortio.org/log/goroutine -# fortio.org/scli v1.10.3 +# fortio.org/scli v1.11.0 ## explicit; go 1.18 fortio.org/scli # fortio.org/sets v1.0.3