elazarl / goproxy

An HTTP proxy library for Go
BSD 3-Clause "New" or "Revised" License
6.06k stars 1.1k forks source link

How can I completely close the log information #422

Closed Threezh1 closed 3 years ago

Threezh1 commented 3 years ago

Hello, I want to close all warning messages like the following, what should I do? I have tried proxy.Verbose = false, but this does not completely turn them off.

image

CoolSpring8 commented 3 years ago

Since all log messages are written via a customizable logger (in ctx.go), this should just do the trick: proxy.Logger = log.New(ioutil.Discard, "", 0)

Threezh1 commented 3 years ago

Since all log messages are written via a customizable logger (in ctx.go), this should just do the trick: proxy.Logger = log.New(ioutil.Discard, "", 0)

Thank you very much