Overrideable stdin, stdout, stderr at the context level

This commit is contained in:
gingerBill
2019-03-30 14:51:42 +00:00
parent a019059975
commit 68d4bde82f
3 changed files with 15 additions and 7 deletions
+1 -1
View File
@@ -69,7 +69,7 @@ file_console_logger_proc :: proc(logger_data: rawptr, level: Level, text: string
h : os.Handle;
if(data.file_handle != os.INVALID_HANDLE) do h = data.file_handle;
else do h = level <= Level.Error ? os.stdout : os.stderr;
else do h = level <= Level.Error ? context.stdout : context.stderr;
backing: [1024]byte; //NOTE(Hoej): 1024 might be too much for a header backing, unless somebody has really long paths.
buf := strings.builder_from_slice(backing[:]);