Skip to content
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

Merged
merged 5 commits into from
Jun 26, 2020
Merged

enable configuring several log outputs #98

merged 5 commits into from
Jun 26, 2020

Conversation

lanzafame
Copy link
Contributor

@lanzafame lanzafame commented Jun 22, 2020

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 the StandardOutput directive works in systems. An example value would be file+stderr which if GOLOG_FILE was set, would log to both the file and stderr.

@lanzafame lanzafame requested a review from Stebalien June 22, 2020 02:15
@Stebalien
Copy link
Member

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...
Copy link
Member

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.

@lanzafame lanzafame requested a review from Kubuxu June 25, 2020 01:40
setup.go Outdated
case "stderr":
cfg.Stderr = true
case "file":
cfg.File = os.Getenv(envLoggingFile)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nope 👍

@Kubuxu Kubuxu merged commit 0016c0b into master Jun 26, 2020
@Kubuxu Kubuxu deleted the fix/env-var-config branch June 26, 2020 10:49
@Stebalien Stebalien mentioned this pull request May 11, 2021
27 tasks
@aschmahmann aschmahmann mentioned this pull request May 14, 2021
71 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants