Repository: goreleaser/goreleaser
Pull request #2791 (2021-12-27 18:43:54)

fix: logext STDERR use warn instead of error
its common for CLIs to log to STDERR, showing those as errors seems a bit too much, changing them to warn for now. We can then evaluate and maybe change all to info if needed

codecov[bot]: # [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) Report
> Merging [#2791](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (0868501) into [main](https://codecov.io/gh/goreleaser/goreleaser/commit/3a04e75bd36e7dc3ba2ba586c7c57b72c94b5e5e?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) (3a04e75) will **not change** coverage.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/goreleaser/goreleaser/pull/2791/graphs/tree.svg?width=650&height=150&src=pr&token=3bJvv6b7hN&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)

```diff
@@           Coverage Diff           @@
##             main    #2791   +/-   ##
=======================================
  Coverage   84.95%   84.95%           
=======================================
  Files         106      106           
  Lines        8241     8241           
=======================================
  Hits         7001     7001           
  Misses       1010     1010           
  Partials      230      230           
```


| [Impacted Files](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser) | Coverage Δ | |
|---|---|---|
| [internal/logext/writer.go](https://codecov.io/gh/goreleaser/goreleaser/pull/2791/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser#diff-aW50ZXJuYWwvbG9nZXh0L3dyaXRlci5nbw==) | `97.05% <100.00%> (ø)` | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Last update [3a04e75...0868501](https://codecov.io/gh/goreleaser/goreleaser/pull/2791?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=goreleaser).


Patch:
diff --git a/go.mod b/go.mod
index c5c8414f..aeefca2c 100644
--- a/go.mod
+++ b/go.mod
@@ -18,7 +18,7 @@ require (
 	github.com/go-telegram-bot-api/telegram-bot-api v4.6.4+incompatible
 	github.com/google/go-github/v39 v39.2.0
 	github.com/goreleaser/fileglob v1.2.0
-	github.com/goreleaser/nfpm/v2 v2.11.1
+	github.com/goreleaser/nfpm/v2 v2.11.3
 	github.com/imdario/mergo v0.3.12
 	github.com/jarcoal/httpmock v1.0.8
 	github.com/mitchellh/go-homedir v1.1.0
diff --git a/go.sum b/go.sum
index 138dacb6..e419229a 100644
--- a/go.sum
+++ b/go.sum
@@ -490,8 +490,8 @@ github.com/goreleaser/chglog v0.1.2 h1:tdzAb/ILeMnphzI9zQ7Nkq+T8R9qyXli8GydD8plF
 github.com/goreleaser/chglog v0.1.2/go.mod h1:tTZsFuSZK4epDXfjMkxzcGbrIOXprf0JFp47BjIr3B8=
 github.com/goreleaser/fileglob v1.2.0 h1:OErqbdzeg/eibfDGPHDQDN8jL5u1jNyxA5IQzNPLLoU=
 github.com/goreleaser/fileglob v1.2.0/go.mod h1:rFyb2pXaK3YdnYnSjn6lifw0h2Q6s8OfOsx6I6bXkKE=
-github.com/goreleaser/nfpm/v2 v2.11.1 h1:q5iYYEoAGdK4LbAh6WJY7vdkFXwfhqIXpN8/gUplHvU=
-github.com/goreleaser/nfpm/v2 v2.11.1/go.mod h1:JDzAE2Jy8WsqZu4d7MIl6vhHTbc8ESZgqpfTA0hKdLQ=
+github.com/goreleaser/nfpm/v2 v2.11.3 h1:FoPqUv5HAcyTp76LQCvhX4ZhG1UdeClxjmYlwiWXb/k=
+github.com/goreleaser/nfpm/v2 v2.11.3/go.mod h1:JDzAE2Jy8WsqZu4d7MIl6vhHTbc8ESZgqpfTA0hKdLQ=
 github.com/gorilla/websocket v1.4.1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
 github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc=
 github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
diff --git a/internal/logext/writer.go b/internal/logext/writer.go
index d33c97f2..6c6f6cd9 100644
--- a/internal/logext/writer.go
+++ b/internal/logext/writer.go
@@ -47,7 +47,7 @@ func (w logWriter) Write(p []byte) (int, error) {
 		case Info:
 			w.ctx.Info(line)
 		case Error:
-			w.ctx.Error(line)
+			w.ctx.Warn(line)
 		}
 	}
 	return len(p), nil


Test patch:
diff --git a/internal/logext/testdata/TestWriter/debug/1.txt.golden b/internal/logext/testdata/TestWriter/debug/1.txt.golden
index 18a36d15..8a456c65 100644
--- a/internal/logext/testdata/TestWriter/debug/1.txt.golden
+++ b/internal/logext/testdata/TestWriter/debug/1.txt.golden
@@ -1,2 +1,2 @@
-      ⨯ foo                       foo=bar
-      ⨯ bar                       foo=bar
+      • foo                       foo=bar
+      • bar                       foo=bar