Skip to content

[TT-7099] [Customer FR] Send info and debug messages to stdout not stderr - #1024

Open
shults wants to merge 1 commit into
masterfrom
TT-7099-customer-fr-send-info-and-debug-messages-to-stdout-not-stderr
Open

[TT-7099] [Customer FR] Send info and debug messages to stdout not stderr#1024
shults wants to merge 1 commit into
masterfrom
TT-7099-customer-fr-send-info-and-debug-messages-to-stdout-not-stderr

add ability to inject logger

958a99e
Select commit
Loading
Failed to load commit list.
probelabs / Visor: quality succeeded Jul 28, 2026 in 39s

✅ Check Passed (Warnings Found)

quality check passed. Found 2 warnings, but fail_if condition was not met.

Details

📊 Summary

  • Total Issues: 2
  • Warning Issues: 2

🔍 Failure Condition Results

Passed Conditions

  • global_fail_if: Condition passed

Issues by Category

Logic (1)

  • ⚠️ serializer/serializer.go:49 - The log message in the default case is misleading. When an unknown serializerType is provided, the code falls through to the default block, which logs that the MSGP_SERIALIZER is being used without indicating that a fallback occurred. This can be confusing for operators diagnosing configuration issues.

Style (1)

  • ⚠️ serializer/serializer_test.go:216 - The tests for the injected logger only assert that at least one log entry was created (len(hook.AllEntries()) > 0). This is a weak assertion as it doesn't validate the content of the log message. A more robust test would verify that the correct message is logged for each serializer type, which would have caught the misleading log message issue in the implementation.

Powered by Visor from Probelabs

💡 TIP: You can chat with Visor using /visor ask <your question>

Annotations

Check warning on line 51 in serializer/serializer.go

See this annotation in the file changed.

@probelabs probelabs / Visor: quality

logic Issue

The log message in the default case is misleading. When an unknown `serializerType` is provided, the code falls through to the `default` block, which logs that the `MSGP_SERIALIZER` is being used without indicating that a fallback occurred. This can be confusing for operators diagnosing configuration issues.
Raw output
Refactor the switch statement to handle the default case explicitly with a more informative log message that states which serializer was requested and which one is being used as a default. This avoids the `fallthrough` and makes the logging clearer.

Check warning on line 228 in serializer/serializer_test.go

See this annotation in the file changed.

@probelabs probelabs / Visor: quality

style Issue

The tests for the injected logger only assert that at least one log entry was created (`len(hook.AllEntries()) > 0`). This is a weak assertion as it doesn't validate the *content* of the log message. A more robust test would verify that the correct message is logged for each serializer type, which would have caught the misleading log message issue in the implementation.
Raw output
Strengthen the test assertions to check the content of the log messages. Use `require.Len` to ensure exactly one message is logged and `assert.Contains` to verify its content. This will make the tests more effective at catching regressions.