Conversation
2009645 to
a92dbe3
Compare
willscott
reviewed
Mar 24, 2020
willscott
left a comment
There was a problem hiding this comment.
that's very unfortunate that windows needs that!
setup.go
Outdated
| if logfp := os.Getenv(envLoggingFile); len(logfp) > 0 { | ||
| zapCfg.OutputPaths = append(zapCfg.OutputPaths, logfp) | ||
| if path, err := normalizePath(logfp); err != nil { | ||
| fmt.Fprintf(os.Stderr, "error normalizing log path '%q': %s\n", logfp, err) |
There was a problem hiding this comment.
should output paths revert to just stderr in this case? that doesn't seem obvious based on the printed error.
Member
Author
There was a problem hiding this comment.
Hm. Yeah, it probably should.
Member
Author
There was a problem hiding this comment.
Actually, that's what happens. I guess I can just add that to the message.
Fixes #73 by normalizing paths to UNC on windows. This is _slightly_ less hacky than registering a new schema. The underlying issue was twofold: 1. When specifying a windows file URL as `file://c:/foo/bar`, go barfs because `:` can't be in a domain name. 2. When specifying a windows file URL as `file:///c:/foo/bar`, we'd end up trying to open `/c:/foo/bar` which is actually `CURRENT_DRIVE:/c:/foo/bar`.
a92dbe3 to
45b384f
Compare
jacobheun
approved these changes
Mar 24, 2020
jacobheun
left a comment
There was a problem hiding this comment.
Verified logging the benchmark tests to file on windows works
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #73 by normalizing paths to UNC on windows. This is slightly less hacky than registering a new schema.
The underlying issue was twofold:
file://c:/foo/bar, go barfs because:can't be in a domain name.file:///c:/foo/bar, we'd end up trying to open/c:/foo/barwhich is actuallyCURRENT_DRIVE:/c:/foo/bar.