Log System Implementation #1

Merged
Rene Nochebuena merged 10 commits from feature/log-system-implementation into develop 2025-04-10 18:03:57 -06:00

10 Commits

Author SHA1 Message Date
a7c6a85084
Refactor test binary location and update sonar exclusions
All checks were successful
Go CI/CD / go-ci (pull_request) Successful in 10m12s
Go CI/CD / go-ci (push) Successful in 10m8s
Moved the test binary from "tests" to "testbin" for better organization. Updated `sonar-project.properties` to exclude the new directory from analysis and adjusted test references accordingly.
2025-04-10 10:57:51 -06:00
d126d4ef7a
Add tests for panic and fatal log handling
Some checks failed
Go CI/CD / go-ci (push) Has been cancelled
Introduce tests for handling panic and fatal log scenarios, including recovery from panics and execution of external processes to test fatal behavior. Adjusted logging levels and prefixes to ensure consistency for PANIC logs.
2025-04-10 10:48:34 -06:00
b7202bc141
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.
2025-04-10 10:02:49 -06:00
e84f7bd810
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.
2025-04-10 10:00:55 -06:00
00e6488185
Validate log level and improve test coverage
Some checks failed
Go CI/CD / go-ci (push) Has been cancelled
Added validation to ensure log levels are within valid bounds in `SetLogLevel`. Simplified prefix mapping logic by removing the fallback to INFO level. Expanded test coverage with new test cases for plain text and JSON log outputs.
2025-04-10 09:50:54 -06:00
b66a17197e
Add paths for Go test and coverage reports in Sonar config
Some checks failed
Go CI/CD / go-ci (push) Failing after 6m52s
This update includes `test-report.out` and `coverage.out` for improved test and coverage integration with SonarQube analysis. It ensures better reporting and alignment with project quality standards.
2025-04-10 08:30:19 -06:00
4557b8050c
Add tests for log level string and color representations
Some checks failed
Go CI/CD / go-ci (push) Failing after 6m59s
Introduce unit tests to verify the string and color outputs of StoneLevel. These tests ensure the correct mapping of log levels to their respective string values and color codes.
2025-04-10 08:12:56 -06:00
8fad79b823
Set SonarQube to wait for quality gate results.
All checks were successful
Go CI/CD / go-ci (push) Successful in 10m8s
Added `sonar.qualitygate.wait=true` to enforce the build process waits for SonarQube's quality gate results. This ensures code quality checks are completed before proceeding.
2025-04-09 23:28:01 -06:00
4046c447cc
Refactor getRandomPrefix to simplify StoneLevel mapping.
All checks were successful
Go CI/CD / go-ci (push) Successful in 10m4s
Replaced the switch-case with a map for StoneLevel to prefix mapping. This reduces redundancy, improves readability, and maintains default handling for unsupported levels. Functionality remains unchanged.
2025-04-09 23:04:35 -06:00
94c6e882fb
Add a structured logging utility with custom prefixes and suffixes
Some checks failed
Go CI/CD / go-ci (push) Has been cancelled
Introduce a logging system supporting multiple severity levels, JSON formatting, and customizable prefixes and suffixes inspired by Dr. Stone. Includes random success and failure quotes to make logging more dynamic and engaging.
2025-04-09 22:54:16 -06:00