From b7202bc141d462e71bc832faeb68d2cd85ccf274 Mon Sep 17 00:00:00 2001 From: Rene Nochebuena Date: Thu, 10 Apr 2025 10:02:49 -0600 Subject: [PATCH] Add tests for handling invalid log levels in SetLogLevel 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. --- log_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/log_test.go b/log_test.go index fb83b29..026ee90 100644 --- a/log_test.go +++ b/log_test.go @@ -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") }