diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2024-06-15 18:01:49 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-06-15 18:01:49 +0200 |
| commit | ed99e77433ee05adf964210a4f6410b0f8c3683a (patch) | |
| tree | 4baadb077062a3c8939da3d1d191e9c6cd769653 /core/testing | |
| parent | bacb915ff843ca167e537fc35893f166335ed6a7 (diff) | |
| parent | 753516c3926766c51e78f8ff8933a4bef29affff (diff) | |
Merge pull request #3765 from Feoramund/add-short-test-logs
Add `ODIN_TEST_SHORT_LOGS` define
Diffstat (limited to 'core/testing')
| -rw-r--r-- | core/testing/logging.odin | 23 | ||||
| -rw-r--r-- | core/testing/runner.odin | 2 |
2 files changed, 18 insertions, 7 deletions
diff --git a/core/testing/logging.odin b/core/testing/logging.odin index 5bbbffeae..f1e75d33c 100644 --- a/core/testing/logging.odin +++ b/core/testing/logging.odin @@ -8,13 +8,22 @@ import "core:strings" import "core:sync/chan" import "core:time" -Default_Test_Logger_Opts :: runtime.Logger_Options { - .Level, - .Terminal_Color, - .Short_File_Path, - .Line, - .Procedure, - .Date, .Time, +when USING_SHORT_LOGS { + Default_Test_Logger_Opts :: runtime.Logger_Options { + .Level, + .Terminal_Color, + .Short_File_Path, + .Line, + } +} else { + Default_Test_Logger_Opts :: runtime.Logger_Options { + .Level, + .Terminal_Color, + .Short_File_Path, + .Line, + .Procedure, + .Date, .Time, + } } Log_Message :: struct { diff --git a/core/testing/runner.odin b/core/testing/runner.odin index 6a33436f6..a0f9eee31 100644 --- a/core/testing/runner.odin +++ b/core/testing/runner.odin @@ -41,6 +41,8 @@ PROGRESS_WIDTH : int : #config(ODIN_TEST_PROGRESS_WIDTH, 24) SHARED_RANDOM_SEED : u64 : #config(ODIN_TEST_RANDOM_SEED, 0) // Set the lowest log level for this test run. LOG_LEVEL : string : #config(ODIN_TEST_LOG_LEVEL, "info") +// Show only the most necessary logging information. +USING_SHORT_LOGS : bool : #config(ODIN_TEST_SHORT_LOGS, false) get_log_level :: #force_inline proc() -> runtime.Logger_Level { |