Commit graph

4 commits

Author SHA1 Message Date
Miek Gieben
5f114d38ca
pkg/log: add Clear to stop debug logging (#3372)
When reloading we need to disable debug output when the debug plugin is
removed from the config file. Add a `Clear` function to pkg/log and use
it in the server server.

Add test case in pkg/log, for actuall check I manually checked the
output by sprinkling some debug statements in the startup and checking
with sending SIGUSR1.

Also clear up the comments in pkg/log to remove the text about time
stamping.

Fixes: #3035

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-10-17 15:53:11 +01:00
Miek Gieben
a84413bd07
pkg/log: fix data race on d (#2698)
* pkg/log: fix data race on d

Wrap d in a mutex to prevent data race. This makes is slower, but this
is a debugging aid anyway. It's not used normally.

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix tests compilation

Signed-off-by: Miek Gieben <miek@miek.nl>

* Fix test compile

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-23 21:02:30 +01:00
Miek Gieben
d41e9ff7b7
pkg/log: reset the buffer in the tests (#2828)
Reset the buf otherwise we're not checking the new value.

Signed-off-by: Miek Gieben <miek@miek.nl>
2019-05-18 09:08:34 +01:00
Miek Gieben
b4b65fbc18
pkg/log: ability for debug logs (#1689)
* pkg/log: ability for debug logs

When the debug plugin is enabled all log.Debug calls will print to
standard; if not there are a noop (almost).

The log package wraps some standard log functions as well, so just
replacing "log" with "plugin/pkg/log" should be enough to use this
package.

* docs

* Add docs

* lint

* Test fallthrough to log pkg as well

* simple package - up test coverage

* add other log levels as well

* update docs
2018-04-18 21:02:01 +01:00