On 2020-05-06 16:54, Ian Lance Taylor wrote: > Sorry, can you show an example of what you mean? As far as I can > tell, you can call log.SetOutput multiple times, and it will affect > all subsequent output of the standard logger, up to the next call to > log.SetOutput.
Indeed and I am perfectly happy with the log information I can provide manually and the performance of locking only in case of an actual error. Perhaps I left out a critical go routine part that likely explains why it is technically infeasible? Go routines are so easy to use I kind of forgot that I was using one, whilst writing. If you call log.SetOutput within main then it affects all functions and even the programs it executes if the cmd os.stdout is redirected. If you use log.SetOutput within a go routine, even if you delay main to make sure there is no race. Then mains following log.Print and following functions or executions log output are not redirected? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/c7fabeb5-2c80-6ef6-236d-2ee074f3104f%40gmail.com.