From 730f9ee0b38dc50b57f7404ae12bc335f9297613 Mon Sep 17 00:00:00 2001 From: Mikkel Hjortshoej Date: Thu, 2 Jul 2020 15:31:40 +0200 Subject: [PATCH 1/3] Fix misplaced line number (was wrongly formatted and before procedure) --- core/log/file_console_logger.odin | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/log/file_console_logger.odin b/core/log/file_console_logger.odin index 1c951a8ff..50632a64d 100644 --- a/core/log/file_console_logger.odin +++ b/core/log/file_console_logger.odin @@ -127,12 +127,6 @@ do_location_header :: proc(opts: Options, buf: ^strings.Builder, location := #ca if Location_File_Opts & opts != nil { fmt.sbprint(buf, file); } - if .Line in opts { - if (Location_File_Opts | {.Procedure}) & opts != nil { - fmt.sbprint(buf, ":"); - } - fmt.sbprint(buf, location.line); - } if .Procedure in opts { if Location_File_Opts & opts != nil { @@ -141,6 +135,12 @@ do_location_header :: proc(opts: Options, buf: ^strings.Builder, location := #ca fmt.sbprintf(buf, "%s()", location.procedure); } + if .Line in opts { + if (Location_File_Opts | {.Procedure}) & opts != nil { + fmt.sbprint(buf, ":"); + } + fmt.sbprint(buf, location.line); + } fmt.sbprint(buf, "] "); } From 83f553cd89f207549476b2b1aa1e600166748edd Mon Sep 17 00:00:00 2001 From: Mikkel Hjortshoej Date: Thu, 2 Jul 2020 16:11:41 +0200 Subject: [PATCH 2/3] Revert to old format and fix : when no file opt specified --- core/log/file_console_logger.odin | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/core/log/file_console_logger.odin b/core/log/file_console_logger.odin index 50632a64d..56e3e6c80 100644 --- a/core/log/file_console_logger.odin +++ b/core/log/file_console_logger.odin @@ -127,20 +127,19 @@ do_location_header :: proc(opts: Options, buf: ^strings.Builder, location := #ca if Location_File_Opts & opts != nil { fmt.sbprint(buf, file); } - - if .Procedure in opts { - if Location_File_Opts & opts != nil { - fmt.sbprint(buf, ":"); - } - fmt.sbprintf(buf, "%s()", location.procedure); - } - if .Line in opts { - if (Location_File_Opts | {.Procedure}) & opts != nil { + if Location_File_Opts & opts != nil { fmt.sbprint(buf, ":"); } fmt.sbprint(buf, location.line); } + if .Procedure in opts { + if (Location_File_Opts | {.Procedure}) & opts != nil { + fmt.sbprint(buf, ":"); + } + fmt.sbprintf(buf, "%s()", location.procedure); + } + fmt.sbprint(buf, "] "); } From d749f5c7048199ee4ac089aaa3a2b6747264598f Mon Sep 17 00:00:00 2001 From: Mikkel Hjortshoej Date: Thu, 2 Jul 2020 16:13:49 +0200 Subject: [PATCH 3/3] Fix typo --- core/log/file_console_logger.odin | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/log/file_console_logger.odin b/core/log/file_console_logger.odin index 56e3e6c80..ccecbc8b8 100644 --- a/core/log/file_console_logger.odin +++ b/core/log/file_console_logger.odin @@ -135,7 +135,7 @@ do_location_header :: proc(opts: Options, buf: ^strings.Builder, location := #ca } if .Procedure in opts { - if (Location_File_Opts | {.Procedure}) & opts != nil { + if (Location_File_Opts | {.Line}) & opts != nil { fmt.sbprint(buf, ":"); } fmt.sbprintf(buf, "%s()", location.procedure);