minimize allocations in logger and tunnel code (#1323)

* logs alloc

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* fix allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* tunnel allocs

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* try to fix tunnel

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* cache cipher for send

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>

* more logger

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2020-03-11 20:55:39 +03:00
parent 1205227bd3
commit d7aec2236e

View File

@ -7,7 +7,7 @@ import (
"sync"
"time"
log "github.com/micro/go-micro/v2/logger"
"github.com/micro/go-micro/v2/logger"
"github.com/micro/go-micro/v2/registry"
)
@ -339,7 +339,9 @@ func (c *cache) run() {
c.setStatus(err)
if a > 3 {
log.Info("rcache: ", err, " backing off ", d)
if logger.V(logger.InfoLevel, logger.DefaultLogger) {
logger.Info("rcache: ", err, " backing off ", d)
}
a = 0
}
@ -362,7 +364,9 @@ func (c *cache) run() {
c.setStatus(err)
if b > 3 {
log.Info("rcache: ", err, " backing off ", d)
if logger.V(logger.InfoLevel, logger.DefaultLogger) {
logger.Info("rcache: ", err, " backing off ", d)
}
b = 0
}