Add test for muted plaintext log behavior
Some checks failed
Go CI/CD / go-ci (push) Has been cancelled

This test verifies that logs below the ERROR level are properly muted when plaintext logging is enabled without JSON formatting. It ensures that log output adheres to the configured log level settings.
This commit is contained in:
Rene Nochebuena 2025-04-10 10:00:55 -06:00
parent 00e6488185
commit e84f7bd810
Signed by: Rene Nochebuena
GPG Key ID: A9FD83117EA538D8

View File

@ -57,6 +57,15 @@ func Test_PlainTextLogs(t *testing.T) {
SetLogLevel(INFO)
}
func Test_MutedPlainTextLogs(t *testing.T) {
InitStoneLog(ERROR, false, true)
Trace("This is a trace log")
Debug("This is a debug log")
Observation("This is an observation log")
Hypothesis("This is a hypothesis log")
Failure("This is a failure log")
}
func Test_JSONLogs(t *testing.T) {
InitStoneLog(TRACE, true, false)
Trace("This is a trace log")