mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
A Stat error other than not-exist was reported as absent, and the --zip archive was readable by other users. The rest is review follow-up: export no longer prints, one runner type, shared name helpers, a trimmed log API.
23 lines
609 B
Go
23 lines
609 B
Go
package log
|
|
|
|
import (
|
|
"io"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestSetVerbose(t *testing.T) {
|
|
t.Cleanup(func() { defaultLogger.SetLevel(InfoLevel) }) // restore package default
|
|
|
|
assert.False(t, defaultLogger.canLogAt(DebugLevel), "Debug must be suppressed by default")
|
|
SetVerbose()
|
|
assert.True(t, defaultLogger.canLogAt(DebugLevel), "SetVerbose must enable Debug")
|
|
}
|
|
|
|
func TestSetLevelInvalidPanics(t *testing.T) {
|
|
logger := NewLogger(newBase(io.Discard))
|
|
assert.Panics(t, func() { logger.SetLevel(DebugLevel - 1) })
|
|
assert.Panics(t, func() { logger.SetLevel(WarnLevel + 1) })
|
|
}
|