Add tests for handling invalid log levels in SetLogLevel
All checks were successful
Go CI/CD / go-ci (push) Successful in 10m4s

Ensure that setting an invalid log level with SetLogLevel does not affect existing log behavior. Additional test cases verify that only appropriate log messages are displayed based on the current log level.
This commit is contained in:
Rene Nochebuena 2025-04-10 10:02:49 -06:00
parent e84f7bd810
commit b7202bc141
Signed by: Rene Nochebuena
GPG Key ID: A9FD83117EA538D8

View File

@ -59,10 +59,17 @@ func Test_PlainTextLogs(t *testing.T) {
func Test_MutedPlainTextLogs(t *testing.T) {
InitStoneLog(ERROR, false, true)
// This won't change the log level
SetLogLevel(-1)
// Following won't appear
Trace("This is a trace log")
Debug("This is a debug log")
Observation("This is an observation log")
Hypothesis("This is a hypothesis log")
// Until this one
Failure("This is a failure log")
}