Skip to content

Commit 764aca2

Browse files
Suppress "transport is closing" log spam (#5539) (#10739)
Signed-off-by: Modular Magician <[email protected]>
1 parent e39c5a8 commit 764aca2

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changelog/5539.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:none
2+
3+
```

google/config.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,10 @@ type Formatter struct {
6565

6666
// Borrowed logic from https://github.com/sirupsen/logrus/blob/master/json_formatter.go and https://github.com/t-tomalak/logrus-easy-formatter/blob/master/formatter.go
6767
func (f *Formatter) Format(entry *logrus.Entry) ([]byte, error) {
68-
if !logging.IsDebugOrHigher() {
69-
return nil, nil // Suppress logs if TF_LOG is not DEBUG or TRACE
68+
// Suppress logs if TF_LOG is not DEBUG or TRACE
69+
// also suppress frequent transport spam
70+
if !logging.IsDebugOrHigher() || strings.Contains(entry.Message, "transport is closing") {
71+
return nil, nil
7072
}
7173
output := f.LogFormat
7274
entry.Level = logrus.DebugLevel // Force Entries to be Debug

0 commit comments

Comments
 (0)