-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable configuring several log outputs #98
Conversation
The general design makes sense. |
setup.go
Outdated
@@ -263,5 +264,50 @@ func configFromEnv() Config { | |||
cfg.Stderr = false | |||
} | |||
|
|||
output := os.Getenv(envLoggingOutput) | |||
//TODO: fix lanzafame's super lazy impl... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, strings.Split
is in order here.
setup.go
Outdated
case "stderr": | ||
cfg.Stderr = true | ||
case "file": | ||
cfg.File = os.Getenv(envLoggingFile) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this line necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nope 👍
This PR introduces a new environment variable that allows a user to enable several log outputs for a logger. The env var is
GOLOG_OUTPUT
and takes a string of outputs concatenated by+
similar to how theStandardOutput
directive works in systems. An example value would befile+stderr
which ifGOLOG_FILE
was set, would log to both the file and stderr.