mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Add ODIN_TEST_SHORT_LOGS define
Strips out the procedure, date, and time information, for when you just need to know the file, line, and message.
This commit is contained in:
@@ -8,13 +8,22 @@ import "core:strings"
|
|||||||
import "core:sync/chan"
|
import "core:sync/chan"
|
||||||
import "core:time"
|
import "core:time"
|
||||||
|
|
||||||
Default_Test_Logger_Opts :: runtime.Logger_Options {
|
when USING_SHORT_LOGS {
|
||||||
.Level,
|
Default_Test_Logger_Opts :: runtime.Logger_Options {
|
||||||
.Terminal_Color,
|
.Level,
|
||||||
.Short_File_Path,
|
.Terminal_Color,
|
||||||
.Line,
|
.Short_File_Path,
|
||||||
.Procedure,
|
.Line,
|
||||||
.Date, .Time,
|
}
|
||||||
|
} else {
|
||||||
|
Default_Test_Logger_Opts :: runtime.Logger_Options {
|
||||||
|
.Level,
|
||||||
|
.Terminal_Color,
|
||||||
|
.Short_File_Path,
|
||||||
|
.Line,
|
||||||
|
.Procedure,
|
||||||
|
.Date, .Time,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Log_Message :: struct {
|
Log_Message :: struct {
|
||||||
|
|||||||
@@ -41,6 +41,8 @@ PROGRESS_WIDTH : int : #config(ODIN_TEST_PROGRESS_WIDTH, 24)
|
|||||||
SHARED_RANDOM_SEED : u64 : #config(ODIN_TEST_RANDOM_SEED, 0)
|
SHARED_RANDOM_SEED : u64 : #config(ODIN_TEST_RANDOM_SEED, 0)
|
||||||
// Set the lowest log level for this test run.
|
// Set the lowest log level for this test run.
|
||||||
LOG_LEVEL : string : #config(ODIN_TEST_LOG_LEVEL, "info")
|
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 {
|
get_log_level :: #force_inline proc() -> runtime.Logger_Level {
|
||||||
|
|||||||
Reference in New Issue
Block a user