Last active
October 9, 2019 18:13
-
-
Save dhruvr/a27b84017ee9c66ef486ecb331eab436 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//f represnts io.file | |
// incase I don't need lumberjack and want to | |
// write to both Stdout and file | |
multi := io.MultiWriter(os.Stdout, f) | |
l := ConfigureLogrus(multi) | |
// in case I don't need lumberjack and want to | |
// write to file only | |
l := ConfigureLogrus(f) | |
// incase I don't need lumberjack and want to | |
// write to stdout only | |
l := ConfigureLogrus(os.Stdout) | |
//in case I want lumberjack and stdout | |
//lets say l is logrus instance | |
multi := io.MultiWriter(os.Stdout, l) | |
j := ConfigureLogrus(l) | |
and so on. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment